PKGBUILDs/extra/jbigkit/PKGBUILD

69 lines
2.6 KiB
Bash
Raw Normal View History

2024-05-09 02:31:10 +00:00
# Maintainer: Balló György <ballogyor+arch at gmail dot com>
2023-09-05 12:41:40 +00:00
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
2014-10-10 15:25:37 +00:00
# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Contributor: Frank Ickstadt (frank dot ickstadt at gmail dot com)
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2023-09-05 12:41:40 +00:00
# - build with -fPIC
2014-10-10 15:25:37 +00:00
pkgname=jbigkit
pkgver=2.1
2024-05-09 02:31:10 +00:00
pkgrel=8
pkgdesc='Data compression library/utilities for bi-level high-resolution images'
arch=('x86_64')
url='https://www.cl.cam.ac.uk/~mgk25/jbigkit/'
license=('GPL-2.0-or-later')
depends=('glibc')
source=("https://www.cl.cam.ac.uk/~mgk25/download/$pkgname-$pkgver.tar.gz"
'jbigkit-2.1-shared_lib.patch'
'jbigkit-2.1-build_warnings.patch'
'jbigkit-2.1-ldflags.patch'
'jbigkit-2.1-coverity.patch'
'0013-new-jbig.c-limit-s-maxmem-maximum-decoded-image-size.patch'
'0015-jbg_newlen-check-for-end-of-file-within-MARKER_NEWLE.patch')
sha256sums=('de7106b6bfaf495d6865c7dd7ac6ca1381bd12e0d81405ea81e7f2167263d932'
'cb404e8c1d67d0788368a58f2c3da83bcf5c7049139461b16c144d1018e83174'
'e9616f9eccfa567738b0c470708d60b086b4e0c5c6017449c7f09d0ba9335e28'
'dc44325606c1c22f075e87e81091fbf1543c6792dda311c071b0d50d7786ff17'
'6abe6e18d830e811ff6d386e899f9a6bce1da7f5ed5613930e8e0c79d16c52ea'
'6dcddabc07864435a3c65227309e43cb66c27e08cb33851d7a7ef123fda08e29'
'bc3924f03446dba996a192deab7c4dddd1293ef2bcc7aef61edcbc3223fc10a0')
2014-10-10 15:25:37 +00:00
2023-09-05 12:41:40 +00:00
prepare() {
2024-05-09 02:31:10 +00:00
cd $pkgname-$pkgver
2023-09-05 12:41:40 +00:00
# instead of a static library, create a shared library
2024-05-09 02:31:10 +00:00
patch -Np1 -i ../jbigkit-2.1-shared_lib.patch
2023-09-05 12:41:40 +00:00
# fix build warnings
2024-05-09 02:31:10 +00:00
patch -Np1 -i ../jbigkit-2.1-build_warnings.patch
2023-09-05 12:41:40 +00:00
# apply distribution LDFLAGS
2024-05-09 02:31:10 +00:00
patch -Np1 -i ../jbigkit-2.1-ldflags.patch
2023-09-05 12:41:40 +00:00
# fix coverity issues
2024-05-09 02:31:10 +00:00
patch -Np1 -i ../jbigkit-2.1-coverity.patch
# security fixes from upstream
patch -Np1 -i ../0013-new-jbig.c-limit-s-maxmem-maximum-decoded-image-size.patch
patch -Np1 -i ../0015-jbg_newlen-check-for-end-of-file-within-MARKER_NEWLE.patch
2014-10-10 15:25:37 +00:00
}
2023-09-05 12:41:40 +00:00
build() {
2024-05-09 02:31:10 +00:00
cd $pkgname-$pkgver
2023-09-05 12:41:40 +00:00
CFLAGS+=" -fPIC"
2024-05-09 02:31:10 +00:00
make EXTRA_CFLAGS="$CFLAGS"
2023-09-05 12:41:40 +00:00
}
2014-10-10 15:25:37 +00:00
2023-09-05 12:41:40 +00:00
check() {
2024-05-09 02:31:10 +00:00
cd $pkgname-$pkgver
2023-09-05 12:41:40 +00:00
# NOTE: tests can not be parallelized
2024-05-09 02:31:10 +00:00
make test -j1
2023-09-05 12:41:40 +00:00
}
2014-10-10 15:25:37 +00:00
2023-09-05 12:41:40 +00:00
package() {
cd $pkgname-$pkgver
install -vDm 644 libjbig/*.h -t "$pkgdir/usr/include/"
install -vDm 755 libjbig/*.so.* -t "$pkgdir/usr/lib/"
for lib in libjbig.so libjbig85.so; do
ln -sv "$lib.$pkgver" "$pkgdir/usr/lib/$lib"
done
install -vDm 755 pbmtools/{jbgtopbm{,85},pbmtojbg{,85}} -t "$pkgdir/usr/bin/"
install -vDm 644 pbmtools/*.1* -t "$pkgdir/usr/share/man/man1/"
2014-10-10 15:25:37 +00:00
}