mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
ghostscript: fix build on x86 32bit + enable libgs.so
There seem to e support in unix-lib.mak for building a shared lib, but somehow it is not being used. So there are some ugly hacks.
This commit is contained in:
@@ -7,15 +7,14 @@ the conversion between PostScript and PDF files."
|
||||
HOMEPAGE="https://ghostscript.com/"
|
||||
COPYRIGHT="2001-2018 Artifex Software, Inc."
|
||||
LICENSE="AGPL-3.0"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${portVersion/./}/ghostscript-$portVersion.tar.xz"
|
||||
CHECKSUM_SHA256="a2971a23bf15bbd9ddcd173141b15504e51ddc1d5a0a0144b00a6a8b14a62fed"
|
||||
SOURCE_DIR="ghostscript-$portVersion"
|
||||
PATCHES="ghostscript_gpl-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
|
||||
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
fi
|
||||
|
||||
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
|
||||
commandBinDir=$binDir
|
||||
@@ -29,12 +28,14 @@ PROVIDES="
|
||||
cmd:eps2eps
|
||||
cmd:font2c
|
||||
cmd:gs
|
||||
cmd:gsc
|
||||
cmd:gsbj
|
||||
cmd:gsdj
|
||||
cmd:gsdj500
|
||||
cmd:gslj
|
||||
cmd:gslp
|
||||
cmd:gsnd
|
||||
cmd:gsx
|
||||
cmd:lprsetup.sh
|
||||
cmd:pfbtopfa
|
||||
cmd:pdf2dsc
|
||||
@@ -53,6 +54,7 @@ PROVIDES="
|
||||
cmd:ps2ps2
|
||||
cmd:unix_lpr.sh
|
||||
cmd:wftopfa
|
||||
lib:libgs$secondaryArchSuffix = 9.25 compat >= 9
|
||||
"
|
||||
|
||||
REQUIRES="
|
||||
@@ -70,6 +72,16 @@ REQUIRES="
|
||||
lib:libz$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
ghostscript_gpl${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libgs$secondaryArchSuffix = 9.25 compat >= 9
|
||||
"
|
||||
|
||||
REQUIRES_devel="
|
||||
ghostscript_gpl${secondaryArchSuffix} == $portVersion base
|
||||
"
|
||||
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libfontconfig$secondaryArchSuffix
|
||||
@@ -101,10 +113,10 @@ BUILD()
|
||||
# Set up fonts paths
|
||||
local FONTPATH
|
||||
for path in \
|
||||
$(findpath B_FIND_PATH_FONTS_DIRECTORY otfonts) \
|
||||
$(findpath B_FIND_PATH_FONTS_DIRECTORY psfonts) \
|
||||
$(findpath B_FIND_PATH_FONTS_DIRECTORY ttfonts) \
|
||||
$(findpath B_FIND_PATH_FONTS_DIRECTORY X11)
|
||||
$(findpaths B_FIND_PATH_FONTS_DIRECTORY otfonts) \
|
||||
$(findpaths B_FIND_PATH_FONTS_DIRECTORY psfonts) \
|
||||
$(findpaths B_FIND_PATH_FONTS_DIRECTORY ttfonts) \
|
||||
$(findpaths B_FIND_PATH_FONTS_DIRECTORY X11)
|
||||
do
|
||||
FONTPATH="$FONTPATH${FONTPATH:+:}$path"
|
||||
done
|
||||
@@ -119,11 +131,16 @@ BUILD()
|
||||
|
||||
# Do make
|
||||
make $jobArgs
|
||||
make so $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install
|
||||
make soinstall
|
||||
|
||||
prepareInstalledDevelLib libgs
|
||||
packageEntries devel $developDir
|
||||
}
|
||||
|
||||
TEST()
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
From a75adcb0ccfd3dba5a465d426c00f273906356e6 Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||
Date: Sun, 10 Mar 2019 13:45:11 +0100
|
||||
Subject: Fix build on x86 32bit
|
||||
|
||||
Conflict of macro name with a struct field in one of our headers.
|
||||
|
||||
diff --git a/psi/estack.h b/psi/estack.h
|
||||
index f48c726..4a59ff9 100644
|
||||
--- a/psi/estack.h
|
||||
+++ b/psi/estack.h
|
||||
@@ -18,6 +18,8 @@
|
||||
#ifndef estack_INCLUDED
|
||||
# define estack_INCLUDED
|
||||
|
||||
+#include <signal.h> /* before we #define esp, which prevents it from building */
|
||||
+
|
||||
#include "iestack.h"
|
||||
#include "icstate.h" /* for access to exec_stack */
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
|
||||
From d3eb5678711e49002b17cc2e4e619cccebc90129 Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||
Date: Sun, 10 Mar 2019 15:45:05 +0100
|
||||
Subject: Fix linking of shared lib.
|
||||
|
||||
|
||||
diff --git a/base/ugcclib.mak b/base/ugcclib.mak
|
||||
index f3c5005..0da7d74 100644
|
||||
--- a/base/ugcclib.mak
|
||||
+++ b/base/ugcclib.mak
|
||||
@@ -171,7 +171,7 @@ include $(GLSRCDIR)/unix-aux.mak
|
||||
LIB_ONLY=$(GLOBJ)gsnogc.$(OBJ) $(GLOBJ)gconfig.$(OBJ) $(GLOBJ)gscdefs.$(OBJ) $(GLOBJ)gsromfs$(COMPILE_INITS).$(OBJ)
|
||||
ldt_tr=$(GLOBJ)ldt.tr
|
||||
$(GS_XE): $(ld_tr) $(ECHOGS_XE) $(LIB_ALL) $(DEVS_ALL) $(GLOBJ)gslib.$(OBJ) $(LIB_ONLY)
|
||||
- $(ECHOGS_XE) -w $(ldt_tr) -n - $(CCLD) $(LDFLAGS) -o $(GS_XE)
|
||||
+ $(ECHOGS_XE) -w $(ldt_tr) -n - $(CCLD) $(LDFLAGS_SO) -o $(GS_XE)
|
||||
$(ECHOGS_XE) -a $(ldt_tr) -n -s $(GLOBJ)gslib.$(OBJ) -s
|
||||
$(ECHOGS_XE) -a $(ldt_tr) -n -s $(LIB_ONLY) -s
|
||||
cat $(ld_tr) >>$(ldt_tr)
|
||||
diff --git a/base/unix-dll.mak b/base/unix-dll.mak
|
||||
index 8d22a1d..2afb94e 100644
|
||||
--- a/base/unix-dll.mak
|
||||
+++ b/base/unix-dll.mak
|
||||
@@ -82,7 +82,7 @@ GPDL_SONAME=$(GPDL_SONAME_BASE)$(GS_SOEXT)$(GS_DLLEXT)
|
||||
GPDL_SONAME_MAJOR=$(GPDL_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(GS_DLLEXT)
|
||||
GPDL_SONAME_MAJOR_MINOR=$(GPDL_SONAME_BASE)$(GS_SOEXT)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MAJOR)$(SO_LIB_VERSION_SEPARATOR)$(GS_VERSION_MINOR)$(GS_DLLEXT)
|
||||
|
||||
-#LDFLAGS_SO=-shared -Wl,-soname=$(GS_SONAME_MAJOR)
|
||||
+LDFLAGS_SO=-shared -Wl,-soname=$(GS_SONAME_MAJOR)
|
||||
|
||||
# NOTE: the value of LD_SET_DT_SONAME for, for example, Solaris ld, must contain the
|
||||
# trailing space to separation it from the value of the option. For GNU ld and
|
||||
diff --git a/base/unixlink.mak b/base/unixlink.mak
|
||||
index 86be8a3..2320578 100644
|
||||
--- a/base/unixlink.mak
|
||||
+++ b/base/unixlink.mak
|
||||
@@ -156,7 +156,7 @@ ldt_tr=$(PSOBJ)ldt.tr
|
||||
|
||||
$(GS_XE): $(ld_tr) $(gs_tr) $(ECHOGS_XE) $(XE_ALL) $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) \
|
||||
$(UNIXLINK_MAK)
|
||||
- $(ECHOGS_XE) -w $(ldt_tr) -n - $(CCLD) $(GS_LDFLAGS) -o $(GS_XE)
|
||||
+ $(ECHOGS_XE) -w $(ldt_tr) -n - $(CCLD) $(GS_LDFLAGS) -shared -Wl,-soname=libgs.so.9.25 -o $(GS_XE)
|
||||
$(ECHOGS_XE) -a $(ldt_tr) -n -s $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) $(GS_DOT_O) -s
|
||||
cat $(gsld_tr) >> $(ldt_tr)
|
||||
$(ECHOGS_XE) -a $(ldt_tr) -s - $(EXTRALIBS) $(STDLIBS)
|
||||
--
|
||||
2.19.1
|
||||
|
||||
Reference in New Issue
Block a user