app-text/ghostscript-gpl: add USE=openmp & fix linking against libgomp

Closes: https://bugs.gentoo.org/973234
Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/753
Merges: https://codeberg.org/gentoo/gentoo/pulls/753
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Holger Hoffstätte
2026-04-26 23:07:29 +02:00
committed by Sam James
parent 4b41313a54
commit 2db54e1d4a
2 changed files with 37 additions and 1 deletions

View File

@@ -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)

View File

@@ -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 \