pkgname=ghostscript pkgver=10.04.0 pkgrel=1 pkgdesc="An interpreter for the PostScript language" arch=('x86_64') url="https://www.ghostscript.com/" license=('AGPL-3.0-or-later') depends=( 'fontconfig' 'glib2' 'glibc' 'lcms2' 'libcups' 'libidn' 'libjpeg-turbo' 'libpaper' 'libpng' 'libtiff' 'libx11' 'libxt' 'libxext' 'openjpeg' 'zlib' ) makedepends=('gnutls') source=(https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${pkgver//./}/${pkgname}-${pkgver}.tar.xz https://downloads.sourceforge.net/gs-fonts/ghostscript-fonts-std-8.11.tar.gz https://downloads.sourceforge.net/gs-fonts/gnu-gs-fonts-other-6.0.tar.gz) sha256sums=(527eef0b6cd04ecf1c8d7a11796c69a52d34ffe36afca86a400729a2fc01c887 0eb6f356119f2e49b2563210852e17f57f9dcc5755f350a69a46a0d641a0c401 8146cccc4699fe9dab841446bdd17039f4769c903eceb54409188b920754aab3) prepare() { cd ${pkgname}-${pkgver} rm -rf cups/libs expat freetype lcms2mt jpeg libpng openjpeg zlib } build() { cd ${pkgname}-${pkgver} local configure_args=( --disable-compile-inits --with-system-libtiff ${configure_options} ) export CFLAGS+=" -Wno-incompatible-pointer-types -Wno-int-conversion" ./configure ${configure_args[@]} make so } package() { cd ${pkgname}-${pkgver} make DESTDIR=${pkgdir} install make DESTDIR=${pkgdir} soinstall install -v -m644 base/*.h ${pkgdir}/usr/include/ghostscript ln -sfvn ghostscript ${pkgdir}/usr/include/ps mv -v ${pkgdir}/usr/share/doc/ghostscript/${pkgver} ${pkgdir}/usr/share/doc/${pkgname}-${pkgver} rmdir ${pkgdir}/usr/share/doc/ghostscript cp -r examples/ -T ${pkgdir}/usr/share/ghostscript/${pkgver}/examples cp -ar ${srcdir}/fonts ${pkgdir}/usr/share/ghostscript }