git » jasper.git » main » tree

[main] / PKGBUILD

# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Eric BĂ©langer <eric@archlinux.org>

pkgbase=jasper
pkgname=('jasper' 'jasper-doc')
pkgver=4.2.1
pkgrel=1
pkgdesc='Software-based implementation of the codec specified in the emerging JPEG-2000 Part-1 standard'
url='https://www.ece.uvic.ca/~frodo/jasper/'
arch=('x86_64' 'armv7h')
license=('custom:JasPer2.0')
makedepends=('glibc' 'libjpeg' 'freeglut' 'libxmu' 'glu' 'cmake' 'doxygen' 'libxxf86vm')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/mdadams/jasper/archive/version-${pkgver}.tar.gz)
sha512sums=('2da4b72e7566fb3f1240fe8e058f2801642d2a2a8bed6e89f1a32209d22d715bff811a99102ba2cfe0eb566f0fb2292bbefffe75a17011995e35ab8f6bc8a417')
b2sums=('9fed19af29e9aecccc7e7676761d7e6eff75ae23e062f99738441d21b2ec9abe6271deee5f759bca79e6f283f534693cfc99c0df9777b8530a5bbd21621bd7b1')

prepare() {
  cd ${pkgbase}-version-${pkgver}
  sed -r 's|(CMAKE_SKIP_BUILD_RPATH) FALSE|\1 TRUE|g' -i CMakeLists.txt
}

build() {
  cmake \
    -B buildx -S ${pkgbase}-version-${pkgver} \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects" \
    -DJAS_ENABLE_OPENGL=ON \
    -DJAS_ENABLE_LIBJPEG=ON \
    -DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF \
    -DCMAKE_SKIP_RPATH=ON \
    -DJAS_ENABLE_SHARED=ON
  cmake --build buildx
}

#check() {
#  export LD_LIBRARY_PATH="$(pwd)/buildx/src/libjasper/"
#  make -C buildx -j1 test
#}

package_jasper() {
  depends=('glibc' 'libjpeg' 'libjpeg.so' 'freeglut' 'glu')
  optdepends=('jasper-doc: documentation')
  provides=('libjasper.so')

  make -C buildx DESTDIR="${pkgdir}" install
  rm -r "${pkgdir}/usr/share/doc"

  install -Dm 644 ${pkgbase}-version-${pkgver}/{NEWS.txt,README.md}  -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 ${pkgbase}-version-${pkgver}/LICENSE.txt  -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

package_jasper-doc() {
  pkgdesc+=' (documentation)'
  optdepends=('jasper')

  make -C buildx DESTDIR="${pkgdir}" install
  rm -rf "${pkgdir}/usr/"{bin,include,lib,share/man}

  install -Dm 644 ${pkgbase}-version-${pkgver}/LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et: