-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild
executable file
·60 lines (50 loc) · 2.14 KB
/
build
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
#!/usr/bin/env bash
#
# This script will (in theory) rebuild the gtk deps.
# Exit immediately if any individual command fails.
set -euo pipefail
# Clone gtk-osx, run bootstrapper, install gtk and friends.
git clone https://gitlab.gnome.org/GNOME/gtk-osx.git
cd gtk-osx
./gtk-osx-setup.sh
export PATH="$PATH:~/.new_local/bin"
jhbuild bootstrap-gtk-osx
jhbuild build python3 # This may not be necessary on newer OSX versions - I needed it on mojave (10.14)
jhbuild run pip3 install pygments
# Note: what gtk-osx refers to as gtksourceview3 is, in fact, gtksourceview4.
jhbuild build meta-gtk-osx-bootstrap meta-gtk-osx-gtk3 gtksourceview3
# At this point, gtk and its deps are installed (probably to ~/gtk/inst).
# Now we install gtk-mac-bundler.
cd ..
git clone https://gitlab.gnome.org/GNOME/gtk-mac-bundler.git
cd gtk-mac-bundler
make install
# Now we build the bundle.
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
bundle="$dir/gtk.bundle"
jhbuild run ~/.local/bin/gtk-mac-bundler "$bundle"
bundle_out="$dir/gtk.app/Contents/Resources"
# We need to correct a few issues with the bundle. When re-running this script
# in the future, it's possible/likely that there will be other such problems.
# As such, I would highly recommend a manual test of the newly-built gtk env:
# - by running the gtk-demo application which should be located at
# $bundle_out/../MacOS/gtk-demo
# - and also by running apsim against the new environment. This is left as an
# exercise to the reader.
# GtkSharp currently looks for libgdk_pixbuf-2.0.dylib. Let's give it what it wants.
pushd "$bundle_out/lib"
ln -s libgdk_pixbuf-2.0.0.dylib libgdk_pixbuf-2.0.dylib
popd
# Hack to fix paths in modules and pixbuf loader caches.
fixpath() {
# (Mac sed is not GNU sed...)
sed -i -e 's/Resources/..\/Resources/' $@
}
fixpath "$bundle_out/lib/gtk-3.0/3.0.0/immodules.cache"
fixpath "$bundle_out/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
# Hack to copy in gschema settings files
schemas="$bundle_out/share/glib-2.0/schemas"
mkdir -p "$schemas"
cp /usr/local/share/glib-2.0/schemas/* "$schemas/"
# Finally, zip up the result.
tar czf deps-new.tar.gz -C "$bundle_out" lib share