diff --git a/mingw-w64-ghostscript/001-mingw-build.patch b/mingw-w64-ghostscript/001-mingw-build.patch index 937e5ce9ff..3c7a7473c4 100644 --- a/mingw-w64-ghostscript/001-mingw-build.patch +++ b/mingw-w64-ghostscript/001-mingw-build.patch @@ -1,6 +1,6 @@ --- a/base/gp_mswin.c +++ b/base/gp_mswin.c -@@ -989,7 +989,7 @@ +@@ -738,7 +738,7 @@ /* ------------------------- _snprintf -----------------------------*/ @@ -11,7 +11,7 @@ /* Microsoft Visual C++ 2005 doesn't properly define snprintf, --- a/base/gp_mswin.h +++ b/base/gp_mswin.h -@@ -56,4 +56,13 @@ +@@ -58,4 +58,13 @@ #endif /* !defined(RC_INVOKED) */ @@ -27,7 +27,7 @@ #endif /* gp_mswin_INCLUDED */ --- a/base/gs.mak +++ b/base/gs.mak -@@ -520,6 +520,7 @@ +@@ -538,6 +538,7 @@ # save our set of makefile variables that are defined in every build (paths, etc.) $(gconfigd_h) : $(ECHOGS_XE) $(GS_MAK) $(GLSRCDIR)$(D)version.mak $(MAKEDIRS) $(EXP)$(ECHOGS_XE) -w $(gconfigd_h) -x 23 define -s -u GS_LIB_DEFAULT -x 2022 $(GS_LIB_DEFAULT) -x 22 @@ -191,9 +191,9 @@ /* Posix 1003.1b-1993 section 4.8.1.5 says that --- a/base/unix-aux.mak +++ b/base/unix-aux.mak -@@ -69,6 +69,13 @@ - $(UNIX_AUX_MAK) $(MAKEDIRS) - $(GLCC) $(GLO_)gp_sysv.$(OBJ) $(C_) $(GLSRC)gp_sysv.c +@@ -54,6 +54,13 @@ + $(stdio__h) $(time__h) $(unistd__h) $(gx_h) $(gp_h) $(UNIX_AUX_MAK) $(MAKEDIRS) + $(GLCCAUX) $(AUXO_)gp_stdia.$(OBJ) $(C_) $(GLSRC)gp_stdia.c +# the MINGW platform / build environment, joining unix for the ride +mingw__=$(GLOBJ)gp_wgetv.$(OBJ) $(GLOBJ)gp_wpapr.$(OBJ) $(GLOBJ)gp_win32.$(OBJ) $(GLOBJ)gp_mswin.$(OBJ) $(GLOBJ)gp_ntfs.$(OBJ) $(GLOBJ)gp_winfs.$(OBJ) $(GLOBJ)gp_stdia.$(OBJ) $(GLOBJ)gp_wutf8.$(OBJ) $(GLOBJ)gp_nxpsprn.$(OBJ) @@ -205,7 +205,7 @@ # -------------------------- Auxiliary programs --------------------------- # $(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(UNIX_AUX_MAK) $(MAKEDIRS) -@@ -91,18 +98,31 @@ +@@ -79,18 +86,31 @@ # To get GS to use the system zlib, you remove/hide the gs/zlib directory # which means that the mkromfs build can't find the zlib source it needs. # So it's split into two targets, one using the zlib source directly..... @@ -260,7 +260,7 @@ GSSOC_XE=$(BINDIR)/$(GSSOC_XENAME) GSSOC=$(BINDIR)/$(GSSOC_XENAME) -@@ -52,12 +52,28 @@ +@@ -52,12 +57,28 @@ GPDLSOC=$(BINDIR)/$(GPDLSOC_XENAME) # loader suporting display device using Gtk+ @@ -292,7 +292,7 @@ PCL_SONAME_BASE=lib$(PCL_SO_BASE) XPS_SONAME_BASE=lib$(XPS_SO_BASE) GPDL_SONAME_BASE=lib$(GPDL_SO_BASE) -@@ -140,13 +140,13 @@ +@@ -119,13 +140,13 @@ # Create symbolic links to the Ghostscript interpreter library @@ -311,7 +311,7 @@ $(PCL_SO): $(PCL_SO_MAJOR) $(UNIX_DLL_MAK) $(MAKEDIRS) $(RM_) $(PCL_SO) -@@ -212,12 +212,12 @@ +@@ -170,12 +191,12 @@ # Build the small Ghostscript loaders, with Gtk+ and without $(GSSOC_XE): gs-so-links-subtarget $(PSSRC)dxmainc.c $(UNIX_DLL_MAK) $(MAKEDIRS) @@ -327,7 +327,7 @@ $(PCLSOC_XE): gpcl6-so-links-subtarget $(UNIX_DLL_MAK) $(PLOBJ)$(REALMAIN_SRC).$(OBJ) $(MAKEDIRS) $(GLCC) -L$(BINDIR) $(LDFLAGS) $(O_) $(PCLSOC_XE) $(PLOBJ)$(REALMAIN_SRC).$(OBJ) -l$(PCL_SO_BASE) -@@ -222,7 +222,7 @@ +@@ -222,7 +243,7 @@ SODEFS=\ GS_DOT_O= \ REALMAIN_OBJ= \ @@ -336,7 +336,7 @@ GPCL_XE=$(BINDIR)/$(PCL_SONAME_MAJOR_MINOR) \ GXPS_XE=$(BINDIR)/$(XPS_SONAME_MAJOR_MINOR) \ GPDL_XE=$(BINDIR)/$(GPDL_SONAME_MAJOR_MINOR) \ -@@ -313,11 +313,17 @@ +@@ -311,11 +332,17 @@ -mkdir -p $(DESTDIR)$(gsincludedir) $(INSTALL_PROGRAM) $(GSSOC) $(DESTDIR)$(bindir)/$(GSSOC_XENAME) $(INSTALL_PROGRAM) $(GSSOX) $(DESTDIR)$(bindir)/$(GSSOX_XENAME) @@ -363,7 +363,7 @@ +++ b/base/unix-gcc.mak @@ -79,7 +79,7 @@ INSTALL_DATA = $(INSTALL) -m 644 - INSTALL_SHARED = + INSTALL_SHARED = -prefix = /usr/local +prefix = /usr @@ -541,7 +541,7 @@ fontpath="$datadir/fonts/default/ghostscript" --- a/Makefile.in +++ b/Makefile.in -@@ -60,6 +60,14 @@ +@@ -65,6 +65,14 @@ CONTRIBDIR=@srcdir@/contrib @@ -556,7 +556,7 @@ # Do not edit the next group of lines. include $(GLSRCDIR)/version.mak -@@ -433,7 +441,7 @@ +@@ -499,7 +507,7 @@ # Solaris may need -lnsl -lsocket -lposix4. # (Libraries required by individual drivers are handled automatically.) @@ -565,7 +565,7 @@ AUXEXTRALIBS=@AUXEXTRALIBS@ @AUX_SHARED_ZLIB@ # Define the standard libraries to search at the end of linking. -@@ -484,9 +492,10 @@ +@@ -550,9 +558,10 @@ RM=rm -f # ------ Dynamic loader options ------- # @@ -579,7 +579,7 @@ # on virtually every Unix-a-like system, this is "so", # but Apple just had to be different, so it's now set -@@ -637,7 +646,16 @@ +@@ -702,7 +711,16 @@ CC_LEAF=$(CC_) CCFLAGSAUX=$(GENOPTAUX) $(CAPOPTAUX) $(CFLAGSAUX) @@ -597,7 +597,7 @@ # note gcc can't use -fomit-frame-pointer with -pg. CC_LEAF_PG=$(CC_) -@@ -707,6 +726,12 @@ +@@ -786,6 +804,12 @@ @CONTRIBINCLUDE@ @CUPSINCLUDE@ diff --git a/mingw-w64-ghostscript/002-ghostscript-sys-zlib.patch b/mingw-w64-ghostscript/002-ghostscript-sys-zlib.patch index 19bce4d04e..b0fb4fde9b 100644 --- a/mingw-w64-ghostscript/002-ghostscript-sys-zlib.patch +++ b/mingw-w64-ghostscript/002-ghostscript-sys-zlib.patch @@ -1,11 +1,11 @@ --- a/configure.ac +++ b/configure.ac -@@ -912,7 +912,7 @@ +@@ -1390,7 +1390,7 @@ dnl zlib is needed for language level 3, and libpng # we must define ZLIBDIR regardless because png.mak does a -I$(ZLIBDIR) # this seems a harmless default -ZLIBDIR=src +ZLIBDIR=$includedir AUX_SHARED_ZLIB= + ZLIBCFLAGS="" - if test -d $srcdir/zlib; then diff --git a/mingw-w64-ghostscript/003-libspectre.patch b/mingw-w64-ghostscript/003-libspectre.patch index b1c1201693..a6449af7a9 100644 --- a/mingw-w64-ghostscript/003-libspectre.patch +++ b/mingw-w64-ghostscript/003-libspectre.patch @@ -1,6 +1,6 @@ --- a/psi/iapi.h +++ b/psi/iapi.h -@@ -246,6 +246,7 @@ +@@ -312,6 +312,7 @@ int argc, char **argv); #ifdef __WIN32__ diff --git a/mingw-w64-ghostscript/PKGBUILD b/mingw-w64-ghostscript/PKGBUILD index 8dc5ce8fec..7855f3d1fd 100644 --- a/mingw-w64-ghostscript/PKGBUILD +++ b/mingw-w64-ghostscript/PKGBUILD @@ -36,25 +36,32 @@ source=(https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/ 003-libspectre.patch 004-FT_CALLBACK_DEF-deprecated.patch 005-add-arm-arch-config.patch) -options=('staticlibs' 'strip') sha256sums=('9c9f5bc85b6c7eb08368c05b1e3339f7aaf9677ddca710c6283f872d55e2a234' - '4638b24bb6e399e67e18f82317be1b54aa9bb87a0ae3b60585b607d529cb0342' - '9cf9805e6b8329e83656c16475c9fc7b7b8c3e459a782b4755abdabbb8f22df4' - '5b0ef04d59658885f183a6c820a5dbbb89e57e4c43774bc6c90ae4fb742b2be7' + '0119e3d36e30248e5608a05c4c771ce0709fdb6e860371fb2930220269f3546b' + 'd657267d49c93f1e23e10373671077a882090620ae254b20dc6c9cbf7a696c91' + '671ceebf281a60b06ad77c9be0cf66e37f931f955c05c595e475cab851e92e67' 'e338e4b6877119acdc2899e4d89b9b31e3993dc0564f16744e320789387eebf9' 'a67daf2e14244602a8804bddf27450b111b88e4aefc5946d0deda9aa482a5881') noextract=(ghostscript-${pkgver}.tar.xz) +_apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -p1 -i "${srcdir}/${_patch}" + done +} + prepare() { - [[ -d ${srcdir}/${_realname}-${pkgver} ]] && rm -rf ${srcdir}/${_realname}-${pkgver} tar -xJf ${srcdir}/${_realname}-${pkgver}.tar.xz -C ${srcdir} || true cd "${srcdir}/${_realname}-${pkgver}" - patch -p1 -i ${srcdir}/001-mingw-build.patch - patch -p1 -i ${srcdir}/002-ghostscript-sys-zlib.patch - patch -p1 -i ${srcdir}/003-libspectre.patch - patch -p1 -i ${srcdir}/004-FT_CALLBACK_DEF-deprecated.patch - patch -p1 -i ${srcdir}/005-add-arm-arch-config.patch + _apply_patch_with_msg \ + 001-mingw-build.patch \ + 002-ghostscript-sys-zlib.patch \ + 003-libspectre.patch \ + 004-FT_CALLBACK_DEF-deprecated.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