# Maintainer: PktSurf <smlinux@pktsurf.in>
app=ghostscript
version=9.27
build=1sml
homepage="https://www.ghostscript.com/"
download="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs927/ghostscript-9.27.tar.xz"
desc="Postscript and PDF interpreter"
requires="expat zlib libpng libtiff libjpeg-turbo jbig2dec lcms2"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version 
  fixbuilddirpermissions

  # get rid of in-tree lib copies
  rm -rf expat freetype lcms lcms2 jpeg libpng tiff lcms lcms2 cups/libs jbig2dec
}

build() {
  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --enable-dynamic \
    --with-system-libtiff \
    --disable-cups \
    --disable-compile-inits \
    --with-jbig2dec \
    --with-x \
    --disable-gtk \
    --without-luratech

  make so-only
  make soinstall DESTDIR=$pkg 

  cp LICENSE $pkgdocs/

  mkfinalpkg
}

sha512sums="
7c855768a9e934959c9e952af04e74af990a7a655b44f7a6c150edeed9ca1b143bdac4df5f5c4d605a681e432f0919310dce95e504145d95af848fce37f3eb84  ghostscript-9.27.tar.lz
"
