Files
haikuports/app-text/ghostscript_gpl/ghostscript_gpl-9.22.recipe
2017-10-22 15:52:28 +03:00

127 lines
3.4 KiB
Bash

SUMMARY="An interpreter for the PostScript language and for PDF"
DESCRIPTION="Ghostscript is a suite of software based on an interpreter for \
Adobe Systems' PostScript and Portable Document Format (PDF) page description \
languages. Its main purposes are the rasterization or rendering of such page \
description language files, for the display or printing of document pages, and \
the conversion between PostScript and PDF files."
HOMEPAGE="https://ghostscript.com/"
COPYRIGHT="2001-2017 Artifex Software, Inc."
LICENSE="AGPL-3.0"
REVISION="1"
SOURCE_URI="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs922/ghostscript-$portVersion.tar.gz"
CHECKSUM_SHA256="7f5f4487c0df9dce37481e4c8f192c0322e4c69f5a2ba900a7833c992331bcf4"
SOURCE_DIR="ghostscript-$portVersion"
ARCHITECTURES="?x86_gcc2 ?x86 x86_64"
SECONDARY_ARCHITECTURES="?x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
ghostscript$secondaryArchSuffix = $portVersion
cmd:dvipdf$commandSuffix
cmd:eps2eps$commandSuffix
cmd:font2c$commandSuffix
cmd:gs$commandSuffix
cmd:gsbj$commandSuffix
cmd:gsdj$commandSuffix
cmd:gsdj500$commandSuffix
cmd:gslj$commandSuffix
cmd:gslp$commandSuffix
cmd:gsnd$commandSuffix
cmd:lprsetup.sh$commandSuffix
cmd:pfbtopfa$commandSuffix
cmd:pdf2dsc$commandSuffix
cmd:pdf2ps$commandSuffix
cmd:pf2afm$commandSuffix
cmd:pphs$commandSuffix
cmd:printafm$commandSuffix
cmd:ps2ascii$commandSuffix
cmd:ps2epsi$commandSuffix
cmd:ps2pdf$commandSuffix
cmd:ps2pdfwr$commandSuffix
cmd:ps2pdf12$commandSuffix
cmd:ps2pdf13$commandSuffix
cmd:ps2pdf14$commandSuffix
cmd:ps2ps$commandSuffix
cmd:ps2ps2$commandSuffix
cmd:unix_lpr.sh$commandSuffix
cmd:wftopfa$commandSuffix
"
REQUIRES="
haiku$secondaryArchSuffix
poppler_data
lib:libfontconfig$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libidn$secondaryArchSuffix
lib:libjbig2dec$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:liblcms2$secondaryArchSuffix
lib:libpaper$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libtiff$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libfontconfig$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libidn$secondaryArchSuffix
devel:libjbig2dec$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:liblcms2$secondaryArchSuffix
devel:libpaper$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libtiff$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:awk
cmd:find
cmd:gcc$secondaryArchSuffix
cmd:grep
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:sed
"
BUILD()
{
# Set up fonts paths
local FONTPATH
for path in \
$fontsDir/otfonts \
$fontsDir/psfonts \
$fontsDir/ttfonts \
$fontsDir/X11
do
FONTPATH="$FONTPATH${FONTPATH:+:}$path"
done
# Force configure to use system-libs
rm -rf {freetype,jbig2dec,jpeg,lcms2,libpng,tiff,zlib}
# Do configure
runConfigure --omit-dirs binDir ./configure \
--bindir=$commandBinDir \
--with-fontpath="$FONTPATH"
# Ghostscript bug, already patched upstream
sed -i 's/AUXEXTRALIBS=$(EXTRALIBS)/AUXEXTRALIBS=$(EXTRALIBS) -lz/' Makefile
# Do make
make $jobArgs
}
INSTALL()
{
make install
}