[gtk-osx] Optionally build bash as part of gtk-osx-bootstrap, skipped by default.



commit a6c9cdc872f56eb7e1b9b3b409f3f062ccac263e
Author: John Ralls <jralls ceridwen us>
Date:   Sun Dec 6 09:15:28 2015 -0800

    Optionally build bash as part of gtk-osx-bootstrap, skipped by default.
    
    OS X 10.11 implements something Apple calls System Integrity Protection,
    or SIP. One of its somewhat misguided behaviors is to strip DYLD_* and
    LD_* environment variables from forked/execed processes if the parent is
    a system process, and system process is defined as among other things
    one whose executable path is in /bin or /usr/bin. This breaks things
    that e.g. need to search for built-but-not-installed libraries or
    libraries whose installed names aren't a full path.
    
    The workaround is to build or copy the problem executables into some
    other path and make sure that they're what's used. This change will
    build bash in the $PREFIX directory; any dependent shell scripts in the
    build system will need to be edited to use that bash in their shebang
    instead of /bin/sh.

 jhbuildrc-gtk-osx                             |    3 ++-
 jhbuildrc-gtk-osx-custom-example              |   11 +++++++++++
 modulesets-stable/gtk-osx-bootstrap.modules   |    9 +++++++++
 modulesets-unstable/gtk-osx-bootstrap.modules |    9 +++++++++
 modulesets/gtk-osx-bootstrap.modules          |   11 ++++++++++-
 5 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/jhbuildrc-gtk-osx b/jhbuildrc-gtk-osx
index 684b7bb..2151979 100644
--- a/jhbuildrc-gtk-osx
+++ b/jhbuildrc-gtk-osx
@@ -329,6 +329,7 @@ def setup_sdk(target, sdk_version, architectures=[_default_arch]):
         os.environ["OBJC"] = os.path.join(_toolpath, "gcc-4.2")
         os.environ["CXX"] = os.path.join(_toolpath, "g++-4.2")
 
+            
     # Set the -arch flags for everything we're building.
     #
     for arch in architectures:
@@ -488,7 +489,7 @@ modules = [ 'meta-gtk-osx-bootstrap', 'meta-gtk-osx-core' ]
 
 # A list of modules to skip.
 #
-
+skip.append("bash") #Needed only on OSX10.11 when something needs a subshell.
 # Source and installation locations.
 #
 _root = os.path.expanduser("~/gtk")
diff --git a/jhbuildrc-gtk-osx-custom-example b/jhbuildrc-gtk-osx-custom-example
index db53505..cb303e0 100644
--- a/jhbuildrc-gtk-osx-custom-example
+++ b/jhbuildrc-gtk-osx-custom-example
@@ -50,6 +50,17 @@ elif _jhb == "FW":
 # if "libglade" in skip:
 #      skip.remove("libglade")
 
+# Uncomment the following if you're running OSX 10.11 and SIP (see 
https://developer.apple.com/library/prerelease/mac/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html)
+# causes shell-script build failures. You'll also need to edit those
+# shell scripts to change the shebang from /bin/sh to $PREFIX/bin/bash.
+# Note that /usr/bin/env bash won't work, because it will also strip
+# the DYLD_* and LD_* environment variables!
+# Note as well that any installed dependencies must use their full
+# paths for their id (use install_name_tool -id to fix). Boost is a
+# particular violator of this rule.
+# if "bash" in skip:
+#     skip.remove("bash")
+
 # Set this to True/False if you want to force using or not building
 # and using python as part of jhbuild. If not set, the script will use
 # the system python when building on 10.5 or newer only.
diff --git a/modulesets-stable/gtk-osx-bootstrap.modules b/modulesets-stable/gtk-osx-bootstrap.modules
index dfa5454..5abff04 100644
--- a/modulesets-stable/gtk-osx-bootstrap.modules
+++ b/modulesets-stable/gtk-osx-bootstrap.modules
@@ -34,6 +34,14 @@
     </branch>
   </autotools>
 
+  <autotools id='bash' autogen-sh="configure">
+    <branch repo="ftp.gnu.org" module="bash/bash-4.3.30-tar.gz"
+            version="4.3.30"/>
+    <dependencies>
+      <dep package="readline"/>
+    </dependencies>
+  </autotools>
+  
   <autotools id="libpng" autogenargs="--enable-shared" autogen-sh="configure">
     <branch version="1.6.17" module="libpng/libpng-1.6.17.tar.xz"
             repo="sourceforge" md5sum="430a9b76b78533235cd4b9b26ce75c7e"/>
@@ -193,6 +201,7 @@
   <metamodule id="meta-gtk-osx-bootstrap">
     <dependencies>
       <dep package="readline"/>
+      <dep package="bash"/>
       <dep package="cups"/>
       <dep package="libpng"/>
       <dep package="libjpeg"/>
diff --git a/modulesets-unstable/gtk-osx-bootstrap.modules b/modulesets-unstable/gtk-osx-bootstrap.modules
index 5c51a72..9d5aca8 100644
--- a/modulesets-unstable/gtk-osx-bootstrap.modules
+++ b/modulesets-unstable/gtk-osx-bootstrap.modules
@@ -36,6 +36,14 @@
     </branch>
   </autotools>
 
+<autotools id='bash' autogen-sh="configure">
+    <branch repo="ftp.gnu.org" module="bash/bash-4.3.30-tar.gz"
+            version="4.3.30"/>
+    <dependencies>
+      <dep package="readline"/>
+    </dependencies>
+</autotools>
+
   <autotools id="libpng" autogenargs="--enable-shared" autogen-sh="configure">
     <branch version="1.6.17" module="libpng/libpng-1.6.17.tar.xz"
             repo="sourceforge" md5sum="430a9b76b78533235cd4b9b26ce75c7e"/>
@@ -189,6 +197,7 @@
    <metamodule id="meta-gtk-osx-bootstrap">
     <dependencies>
       <dep package="readline"/>
+      <dep package="bash"/>
       <dep package="cups"/>
       <dep package="libpng"/>
       <dep package="libjpeg"/>
diff --git a/modulesets/gtk-osx-bootstrap.modules b/modulesets/gtk-osx-bootstrap.modules
index bf83f76..7a3232c 100644
--- a/modulesets/gtk-osx-bootstrap.modules
+++ b/modulesets/gtk-osx-bootstrap.modules
@@ -34,7 +34,15 @@
     </branch>
   </autotools>
 
-  <autotools id="libpng" autogenargs="--enable-shared" autogen-sh="configure">
+<autotools id='bash' autogen-sh="configure">
+    <branch repo="ftp.gnu.org" module="bash/bash-4.3.30-tar.gz"
+            version="4.3.30"/>
+    <dependencies>
+      <dep package="readline"/>
+    </dependencies>
+</autotools>
+
+<autotools id="libpng" autogenargs="--enable-shared" autogen-sh="configure">
     <branch version="1.6.17" module="libpng/libpng-1.6.17.tar.xz"
             repo="sourceforge" md5sum="430a9b76b78533235cd4b9b26ce75c7e"/>
   </autotools>
@@ -180,6 +188,7 @@
   <metamodule id="meta-gtk-osx-bootstrap">
     <dependencies>
       <dep package="readline"/>
+      <dep package="bash"/>
       <dep package="cups"/>
       <dep package="libpng"/>
       <dep package="libjpeg"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]