vp-build/srcpkgs/ghostscript/template

109 lines
2.8 KiB
Bash

# Template file for 'ghostscript'
pkgname=ghostscript
version=9.22
revision=1
short_desc="An interpreter for the PostScript language"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://www.ghostscript.com/"
license="AGPL-3, CPL-1.0"
distfiles="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${version/./}/ghostscript-${version}.tar.xz"
checksum=c1f862e6f40f997dbe3feba89355e8cb05d55818994e10f4932b0dd9b627d1bb
hostmakedepends="automake libtool pkg-config"
makedepends="
zlib-devel dbus-devel libXext-devel libXt-devel libpng-devel
fontconfig-devel jasper-devel tiff-devel lcms2-devel jbig2dec-devel
cups-devel libpaper-devel"
depends="gsfonts"
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" ${makedepends}"
fi
pre_configure() {
# force it to use system libs.
rm -rf zlib jpeg libpng jasper expat tiff lcms2 freetype cups/libs jbig2dec
# add missing LDFLAGS
sed -i 's/-L$(BINDIR)/& $(LDFLAGS)/g' base/unix-dll.mak
cd ijs
autoreconf -fi
}
do_configure() {
cd ${wrksrc}
# configure ghostscript
if [ "$CROSS_BUILD" ]; then
export CCAUX=cc CFLAGSAUX=${XBPS_CFLAGS}
fi
./configure ${configure_args} --enable-dynamic --with-ijs \
--with-jbig2dec --with-omni --with-x --with-drivers=ALL \
--with-fontpath=/usr/share/fonts/Type1:/usr/share/fonts \
--enable-fontconfig --enable-freetype --enable-openjpeg \
--with-libpaper --without-luratech --without-omni \
--with-system-libtiff --disable-compile-inits
# configure libijs
cd ijs
./configure ${configure_args} --enable-shared --disable-static
}
do_build() {
# build ghostscript
make ${makejobs}
make ${makejobs} so
# build libijs
cd ijs
make ${makejobs}
}
do_install() {
# install ghostscript
make DESTDIR=${DESTDIR} cups_serverroot=${DESTDIR}/etc/cups \
cups_serverbin=${DESTDIR}/usr/lib/cups install install-so
# install missing doc files # http://bugs.archlinux.org/task/18023
install -m644 doc/{VectorDevices.htm,gs-vms.hlp,gsdoc.el,pscet_status.txt} \
${DESTDIR}/usr/share/ghostscript/$version/doc/
# install license
vlicense LICENSE
# remove unwanted localized man-pages
rm -rf ${DESTDIR}/usr/share/man/[^man1]*
# install libijs
cd ijs
make DESTDIR=${DESTDIR} install
# Remove conflicting files with cups-filters.
rm -f ${DESTDIR}/usr/lib/cups/filter/{gstopxl,gstoraster}
cd ..
# Install missing file
vinstall base/gserrors.h 644 usr/include/ghostscript
}
libgs_package() {
short_desc+=" - runtime shared library"
pkg_install() {
vmove "usr/lib/libgs.so*"
}
}
libijs_package() {
short_desc+=" - IJS runtime shared library"
pkg_install() {
vmove "usr/lib/libijs*"
}
}
ghostscript-devel_package() {
depends="libijs>=${version}_${revision} libgs>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
}
}