Christoph Reiter 619a8198e5 Add some CPEs
2024-03-26 11:53:19 +01:00

124 lines
4.1 KiB
Bash

# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_realname=ghostscript
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=10.02.1
pkgrel=1
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
msys2_references=(
'archlinux: ghostscript'
"cpe: cpe:/a:artifex:ghostscript"
"cpe: cpe:/a:artifex:gpl_ghostscript"
)
msys2_documentation_url="https://ghostscript.readthedocs.io/"
msys2_repository_url="https://git.ghostscript.com/?p=ghostpdl.git"
url="https://www.ghostscript.com/"
license=('AGPL' 'custom')
pkgdesc="An interpreter for the PostScript language (mingw-w64)"
depends=("${MINGW_PACKAGE_PREFIX}-dbus"
"${MINGW_PACKAGE_PREFIX}-expat"
"${MINGW_PACKAGE_PREFIX}-freetype"
"${MINGW_PACKAGE_PREFIX}-fontconfig"
"${MINGW_PACKAGE_PREFIX}-gdk-pixbuf2"
"${MINGW_PACKAGE_PREFIX}-jbig2dec"
"${MINGW_PACKAGE_PREFIX}-libiconv"
"${MINGW_PACKAGE_PREFIX}-libidn"
"${MINGW_PACKAGE_PREFIX}-libpaper"
"${MINGW_PACKAGE_PREFIX}-libpng"
"${MINGW_PACKAGE_PREFIX}-libjpeg"
"${MINGW_PACKAGE_PREFIX}-libtiff"
#"${MINGW_PACKAGE_PREFIX}-lcms2" # Use ghostscript's fork of LCMS2 as it patched to be threadsafe
"${MINGW_PACKAGE_PREFIX}-openjpeg2"
"${MINGW_PACKAGE_PREFIX}-zlib")
makedepends=("${MINGW_PACKAGE_PREFIX}-gtk3"
"${MINGW_PACKAGE_PREFIX}-gnutls"
"${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-cc")
optdepends=("${MINGW_PACKAGE_PREFIX}-gtk3: needed for gsx")
source=(https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${pkgver//./}/ghostscript-${pkgver}.tar.xz
001-mingw-build.patch
002-ghostscript-sys-zlib.patch
003-libspectre.patch
005-add-arm-arch-config.patch)
sha256sums=('8c58c948b0721becefcd0029c8db95f9bb3268affc25ea01d4c5a6b07fa1ab08'
'444e674b1abd8427590394ccc445206651a2f45593ba3c7336fa1b619877a8ed'
'ce9b0e8bb4e3bbe00ec32b65af1ca35f88a1d1f39c1016f2f5a2a86b7b1ca5a4'
'a1c284d5472e81073ef2f0a445a6238660b9203a7913c315834cac30f34ec146'
'4749c639175d3b35b16f33639d98f3a8ec3510171303c49b7efaa5015f649cf6')
noextract=(ghostscript-${pkgver}.tar.xz)
_apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -p1 -i "${srcdir}/${_patch}"
done
}
prepare() {
tar -xJf ${srcdir}/${_realname}-${pkgver}.tar.xz -C ${srcdir} || true
cd "${srcdir}/${_realname}-${pkgver}"
_apply_patch_with_msg \
001-mingw-build.patch \
002-ghostscript-sys-zlib.patch \
003-libspectre.patch \
005-add-arm-arch-config.patch
sed -e "s|/usr|${MINGW_PREFIX}/${MINGW_CHOST}|g" -i base/all-arch.mak base/unix-aux.mak
# force it to use system-libs
rm -rf expat freetype jbig2dec jpeg libpng openjpeg tiff zlib tesseract leptonica
#cd base
libtoolize --force --copy --install
autoconf -f -i
}
build()
{
cd ${srcdir}/${_realname}-${pkgver}
./configure \
--prefix=${MINGW_PREFIX} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--build=${MINGW_CHOST} \
--disable-contrib \
--enable-fontconfig \
--enable-dbus \
--enable-freetype \
--disable-cups \
--enable-openjpeg \
--enable-gtk \
--with-jbig2dec \
--with-libiconv=gnu \
--with-libidn \
--with-libpaper \
--with-system-libtiff \
--without-x \
--with-drivers=ALL
make DEVICE_DEVS_EXTRA="soobj/bbox.dev" so
#make gs.a
}
package() {
cd ${srcdir}/${_realname}-${pkgver}
make DESTDIR="${pkgdir}" soinstall
#install -D -m644 "${srcdir}"/${_realname}-${pkgver}/gs.a "${pkgdir}"/${MINGW_PREFIX}/lib/libgs.a
mkdir -p "${pkgdir}${MINGW_PREFIX}"/share/${_realname}/${pkgver}/
cp -rf "${srcdir}"/${_realname}-${pkgver}/doc "${pkgdir}${MINGW_PREFIX}"/share/${_realname}/${pkgver}/
install -D -m644 "${srcdir}"/${_realname}-${pkgver}/LICENSE "${pkgdir}${MINGW_PREFIX}"/share/licenses/${_realname}/LICENSE
cp ${pkgdir}${MINGW_PREFIX}/bin/{gsc,gswin32c}.exe
cp ${pkgdir}${MINGW_PREFIX}/bin/{gsc,gs}.exe
# remove unwanted localized man-pages
rm -rf "${pkgdir}${MINGW_PREFIX}"/share/man/[^man1]*
}