# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: Frank Ickstadt (frank dot ickstadt at gmail dot com)
pkgname=argyllcms
pkgver=3.1.0
pkgrel=1
pkgdesc="An ICC compatible color management system with support for different colorimeter hardware"
arch=(armv7h 'aarch64')
url="https://www.argyllcms.com/"
license=(GPL AGPL)
depends=(libpng libtiff libxss libxinerama libxxf86vm libxrandr openssl)
makedepends=(ftjam zip unzip)
source=("https://www.argyllcms.com/Argyll_V${pkgver}_src.zip")
sha256sums=('4fdd5a1d7bc6dde79a54e350ec9374f6ef00b53903ee0d184cdfa4a11f0ecdcb')
prepare() {
cd Argyll_V${pkgver}
# Use hwdb builtin, instead of the obsolete usb-db in the udev rules.
sed -i 's:^TEST=="/lib/udev/usb-db", IMPORT{program}="usb-db %p":IMPORT{builtin}="hwdb --subsystem=usb":' usb/55-Argyll.rules
# Use LDFLAGS
echo "LINKFLAGS += ${LDFLAGS} ;" >> Jamtop
}
build() {
cd Argyll_V${pkgver}
CCOPTFLAG="$CFLAGS"
jam -q -fJambase ${MAKEFLAGS} -sPREFIX=/usr -sDESTDIR="${pkgdir}" -sREFSUBDIR=share/argyllcms/ref all
}
package() {
cd Argyll_V${pkgver}
jam -q -fJambase ${MAKEFLAGS} -sPREFIX=/usr -sDESTDIR="${pkgdir}" -sREFSUBDIR=share/argyllcms/ref install
rm "${pkgdir}"/usr/bin/License.txt
rm {doc,ref}/afiles
install -Dm644 doc/*.* -t "${pkgdir}"/usr/share/${pkgname}/doc/
install -Dm644 doc/ccmxs/*.ccmx -t "${pkgdir}"/usr/share/${pkgname}/doc/ccmxs/
install -Dm644 usb/55-Argyll.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
}