forked from samm-git/siril-macos-build
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjhbuildrc-gtk-osx-gimp-2.99
215 lines (180 loc) · 8.49 KB
/
jhbuildrc-gtk-osx-gimp-2.99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# -*- 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://[email protected]/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-gtk3", "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.12","x86_64")
# enable optimization
environ_prepend('CFLAGS', "-O3")
environ_prepend('CXXFLAGS', "-O3")
environ_prepend('OBJCFLAGS', "-O3")
# setup_debug()
# 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+-2.0"] = (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"
use_local_modulesets = True
modulesets_dir = os.path.expanduser('~/project/modulesets')
# use our moduleset
moduleset = 'gtk-osx.modules'
# force python 3.9 for the libxml2 to avoid build issues
module_extra_env['libxml2'] = { "ac_cv_path_PYTHON": "python3.9" }
# force python 3.8 for gimp-help because libxml2 is built with Python
# 3.8 support.
#module_extra_env['gimp-help-git'] = { "PYTHON": "python3.8" }
# meson needs UTF-8 charset for build python scripts to work correctly
module_extra_env['meson'] = { "LC_ALL": "en_US.UTF-8" }
# DJM - gtk-doc needs PYTHON to be python3, and then creates gtkdoc-rebase with a shebang of $PYTHON, so we need to be
# absolute here, otherwise anything calling gtkdoc-rebase (i.e. the later gtk+ install) will err with "bad interpreter"
module_extra_env['gtk-doc'] = { 'PYTHON': '/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9' }
# DJM - c files built from defs are not including all necessary headers - ignore that
module_extra_env['pygtk'] = { 'CFLAGS' : '-Wno-error=implicit-function-declaration' }
# Handle Big Sur PThreads limitations https://developer.apple.com/forums/thread/666700
module_extra_env["cairo"] = { 'LDFLAGS': os.environ['LDFLAGS'] +
" -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" }
class _cmd_bootstrap_gtk_osx_gimp(jhbuild.commands.base.cmd_build):
doc = '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 = '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)