pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/gegl Fix build breakage on Darwin.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/80e7cf12cfc1
branches:  trunk
changeset: 423738:80e7cf12cfc1
user:      brook <brook%pkgsrc.org@localhost>
date:      Tue Feb 25 04:29:36 2020 +0000

description:
Fix build breakage on Darwin.

Darwin uses a different extension (.dylib) than other Unixes (.so) for
shared libraries that applications must link against.  However, Gnome
applications expect plugins to use the same extension (.so) on all platforms,
including Darwin.  Consequently, on Darwin some shared libraries must be
renamed, both on the filesystem and internally, and others must use the
correct extension in PLIST.  This is partially mentioned in PR #54824, but
that missed the need for internal renaming of the libraries.  It also
introduced a dependency on the Apple OpenCL framework, which does not seem
to be necessary.

Finally, all the references to Apple-specific OpenCL code must be removed;
previously only some of them were.

diffstat:

 graphics/gegl/Makefile |  28 +++++++++++++++++++++++++++-
 graphics/gegl/PLIST    |  12 ++++++------
 graphics/gegl/hacks.mk |   9 +++++----
 3 files changed, 38 insertions(+), 11 deletions(-)

diffs (102 lines):

diff -r 010598f9b7da -r 80e7cf12cfc1 graphics/gegl/Makefile
--- a/graphics/gegl/Makefile    Tue Feb 25 04:13:46 2020 +0000
+++ b/graphics/gegl/Makefile    Tue Feb 25 04:29:36 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.77 2019/11/02 14:05:46 nia Exp $
+# $NetBSD: Makefile,v 1.78 2020/02/25 04:29:36 brook Exp $
 
 DISTNAME=      gegl-0.4.18
 CATEGORIES=    graphics
@@ -22,6 +22,17 @@
 
 PYTHON_FOR_BUILD_ONLY= tool
 
+.include "../../mk/bsd.prefs.mk"
+
+PLIST_VARS+=           Darwin not_Darwin
+.if ${OPSYS} == "Darwin"
+PLIST.Darwin=          yes
+PLIST_SUBST+=          SOEXT="dylib"
+.else
+PLIST.not_Darwin=      yes
+PLIST_SUBST+=          SOEXT="so"
+.endif
+
 # ../gegl/opencl/gegl-cl-color.c:32:10: fatal error: opencl/colors.cl.h: No such file or directory
 # race condition in meson?
 pre-build:
@@ -29,6 +40,21 @@
                ${PYTHONBIN} cltostring.py "$$file" "$$file".h \
        ; done
 
+.if ${OPSYS} == "Darwin"
+#
+# Meson uses .dylib for Darwin shared libraries, but G_MODULE_SUFFIX
+# is always .so on Unix, including Darwin.  This is under discussion
+# at https://gitlab.gnome.org/GNOME/glib/issues/1413 but for now
+# rename the plugins and reset their internal ID to match the new
+# name.
+#
+post-install:
+       cd ${DESTDIR}/${PREFIX}/lib/gegl-0.4 && for i in *.dylib; do \
+               install_name_tool -id ${PREFIX}/lib/gegl-0.4/$${i%.dylib}.so $${i}; \
+               mv "$${i}" "$${i%.dylib}.so" \
+       ; done
+.endif
+
 .include "options.mk"
 .include "../../devel/meson/build.mk"
 .include "../../devel/pango/buildlink3.mk"
diff -r 010598f9b7da -r 80e7cf12cfc1 graphics/gegl/PLIST
--- a/graphics/gegl/PLIST       Tue Feb 25 04:13:46 2020 +0000
+++ b/graphics/gegl/PLIST       Tue Feb 25 04:29:36 2020 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.24 2019/11/02 14:05:46 nia Exp $
+@comment $NetBSD: PLIST,v 1.25 2020/02/25 04:29:36 brook Exp $
 bin/gegl
 bin/gegl-imgcmp
 include/gegl-0.4/gegl-apply.h
@@ -116,11 +116,11 @@
 lib/gegl-0.4/vector-stroke.so
 lib/gegl-0.4/webp-load.so
 lib/gegl-0.4/webp-save.so
-lib/libgegl-0.4.so
-lib/libgegl-0.4.so.0
-lib/libgegl-0.4.so.0.417.1
-lib/libgegl-npd-0.4.so
-lib/libgegl-sc-0.4.so
+lib/libgegl-0.4.${SOEXT}
+${PLIST.Darwin}lib/libgegl-0.4.0.${SOEXT}
+${PLIST.not_Darwin}lib/libgegl-0.4.${SOEXT}.0.417.1
+lib/libgegl-npd-0.4.${SOEXT}
+lib/libgegl-sc-0.4.${SOEXT}
 lib/pkgconfig/gegl-0.4.pc
 lib/pkgconfig/gegl-sc-0.4.pc
 share/locale/bs/LC_MESSAGES/gegl-0.4.mo
diff -r 010598f9b7da -r 80e7cf12cfc1 graphics/gegl/hacks.mk
--- a/graphics/gegl/hacks.mk    Tue Feb 25 04:13:46 2020 +0000
+++ b/graphics/gegl/hacks.mk    Tue Feb 25 04:29:36 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: hacks.mk,v 1.1 2015/02/11 18:05:23 pho Exp $
+# $NetBSD: hacks.mk,v 1.2 2020/02/25 04:29:36 brook Exp $
 
 .if !defined(GEGL_HACKS_MK)
 GEGL_HACKS_MK= # defined
@@ -17,13 +17,14 @@
 SUBST_CLASSES+=                        non-darwin
 SUBST_STAGE.non-darwin=                pre-build
 SUBST_MESSAGE.non-darwin=      Pretending as if we were not on Darwin.
-SUBST_FILES.non-darwin=                gegl/opencl/*.h
-SUBST_SED.non-darwin=          -e 's,\#ifdef __APPLE__,\#if 0,g'
+SUBST_FILES.non-darwin=                gegl/opencl/*.h gegl/opencl/*.c
+SUBST_SED.non-darwin+=         -e 's,\#ifdef __APPLE__,\#if 0,g'
+SUBST_SED.non-darwin+=         -e 's,\#if defined(__APPLE__),\#if 0,g'
 
 SUBST_CLASSES+=                        no-altivec
 SUBST_STAGE.no-altivec=                pre-build
 SUBST_MESSAGE.no-altivec=      Pretending as if we did not have altivec.
-SUBST_FILES.no-altivec=                gegl/opencl/*.h
+SUBST_FILES.no-altivec=                gegl/opencl/*.h gegl/opencl/*.c
 SUBST_SED.no-altivec=          -e 's,\#if defined( __VEC__ ),\#if 0,g'
 .endif
 



Home | Main Index | Thread Index | Old Index