PKGBUILDs/community/freeimage/PKGBUILD
2018-06-13 22:26:50 +00:00

54 lines
1.8 KiB
Bash

# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Mihai Militaru <mihai.militaru@gmx.com>
# Contributor: scippio <scippio@berounet.cz>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - build AArch64 with -fPIC
pkgname=freeimage
pkgver=3.17.0
pkgrel=6
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
}