# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 inherit eutils autotools multilib versionator flag-o-matic toolchain-funcs DESCRIPTION="AFPL GhostPDL" HOMEPAGE="https://www.ghostscript.com/download/" MY_P=${P} PVM=$(get_version_component_range 1-2) PVM_S=$(replace_all_version_separators "" ${PVM}) SRC_URI="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${PVM_S}/${P}.tar.gz" LICENSE="AGPL-3 CPL-1.0" SLOT="0" KEYWORDS="x86 amd64" IUSE="cups X xps svg" RDEPEND="!X? ( x11-libs/libX11 x11-libs/libXt x11-libs/libXext )" S=${WORKDIR}/${P} src_compile() { cd ${S} einfo "Patching default fonts dir to /usr/share/fonts/pclfonts" epatch ${FILESDIR}/fontsdir-${PV}.patch econf || die emake all || die } src_install() { exeinto "/usr/bin" doexe ${S}/bin/gpcl6 ${S}/pcl/tools/pcl2pdf ${S}/pcl/tools/pcl2pdfwr use svg && doexe ${S}/bin/gsvg use xps && doexe ${S}/bin/gxps insinto "/usr/share/fonts/pclfonts" doins ${S}/pcl/urwfonts/*.ttf dodoc ${S}/doc/pclxps/ghostpdl.* #${S}/NEWS ${S}/README if use cups ; then exeinto "/usr/libexec/cups/filter" doexe ${FILESDIR}/pcltops if [ `grep -c pcltops /etc/cups/mime.convs` = 0 ]; then cat ${FILESDIR}/mime.convs /etc/cups/mime.convs > mime.convs cat ${FILESDIR}/mime.types /etc/cups/mime.types > mime.types insinto /etc/cups doins mime.convs mime.types fi fi einfo "Use the PCLFONTSOURCE environment variable to use more fonts" einfo "as stored in /usr/share/fonts/pclfonts" }