summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authordsainty <dsainty@pkgsrc.org>2020-04-21 07:48:55 +0000
committerdsainty <dsainty@pkgsrc.org>2020-04-21 07:48:55 +0000
commit9c73782c06f777b8988aca4005b73cabd32da510 (patch)
tree3f7072dfb79782dfa542f04fefba83a987f21e6c /devel
parent19cf23c99ed4a4108f43a21d223e0a8d000c51de (diff)
downloadpkgsrc-9c73782c06f777b8988aca4005b73cabd32da510.tar.gz
Support a shell other than /bin/sh as a workaround for MacOS X.
Under MacOS X the LD_LIBRARY_PATH variable is unset by the build system running executables under /bin (namely /bin/sh). This is part of MacOS X System Integrity Protection. Because many (most?) users of ninja/meson seem to need hacks involving LD_LIBRARY_PATH, use a non-SIP-triggering shell under MacOS X. Fixes MacOS X builds of glib2, gobject-introspection and others. Bump PKGREVISION for the new behaviour under MacOS X.
Diffstat (limited to 'devel')
-rw-r--r--devel/ninja-build/Makefile20
-rw-r--r--devel/ninja-build/distinfo3
-rw-r--r--devel/ninja-build/patches/patch-src_subprocess-posix.cc26
3 files changed, 47 insertions, 2 deletions
diff --git a/devel/ninja-build/Makefile b/devel/ninja-build/Makefile
index 10282c37eaf..b53ed97f22c 100644
--- a/devel/ninja-build/Makefile
+++ b/devel/ninja-build/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.12 2020/03/18 00:05:18 rillig Exp $
+# $NetBSD: Makefile,v 1.13 2020/04/21 07:48:55 dsainty Exp $
DISTNAME= ninja-1.10.0
PKGNAME= ${DISTNAME:S/ninja/ninja-build/}
+PKGREVISION= 1
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GITHUB:=ninja-build/}
GITHUB_TAG= v${PKGVERSION_NOREV}
@@ -14,6 +15,23 @@ LICENSE= apache-2.0
BUILD_DEPENDS+= re2c>=0.11.3:../../devel/re2c
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "Darwin"
+#
+# Under MacOS X the LD_LIBRARY_PATH variable is unset by the build system
+# running executables under /bin (namely /bin/sh). This is part of MacOS X
+# System Integrity Protection.
+#
+# Because many (most?) users of ninja/meson seem to need hacks involving
+# LD_LIBRARY_PATH, use a non-SIP-triggering shell under MacOS X.
+#
+DEPENDS+= pdksh-[0-9]*:../../shells/pdksh
+CFLAGS+= -DNINJA_SHELL=${PREFIX}/bin/pdksh
+.else
+CFLAGS+= -DNINJA_SHELL=/bin/sh
+.endif
+
USE_LANGUAGES= c c++
INSTALLATION_DIRS= bin share/doc/ninja share/ninja
diff --git a/devel/ninja-build/distinfo b/devel/ninja-build/distinfo
index 54d5a71ed51..2c8e15d3f32 100644
--- a/devel/ninja-build/distinfo
+++ b/devel/ninja-build/distinfo
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.12 2020/02/10 13:13:04 ryoon Exp $
+$NetBSD: distinfo,v 1.13 2020/04/21 07:48:55 dsainty Exp $
SHA1 (ninja-1.10.0.tar.gz) = 7134bca607e17238d272e281ce1cae05d04be970
RMD160 (ninja-1.10.0.tar.gz) = cebdbc2b0d7b1d393ef6c3e449e902463b135eed
SHA512 (ninja-1.10.0.tar.gz) = 5ed47ef1ff18a03eb73296629679a8617a08ee443e10e28ae9cb24e4506f84fe1eb142888adea9a62364b626b35817def8c55ba956c9b3cbc7b82d3e62293044
Size (ninja-1.10.0.tar.gz) = 210313 bytes
+SHA1 (patch-src_subprocess-posix.cc) = aff45ff1080c8556bc9a749666c532896bd73609
diff --git a/devel/ninja-build/patches/patch-src_subprocess-posix.cc b/devel/ninja-build/patches/patch-src_subprocess-posix.cc
new file mode 100644
index 00000000000..f6abf681048
--- /dev/null
+++ b/devel/ninja-build/patches/patch-src_subprocess-posix.cc
@@ -0,0 +1,26 @@
+$NetBSD: patch-src_subprocess-posix.cc,v 1.3 2020/04/21 07:48:55 dsainty Exp $
+
+Support a shell other than /bin/sh as a workaround for MacOS X.
+
+Under MacOS X the LD_LIBRARY_PATH variable is unset by the build system
+running executables under /bin (namely /bin/sh). This is part of MacOS X
+System Integrity Protection.
+
+Because many (most?) users of ninja/meson seem to need hacks involving
+LD_LIBRARY_PATH, use a non-SIP-triggering shell under MacOS X.
+
+--- src/subprocess-posix.cc.orig 2019-11-24 01:57:30.000000000 +1300
++++ src/subprocess-posix.cc 2019-11-24 01:58:15.000000000 +1300
+@@ -110,8 +110,10 @@
+ if (err != 0)
+ Fatal("posix_spawnattr_setflags: %s", strerror(err));
+
+- const char* spawned_args[] = { "/bin/sh", "-c", command.c_str(), NULL };
+- err = posix_spawn(&pid_, "/bin/sh", &action, &attr,
++#define xstr(s) str(s)
++#define str(s) #s
++ const char* spawned_args[] = { xstr(NINJA_SHELL), "-c", command.c_str(), NULL };
++ err = posix_spawn(&pid_, xstr(NINJA_SHELL), &action, &attr,
+ const_cast<char**>(spawned_args), environ);
+ if (err != 0)
+ Fatal("posix_spawn: %s", strerror(err));