Christoph Reiter aa5852e6c4 pathtools: expose sanitise_path() again
this doesn't really work if the private headers aren't included since the
prototype is missing then
2023-10-30 21:01:44 +01:00

119 lines
3.9 KiB
Bash

# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_realname=graphicsmagick
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.3.42
pkgrel=1
pkgdesc="An image viewing/manipulation program (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="http://www.graphicsmagick.org/"
license=("spdx:MIT")
makedepends=("${MINGW_PACKAGE_PREFIX}-ghostscript"
"${MINGW_PACKAGE_PREFIX}-libheif"
"${MINGW_PACKAGE_PREFIX}-libjxl"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-cc"
"txt2html")
depends=("${MINGW_PACKAGE_PREFIX}-bzip2"
"${MINGW_PACKAGE_PREFIX}-fontconfig"
"${MINGW_PACKAGE_PREFIX}-freetype"
"${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-glib2"
"${MINGW_PACKAGE_PREFIX}-jasper"
"${MINGW_PACKAGE_PREFIX}-jbigkit"
"${MINGW_PACKAGE_PREFIX}-lcms2"
"${MINGW_PACKAGE_PREFIX}-libxml2"
"${MINGW_PACKAGE_PREFIX}-libpng"
"${MINGW_PACKAGE_PREFIX}-libtiff"
"${MINGW_PACKAGE_PREFIX}-libwebp"
"${MINGW_PACKAGE_PREFIX}-libwmf"
"${MINGW_PACKAGE_PREFIX}-libltdl"
"${MINGW_PACKAGE_PREFIX}-libwinpthread-git"
"${MINGW_PACKAGE_PREFIX}-omp"
"${MINGW_PACKAGE_PREFIX}-xz"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
#"${MINGW_PACKAGE_PREFIX}-perl"
optdepends=("${MINGW_PACKAGE_PREFIX}-ghostscript: for Ghostscript support"
"${MINGW_PACKAGE_PREFIX}-libheif: for HEIF support"
"${MINGW_PACKAGE_PREFIX}-libjxl: for JPEG XL support")
options=('staticlibs' 'strip' 'libtool')
source=(https://sourceforge.net/projects/graphicsmagick/files/${_realname}/${pkgver}/GraphicsMagick-${pkgver}.tar.xz
pathtools.c
pathtools.h
001-relocate.patch)
sha256sums=('484fccfd2b2faf6c2ba9151469ece5072bcb91ba4ed73e75ed3d8e46c759d557'
'ebf471173f5ee9c4416c10a78760cea8afaf1a4a6e653977321e8547ce7bf3c0'
'1585ef1b61cf53a2ca27049c11d49e0834683dfda798f03547761375df482a90'
'73ce65aad39e54b786c332a9aac42d39353af02cf32e3fbfe4e607644cc0a254')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
# =========================================== #
prepare() {
test ! -d "${startdir}/../mingw-w64-pathtools" || {
cmp "${startdir}/../mingw-w64-pathtools/pathtools.c" "${srcdir}/pathtools.c" &&
cmp "${startdir}/../mingw-w64-pathtools/pathtools.h" "${srcdir}/pathtools.h"
} || exit 1
cd GraphicsMagick-${pkgver}
cp -fHv "${srcdir}"/pathtools.[ch] magick/
apply_patch_with_msg \
001-relocate.patch
autoreconf -fiv
}
build() {
[[ -d ${srcdir}/build-${MSYSTEM} ]] && rm -rf ${srcdir}/build-${MSYSTEM}
mkdir -p ${srcdir}/build-${MSYSTEM} && cd ${srcdir}/build-${MSYSTEM}
export lt_cv_deplibs_check_method='pass_all'
../GraphicsMagick-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--enable-shared \
--disable-static \
--with-quantum-depth=16 \
--with-modules \
--with-wmf \
--with-xml \
--with-lcms2 \
--with-heif \
--with-jp2 \
--with-jxl \
--with-webp \
--with-jbig \
--without-fpx \
--without-dps \
--without-perl \
--without-x
make
}
package() {
cd ${srcdir}/build-${MSYSTEM}
make -j1 DESTDIR="${pkgdir}" install
local PREFIX_WIN=$(cygpath -m ${MINGW_PREFIX})
# fix path references in some files.
find ${pkgdir}${MINGW_PREFIX}/bin -name "*-config" -exec \
sed "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i {} \;
find ${pkgdir}${MINGW_PREFIX}/ -name "*.la" -exec \
sed "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i {} \;
}