From 2db54e1d4a3da8464ca503fc894d8a187346203c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= Date: Sun, 26 Apr 2026 23:07:29 +0200 Subject: [PATCH] app-text/ghostscript-gpl: add USE=openmp & fix linking against libgomp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://bugs.gentoo.org/973234 Signed-off-by: Holger Hoffstätte Part-of: https://codeberg.org/gentoo/gentoo/pulls/753 Merges: https://codeberg.org/gentoo/gentoo/pulls/753 Signed-off-by: Sam James --- .../ghostscript-gpl-10.06.0-openmp.patch | 24 +++++++++++++++++++ .../ghostscript-gpl-10.06.0-r2.ebuild | 14 ++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 app-text/ghostscript-gpl/files/ghostscript-gpl-10.06.0-openmp.patch diff --git a/app-text/ghostscript-gpl/files/ghostscript-gpl-10.06.0-openmp.patch b/app-text/ghostscript-gpl/files/ghostscript-gpl-10.06.0-openmp.patch new file mode 100644 index 0000000000000..74af0ae3fd126 --- /dev/null +++ b/app-text/ghostscript-gpl/files/ghostscript-gpl-10.06.0-openmp.patch @@ -0,0 +1,24 @@ +https://bugs.gentoo.org/973234 +https://bugs.ghostscript.com/show_bug.cgi?id=709373 + +--- ghostscript-10.06.0/base/unixlink.mak ++++ ghostscript-10.06.0/base/unixlink.mak +@@ -45,6 +45,9 @@ GS_DOT_O=$(PSOBJ)gs.$(OBJ) + # and search paths for them + CONFLIBSTR=-pl "&-l%s&s&&" -pL "&-L%s&s&&" -l + ++# detect -fopenmp in CFLAGS ++HAVE_OPENMP := $(shell echo $(CFLAGS) | grep -o '\-fopenmp') ++ + libgs_a_tr=$(GLOBJ)libgs_a.tr + GS_A=$(BINDIR)$(D)$(GS).a + $(GS_A): $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) \ +@@ -165,7 +168,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) $(HAVE_OPENMP) $(GS_LDFLAGS) -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) diff --git a/app-text/ghostscript-gpl/ghostscript-gpl-10.06.0-r2.ebuild b/app-text/ghostscript-gpl/ghostscript-gpl-10.06.0-r2.ebuild index 4b257164b6906..d20ab04b34ce7 100644 --- a/app-text/ghostscript-gpl/ghostscript-gpl-10.06.0-r2.ebuild +++ b/app-text/ghostscript-gpl/ghostscript-gpl-10.06.0-r2.ebuild @@ -25,7 +25,7 @@ S="${WORKDIR}/${MY_P}" LICENSE="AGPL-3 CPL-1.0" SLOT="0/$(ver_cut 1-2)" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris" -IUSE="cups cpu_flags_arm_neon dbus gtk l10n_de static-libs unicode X" +IUSE="cups cpu_flags_arm_neon dbus gtk l10n_de openmp static-libs unicode X" LANGS="ja ko zh-CN zh-TW" for X in ${LANGS} ; do @@ -69,8 +69,17 @@ PATCHES=( "${FILESDIR}"/${PN}-10.06.0-bool-confusion.patch "${FILESDIR}"/${PN}-10.06.0-gcc-14.patch "${FILESDIR}"/${PN}-10.06.0-stdint.patch + "${FILESDIR}"/${PN}-10.06.0-openmp.patch ) +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + +pkg_setup() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + src_prepare() { if [[ -n ${MY_PATCHSET} ]] ; then # apply various patches, many borrowed from Fedora @@ -138,6 +147,9 @@ src_configure() { # bug #899952 append-lfs-flags + # bug #973234 + use openmp && append-flags -fopenmp || filter-flags -fopenmp* + local FONTPATH for path in \ "${EPREFIX}"/usr/share/fonts/urw-fonts \