archrelease: copy trunk to extra-x86_64
[arch-packages.git] / jasper / repos / extra-x86_64 / PKGBUILD
blobc82782b874bf620454072dd4a9956fbda0a7f2a1
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Maintainer: Eric BĂ©langer <eric@archlinux.org>
4 pkgbase=jasper
5 pkgname=('jasper' 'jasper-doc')
6 pkgver=4.0.0
7 pkgrel=1
8 pkgdesc='Software-based implementation of the codec specified in the emerging JPEG-2000 Part-1 standard'
9 url='https://www.ece.uvic.ca/~frodo/jasper/'
10 arch=('x86_64')
11 license=('custom:JasPer2.0')
12 makedepends=('glibc' 'libjpeg' 'freeglut' 'libxmu' 'glu' 'cmake' 'doxygen')
13 options=('debug')
14 source=(${pkgname}-${pkgver}.tar.gz::https://github.com/mdadams/jasper/archive/version-${pkgver}.tar.gz
15         jasper-1.900.1-fix-filename-buffer-overflow.patch)
16 sha512sums=('dc03434870e85b1fdbdf41a3e07ce5a8044c8d225717d3d7a5969d45e3bd716bfb2abc4b4e0b8cec2f4071a7520c5d3e48939dba0cabe6d192eacd593de0c563'
17             'b8d798bf75523c5db263783e42c653dd0cb03deee90be32eddf878bb6893cca02abadd94de6a8c737a5b7fe76f7fb245979f010765e6a95fc520b215e3a2a7f0')
18 b2sums=('d4d8ae3324f3753e999adee57c215b89fa0ddeb3d945f10de15459a7d6566f1de9cbcd27a418bcc3c128bc138fff7e3f1cc157b6750d2d7dc1216f8e8cbc8bea'
19         '9b1927a437ed9b32491f07a210600b5a7d10711ec954dadc030a8238b67e9c6d1a8e67956fd7a5515e7060f0a1651fa86763e21d6d20592f8f00e9d3260722a1')
21 prepare() {
22   cd ${pkgbase}-version-${pkgver}
23   patch -p1 < "${srcdir}/jasper-1.900.1-fix-filename-buffer-overflow.patch"
24   sed -r 's|(CMAKE_SKIP_BUILD_RPATH) FALSE|\1 TRUE|g' -i CMakeLists.txt
27 build() {
28   cd ${pkgbase}-version-${pkgver}
30   cmake \
31     -B buildx \
32     -DCMAKE_INSTALL_PREFIX=/usr \
33     -DCMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects" \
34     -DJAS_ENABLE_OPENGL=ON \
35     -DJAS_ENABLE_LIBJPEG=ON \
36     -DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF \
37     -DCMAKE_SKIP_RPATH=ON \
38     -DJAS_ENABLE_SHARED=ON
39   cmake --build buildx
42 check() {
43   cd ${pkgbase}-version-${pkgver}
44   export LD_LIBRARY_PATH="$(pwd)/buildx/src/libjasper/"
45   make -C buildx -j1 test
48 package_jasper() {
49   depends=('glibc' 'libjpeg' 'libjpeg.so' 'freeglut' 'glu')
50   optdepends=('jasper-doc: documentation')
51   provides=('libjasper.so')
53   cd ${pkgbase}-version-${pkgver}
54   make -C buildx DESTDIR="${pkgdir}" install
55   rm -r "${pkgdir}/usr/share/doc"
57   install -Dm 644 NEWS.txt README.md  -t "${pkgdir}/usr/share/doc/${pkgname}"
58   install -Dm 644 LICENSE.txt  -t "${pkgdir}/usr/share/licenses/${pkgname}"
61 package_jasper-doc() {
62   pkgdesc+=' (documentation)'
63   optdepends=('jasper')
65   cd ${pkgbase}-version-${pkgver}
66   make -C buildx DESTDIR="${pkgdir}" install
67   rm -rf "${pkgdir}/usr/"{bin,include,lib,share/man}
69   install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
72 # vim: ts=2 sw=2 et: