# Maintainer: Sven-Hendrik Haase # Contributor: Thomas Dziedzic < gostrc at gmail > # Contributor: Stefan Husmann # Contributor: Mihai Militaru # Contributor: scippio # ALARM: Kevin Mihelich # - build AArch64 with -fPIC pkgname=freeimage pkgver=3.17.0 pkgrel=8 pkgdesc="Library project for developers who would like to support popular graphics image formats" arch=('x86_64') license=('GPL' 'custom:FIPL') url="http://freeimage.sourceforge.net/" depends=('libjpeg-turbo' 'openexr' 'openjpeg2' 'libwebp' 'libraw' 'jxrlib') makedepends=('mesa' 'glu') source=("https://downloads.sourceforge.net/project/freeimage/Source%20Distribution/${pkgver}/FreeImage${pkgver//./}.zip" freeimage-unbundle.patch CVE-2015-0852.patch CVE-2016-5684.patch) md5sums=('459e15f0ec75d6efa3c7bd63277ead86' 'c336ba01a7fab92bff97f78140f190e9' 'b21385e2da5dcdf4aa4e98d11150115d' '2efbe4123d832930778b7c146d4f60f1') prepare() { cd FreeImage patch -p1 -i ../CVE-2016-5684.patch patch -p1 -i ../CVE-2015-0852.patch patch -p1 -i ../freeimage-unbundle.patch # Unbundle libraries (Fedora) rm -r Source/Lib* Source/ZLib Source/OpenEXR # can't be built due to private headers > Source/FreeImage/PluginG3.cpp > Source/FreeImageToolkit/JPEGTransform.cpp } build() { cd FreeImage [[ $CARCH == "aarch64" ]] && CFLAGS+=" -fPIC" && CXXFLAGS+=" -fPIC" sh gensrclist.sh sh genfipsrclist.sh make -f Makefile.gnu make -f Makefile.fip } package() { cd FreeImage make -f Makefile.gnu DESTDIR=${pkgdir} install make -f Makefile.fip DESTDIR=${pkgdir} install install -D -m644 ${srcdir}/FreeImage/license-fi.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE }