[gimp-macos-build] Add own custom configuration



commit 9f1fec35a043edb83f185f9c80074dbed4cf007e
Author: Oleksii Samorukov <oleksii_samorukov mckinsey com>
Date:   Wed Aug 28 16:58:37 2019 +0200

    Add own custom configuration

 .circleci/config.yml   |  27 ++++---
 jhbuildrc-gtk-osx-gimp | 190 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 207 insertions(+), 10 deletions(-)
---
diff --git a/.circleci/config.yml b/.circleci/config.yml
index a1542a2..49870c5 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -3,7 +3,7 @@ jobs:
   build-gimp-2-10:
     macos:
         xcode: "10.0.0"
-      
+
     steps:
         - checkout
         - run:
@@ -12,40 +12,48 @@ jobs:
         - run:
             name: Setup rust
             command: curl https://sh.rustup.rs -sSf | sh -s -- -y
+        - restore_cache:
+            keys:
+              - jhbuild-v1
         - run:
             name: Setup jhbuild
-            command: | 
+            command: |
               cd $HOME
+              mkdir -p ~/.config && mv ~/project/jhbuildrc-gtk-osx-gimp ~/.config/jhbuildrc-custom
               curl  https://gitlab.gnome.org/samm-git/gtk-osx/raw/fork-test/gtk-osx-setup.sh > 
gtk-osx-setup.sh
               chmod +x gtk-osx-setup.sh
               PIPENV_YES=1 ./gtk-osx-setup.sh
-              $HOME/.new_local/bin/jhbuild bootstrap-gtk-osx
+              $HOME/.new_local/bin/jhbuild bootstrap-gtk-osx-gimp
               echo 'export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH:$HOME/.new_local/bin"' > ~/.profile
               echo 'export ARCHFLAGS="-arch x86_64"' >> ~/.profile
               cat ~/.profile
+        - save_cache:
+            paths:
+              - ~/.new_local
+            key: jhbuild-v1
         - run:
             name: Setup gtk-mac-bundler
-            command: | 
+            command: |
               cd ~/Source
               git clone https://github.com/samm-git/gtk-mac-bundler -b fix-otool
               cd gtk-mac-bundler
               make install
         # we need to make it automatically depended on the corresponding modules
         - restore_cache:
-            keys: 
+            keys:
               - gimp-2.10.12-v1
               - webkit-v11
               - gimp-deps-v11
               - bootstrap-v13
         - run:
             name: Setup 10.9 SDK
-            command: | 
+            command: |
               cd /Library/Developer/CommandLineTools/SDKs
-              sudo curl -L 
'https://github.com/phracker/MacOSX-SDKs/releases/download/MacOSX10.11.sdk/MacOSX10.9.sdk.tar.xz' | sudo tar 
-xzf - 
+              sudo curl -L 
'https://github.com/phracker/MacOSX-SDKs/releases/download/MacOSX10.11.sdk/MacOSX10.9.sdk.tar.xz' | sudo tar 
-xzf -
               echo 'export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk' >> ~/.profile
         - run:
             name: Bootstrap
-            command: source ~/.profile && jhbuild bootstrap && jhbuild build python python-six 
meta-gtk-osx-freetype meta-gtk-osx-bootstrap meta-gtk-osx-core
+            command: source ~/.profile && jhbuild build python meta-gtk-osx-freetype meta-gtk-osx-bootstrap 
meta-gtk-osx-core
         - run:
             name: Cleanup
             command: find  ~/gtk/source -type d -mindepth 1 -maxdepth 1 | xargs -I% rm -rf %/*
@@ -83,7 +91,7 @@ jobs:
         - run:
             name: Build GIMP
             # XXX make check is not working reliably under circle ci, so not running it
-            command: | 
+            command: |
               source ~/.profile
               jhbuild build gimp
         - run:
@@ -125,4 +133,3 @@ workflows:
   build-different-versions:
     jobs:
       - build-gimp-2-10
- 
diff --git a/jhbuildrc-gtk-osx-gimp b/jhbuildrc-gtk-osx-gimp
new file mode 100644
index 0000000..efe2b58
--- /dev/null
+++ b/jhbuildrc-gtk-osx-gimp
@@ -0,0 +1,190 @@
+# -*- mode: python -*-
+
+# All of jhbuild is Python, so there are all sorts of interesting
+# things you can do to customize your build with python commands.
+
+# The URL for repositories can be overridden. This is how you'd set
+# your developer access to an SVN repo. It doesn't work, of course,
+# because gnome has migrated to git.
+#
+# repos["svn.gnome.org"] = "svn+ssh://myusername svn gnome org/svn/"
+
+# You can set the default setup here.
+#
+# _gtk_osx_default_build = "fw-10.4"
+#
+# or set things up with an environment variable:
+
+_jhb = os.environ.get("JHB")
+if _jhb is None:
+    # The default setup...
+    # checkoutroot = os.path.expanduser("~/Source/gtk")
+    # prefix = "/opt/gtk"
+    pass
+# Do note, though, that jhbuildrc-gtk-osx also uses $JHB to find
+# another customization file that is loaded after this one. You can,
+# of course, define your own environment variables for passing in
+# parameters.
+
+# The moduleset can be overridden.
+#
+# moduleset = "gtk-osx"
+
+# As can the default modules to build.
+#
+# modules = [ "meta-gtk-osx-core", "meta-gstreamer" ]
+
+# You can skip modules.
+#
+# skip.append("libglade")
+#
+#or put them back:
+#
+# if "libglade" in skip:
+#      skip.remove("libglade")
+
+# Uncomment the following if you're running OSX 10.11 or later 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")
+
+# In addition, you can override _exec_prefix (used to set $M4 and
+# $LIBTOOLIZE); by default it's set to prefix. You might want to reset
+# it if you want to bootstrap to one directory and build in another
+# (or more likely, several others). Mind that this is fiddly and
+# requires tweaking a bunch of things to get autoconf to consistently
+# find the right m4 files. Not really recommended. Similarly, you can
+# override tarballdir so that you need download tarballs only once for
+# multiple builds. This works just as you'd expect and can save quite
+# a bit of time if you're maintaining several trees.
+
+# _exec_prefix = os.path.join(os.path.expanduser("~"), "Source", "bootstrap")
+# tarballdir = os.path.join(os.path.expanduser("~"), "Source", "Download")
+
+# .jhbuildrc has a master function, setup_sdk(target, architecture)
+# which sets up the build environment. You *must* call it in jhbuildrc-custom.
+
+# Target is the earliest version of MacOS on which the result binary
+# can run, in the form "10.X" or "native" (the default). It sets
+# MACOS_DEPLOYMENT_TARGET and the -macosx-version-min CFLAG.
+
+# From Xcode 7/MacOSX10.11.sdk on Apple has provided a new format
+# dylib stub that links with dylibs from earlier versions of MacOS and
+# has been tested to work back to 10.6 if MACOS_X_VERSION_MIN is set
+# appropriately. Earlier SDKs lack this feature and may or may not
+# actually work on MacOS X versions earlier than the SDK's; whether
+# they do depends on whether the SDK contains a newer "compatibility
+# version" library than the system on which you're attempting to run
+# and which is required by your application.
+
+# Architecture is a list for backwards compatibility; it can contain
+# "i386" and/or "x86_64" and defaults to the machine's architecture if
+# left out. Passing both architectures will in theory build a
+# universal binary but this is untested. Since MacOS X 10.7 and later
+# run only on x86_64 systems it doesn't make sense to change this
+# unless you're targeting 10.6. 32-bit ("i386") programs run fine on
+# 64-bit systems.
+
+# There are also some utility functions which you may find useful:
+#
+# environ_append(key, value, separator=' '), environ_prepend(key,
+# value, separator=' '), and environ_remove(key, value, separator=':')
+# append, prepend, or remove value to/from the environment variable key
+# with separator between the value and the existing text of the
+# variable. This is primarily intended for manipulating search paths.
+#
+# append_autogenargs(module, args) and remove_autogenargs(module,
+# args) add or remove args from the list of arguments passed to the
+# module's autogen-sh attribute during the configure phase of the
+# module's build.
+#
+# setup_debug() and setup_release() add either "-O0 -ggdb3" or
+# "-O2" respectively to CFLAGS, CXXFLAGS, and OBJCFLAGS.
+
+#  Set up a particular target and SDK: For default operation, set the
+# architecture and SDK for the native machine:
+setup_sdk("10.9","x86_64")
+
+# enable optimization
+
+environ_prepend('CFLAGS', "-O3")
+environ_prepend('CXXFLAGS', "-O3")
+environ_prepend('OBJCFLAGS', "-O3")
+
+# Comment out the previous and uncomment this one to build for all
+# systems running SnowLeopard and later:
+# setup_sdk(target="10.6")
+
+# Modify the arguments passed to configure:
+#
+# module_autogenargs["libglade"] = "--enable-static"
+#
+# or simply  add to them:
+#
+# append_autogenargs("libglade", "--enable-static")
+#
+# Note that in either case the args will be added *after* the args in
+# the module's autogenargs attribute.
+#
+# Tell Git to use a different module and branch (not tag!):
+#
+# branches["gtk-engines"] = ("gtk-css-engine", "bzr")
+#
+# Or just switch branches
+#
+# branches["gtk+"] = (None, "gtk-2-18")
+#
+# Tarballs take a whole URL for branches:
+#
+# branches["python"] = "http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2";
+#
+# Note that if the module has hash, md5sum, or size attributes and the
+# branch download doesn't match, jhbuild will error out. Open a shell,
+# untar the tarball yourself, quit the shell, and select "ignore
+# error". Don't try this with modules that need patches unless you're
+# sure that the updated version doesn't need them.
+#
+# Set an environment variable:
+#
+# os.environ["CC"] = "/usr/bin/gcc-4.0"
+
+
+# And more...
+
+class _cmd_bootstrap_gtk_osx_gimp(jhbuild.commands.base.cmd_build):
+    doc = N_('Build buildsystem tools not provided by MacOS.')
+
+    name = 'bootstrap-gtk-osx-gimp'
+
+    def run(self, config, options, args, help=None):
+        global use_local_modulesets
+        moduleset="bootstrap"
+        modulesets_dir = os.path.dirname(config.moduleset)
+        if (use_local_modulesets and
+            os.path.exists(os.path.join(modulesets_dir,
+                                        moduleset + '.modules'))):
+            config.modulesets_dir = modulesets_dir
+            config.moduleset = moduleset
+        elif (use_local_modulesets and config.modulesets_dir and
+              os.path.exists(os.path.join(config.modulesets_dir,
+                                          moduleset + '.modules'))):
+            config.moduleset = moduleset
+        else:
+            config.moduleset = 
'https://gitlab.gnome.org/samm-git/gtk-osx/raw/fork-test/modulesets-stable/bootstrap.modules'
+
+        args = ['meta-bootstrap']
+
+        for item in options.skip:
+            config.skip += item.split(',')
+        options.skip = []
+
+        rc = jhbuild.commands.base.cmd_build.run(self, config, options, args)
+        return rc
+
+jhbuild.commands.register_command(_cmd_bootstrap_gtk_osx_gimp)


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