Skip to content

Commit

Permalink
Fix building environment - we should now be able to run on latest jhb…
Browse files Browse the repository at this point in the history
…uild
  • Loading branch information
yousseb committed Oct 22, 2023
1 parent fa7d738 commit 7f8ef8f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 52 deletions.
27 changes: 19 additions & 8 deletions osx/build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ pushd . > /dev/null
#jhbuild bootstrap

export PKG_CONFIG_PATH=$HOME/gtk/inst/lib/pkgconfig:$HOME/gtk/inst/share/pkgconfig
#export PKG_CONFIG_SYSROOT_DIR=$HOME/gtk/inst
export XDG_DATA_DIRS=$HOME/gtk/inst/share
jhbuild buildone libffi

jhbuild buildone libffi zlib
jhbuild buildone python3
#PYTHON=$HOME/gtk/inst/bin/python3 PYTHON_CFLAGS=-I$HOME/gtk/inst/include/python3.11
jhbuild buildone libxml2
#(cd $HOME/gtk/inst/bin && touch itstool && chmod +x itstool)

Expand All @@ -54,19 +57,27 @@ PY_SITE_PACKAGES=$(~/gtk/inst/bin/python3 -c 'import site; print(site.getsitepac
PYTHON=$HOME/gtk/inst/bin/python3 jhbuild build --nodeps --ignore-suggests #-s freetype-no-harfbuzz
/usr/local/bin/pip3 install pyobjc-core pyobjc-framework-Cocoa py2app --target $PY_SITE_PACKAGES

cat /Users/yousseb/gtk/inst/lib/pkgconfig/epoxy.pc | grep -v x11 > /Users/yousseb/gtk/inst/lib/pkgconfig/epoxy.pc.1
mv /Users/yousseb/gtk/inst/lib/pkgconfig/epoxy.pc /Users/yousseb/gtk/inst/lib/pkgconfig/epoxy.pc.orig
mv /Users/yousseb/gtk/inst/lib/pkgconfig/epoxy.pc.1 /Users/yousseb/gtk/inst/lib/pkgconfig/epoxy.pc

jhbuild buildone gtksourceview3 gtk-mac-integration gtk-mac-integration-python

# (cd $HOME/gtk/inst/lib && ln -s libpython3.6m.dylib libpython3.6.dylib)
# (cd $HOME/Source/ && ([ -d Mojave-gtk-theme ] || git clone https://github.com/vinceliuice/Mojave-gtk-theme.git))
# (cd $HOME/Source/Mojave-gtk-theme && sed -i.bak 's/cp -ur/cp -r/' install.sh && ./install.sh --dest $HOME/gtk/inst/share/themes)
# (cd $HOME/gtk/inst/share/themes && ln -sf Mojave-dark-solid-alt Meld-Mojave-dark)
# (cd $HOME/gtk/inst/share/themes && ln -sf Mojave-light-solid-alt Meld-Mojave-light)

pushd .
cd $HOME/Source
curl -OL https://download.gnome.org/sources/gtksourceview/3.24/gtksourceview-3.24.7.tar.xz
tar xvf gtksourceview-3.24.7.tar.xz && cd gtksourceview-3.24.7
jhbuild run ./configure --prefix $HOME/gtk/inst --enable-introspection=yes --enable-gtk-doc-html=no --with-sysroot=$HOME/gtk/inst
jhbuild run make install -j
popd
# pushd .
# cd $HOME/Source
# GTKSRCVIEW=gtksourceview-4.8.4
# curl -OL https://download.gnome.org/sources/gtksourceview/4.8/gtksourceview-4.8.4.tar.xz
# tar xvf ${GTKSRCVIEW}.tar.xz
# mkdir -p ${GTKSRCVIEW}/build && cd ${GTKSRCVIEW}/build
# jhbuild run meson setup --prefix=$HOME/gtk/inst --buildtype=release --optimization 3 -Dvapi=false $HOME/Source/${GTKSRCVIEW} # --Denable-introspection=yes --Denable-gtk-doc-html=no --with-sysroot=$HOME/gtk/inst
# jhbuild run ninja install
# popd

cp settings.ini $HOME/gtk/inst/etc/gtk-3.0/
popd
Expand Down
1 change: 0 additions & 1 deletion osx/fix_gir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ failure() {
}
trap 'failure ${LINENO} "$BASH_COMMAND"' ERR

export MACOSX_DEPLOYMENT_TARGET=10.9
export PATH=$HOME/.new_local/bin:$HOME/gtk/inst/bin:$PATH

# Seems like the build system changed for introspection. We now get many
Expand Down
66 changes: 23 additions & 43 deletions osx/jhbuildrc-custom
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ from os import path
#prefix = "/tmp/meldroot"
checkoutroot = os.path.expanduser("~/Source/gtk")
#setup_sdk(target='native', sdk_version=None, architectures=["x86_64"])
_gtk_osx_use_jhbuild_python = True
_gtk_osx_use_jhbuild_python = False

if path.exists("/usr/local/bin/ccache"):
print("Using ccache")
Expand All @@ -20,24 +20,9 @@ else:
os.environ["CC"] = "/usr/bin/clang"
os.environ["CXX"] = "/usr/bin/clang++"

#os.environ["DYLD_FALLBACK_LIBRARY_PATH"] = "@executable_path/../Frameworks/:@executable_path/../Resources/lib"
#environ_prepend('CFLAGS', "-O3")
environ_prepend('CXXFLAGS', "-std=c++11 -stdlib=libc++")
#environ_prepend('OBJCFLAGS', "-O2")

# Bootstrap phase - we get those from brew
skip.append("m4")
skip.append("m4-common")
skip.append("autoconf")
skip.append("automake")
skip.append("libtool")
skip.append("xz")
skip.append("gettext") # Should we?
skip.append("bison")
skip.append("pkg-config")
skip.append("intltool")

#skip.append("libiconv") # Lion issues

skip.append("libiconv")
skip.append("icu")
skip.append("cups")
skip.append("gnome-themes-standard")
Expand All @@ -48,17 +33,24 @@ skip.append("cmake")
skip.append("openssl") # We'll install it manually
skip.append("python")
skip.append("python3") # We'll install it manually
#skip.append("libxml2") # We'll install it manually
#skip.append("gtk-doc")
skip.append("itstool")
skip.append("libxslt")
skip.append("yelp-xsl")
skip.append("yelp-tools")
#skip.append("gobject-introspection")
skip.append("pygobject")
skip.append("xorg-util-macros")
skip.append('mozilla')
skip.append('pulseaudio')
skip.append('gtk-mac-integration')
skip.append('gtk-mac-integration-python')
#skip.append('adwaita-icon-theme')
skip.append('gtk-4') # gtksourceview4 attempts to grab gtk-4

#sourceview4
# graphene
# sass
# gtk-4


# moduleset="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/modulesets-unstable/gtk-osx.modules"

Expand All @@ -70,23 +62,22 @@ skip.append('pulseaudio')
# yelp-tools

modules = [
"zlib", "libjpeg", "libtiff", "libpng",
"zlib",
"libjpeg",
"libtiff",
"libpng",
"glib",
"fribidi",
"gtk-doc",
"pango", "gdk-pixbuf", "librsvg",
"pango",
"gdk-pixbuf",
"librsvg",
"meta-gtk-osx-gtk3",
"meta-gtk-osx-python3-gtk3",
"gsettings-desktop-schemas",
"adwaita-icon-theme"
]

#"gtksourceview3",

#moduleset="http://git.gnome.org/browse/gtk-osx/plain/modulesets/gtk-osx.modules"

#prefix = os.path.join(os.environ["HOME"], "meld")

global autogenargs
autogenargs = autogenargs + ' --disable-documentation --disable-docs --enable-introspection --enable-gtk-doc=no --enable-gtk-doc-html=no --enable-gtk-doc-pdf=no'
# autogenargs += ' --cache-file=' + checkoutroot + '/autoconf-cache '
Expand All @@ -102,32 +93,21 @@ module_autogenargs['librsvg'] = '--disable-Bsymbolic --enable-pixbuf-loader --en
module_autogenargs['cairo'] = '--disable-full-testing --disable-trace --enable-ft --enable-fc --enable-quartz-image --enable-quartz-font --enable-quartz --enable-png --enable-svg --enable-tee --enable-xml --enable-gobject --enable-pthread --disable-valgrind --disable-gtk-doc --disable-gtk-doc-html --disable-dependency-tracking ' + autogenargs
module_autogenargs['gobject-introspection']= '--with-cairo=yes ' + autogenargs
module_autogenargs['tango-icon-theme']='--disable-nls --disable-icon-framing ' + autogenargs
module_autogenargs['gtk+-3.0'] = '--enable-quartz-backend --enable-quartz-relocation --disable-Bsymbolic --disable-cloudprint --with-included-immodules=am-et,cedilla,cyrillic-translit,inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr --disable-modules --disable-rpath --disable-cups --disable-papi --disable-cloudprint --disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --enable-debug=no ' + autogenargs #--disable-schemas-compile ?
#module_autogenargs['gtk+-3.0'] = '--enable-quartz-backend --enable-quartz-relocation --disable-Bsymbolic --disable-cloudprint --with-included-immodules=am-et,cedilla,cyrillic-translit,inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr --disable-modules --disable-rpath --disable-cups --disable-papi --disable-cloudprint --disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --enable-debug=no ' + autogenargs #--disable-schemas-compile ?
module_autogenargs['harfbuzz'] = '--disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --with-coretext --without-icu ' + autogenargs
module_autogenargs['root-harfbuzz'] = '--disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --with-coretext --without-icu ' + autogenargs
module_autogenargs['fontconfig'] = '--with-cache-dir="~/Library/Caches/org.gnome.meld.fontconfig" --with-default-fonts=/System/Library/Fonts --with-add-fonts=/Library/Fonts,/Network/Library/Fonts,/System/Library/Fonts ' + autogenargs
module_autogenargs['python3'] = '--enable-optimizations --with-system-expat --disable-ipv6 --with-ensurepip=yes --with-system-expat '
#+ autogenargs
module_autogenargs['libxml2'] = '--with-zlib --enable-ipv6=no '

module_mesonargs['atk'] = '--buildtype release --optimization 3 -Ddocs=false -Dintrospection=true'
module_mesonargs['gdk-pixbuf'] = '--buildtype release --optimization 3 -Dbuiltin_loaders=all -Drelocatable=true -Ddocs=false'
module_mesonargs['glib'] = '--buildtype release --optimization 3 -Dbsymbolic_functions=false -Dgtk_doc=false -Db_bitcode=true -Db_ndebug=true'
module_mesonargs['pango'] = '--buildtype release --optimization 3 -Dintrospection=enabled'
module_mesonargs['pygobject3'] = '--buildtype release --optimization 3 -Dtests=false -Dpycairo=enabled'
module_mesonargs['gtk+-3.0'] = '--buildtype release --optimization 3 -Dx11_backend=false -Dwayland_backend=false -Dbroadway_backend=false -Dwin32_backend=false -Dquartz_backend=true -Dxinerama=no -Dcloudproviders=false -Dprofiler=false -Dtracker3=false -Dcolord=no -Dgtk_doc=false -Dman=false -Dintrospection=true -Ddemos=false -Dexamples=false -Dtests=false -Dinstalled_tests=false -Dbuiltin_immodules=yes'
module_mesonargs['gtksourceview4'] = '--buildtype release --optimization 3 -Dvapi=false'

# module_autogenargs['gtk-quartz-engine'] = 'CFLAGS=-Wuninitialized ' + autogenargs
# module_autogenargs['gtksourceview3'] = '' + autogenargs
#module_autogenargs['gtk-mac-integration']='--enable-python=all --without-gtk2 --with-gtk3 --enable-introspection=yes ' + autogenargs



#os.environ['CFLAGS'] += ' -I' + '/usr/include/'
#os.environ['CPPFLAGS'] += ' -I' + '/usr/include/'
#os.environ['LDFLAGS'] += ' -L' + '/usr/lib/'
#os.environ['LDFLAGS'] += ' -Wl,--rpath -Wl,' + '/usr/lib/'
#os.environ['LDFLAGS'] += ' -Wl,--rpath -Wl,' + '../lib/'
#os.environ['LDFLAGS'] += ' -Wl,--rpath -Wl,' + '../lib_pypy/'

# Can be usefull when tweaking modulesets to avoid jhbuild overwriting:
# nonetwork=True
Expand Down

0 comments on commit 7f8ef8f

Please sign in to comment.