From 7f8ef8f01ab1f25f747685703ef8a9846cbaa447 Mon Sep 17 00:00:00 2001 From: Youssef Adnan Date: Sat, 21 Oct 2023 18:09:14 -0700 Subject: [PATCH] Fix building environment - we should now be able to run on latest jhbuild --- osx/build_env.sh | 27 ++++++++++++------ osx/fix_gir.sh | 1 - osx/jhbuildrc-custom | 66 +++++++++++++++----------------------------- 3 files changed, 42 insertions(+), 52 deletions(-) diff --git a/osx/build_env.sh b/osx/build_env.sh index bbfee5847..5a7b003dc 100755 --- a/osx/build_env.sh +++ b/osx/build_env.sh @@ -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) @@ -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 diff --git a/osx/fix_gir.sh b/osx/fix_gir.sh index 7eaa1210f..163e8cb3d 100755 --- a/osx/fix_gir.sh +++ b/osx/fix_gir.sh @@ -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 diff --git a/osx/jhbuildrc-custom b/osx/jhbuildrc-custom index 56e1fd386..4a47e2cc9 100644 --- a/osx/jhbuildrc-custom +++ b/osx/jhbuildrc-custom @@ -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") @@ -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") @@ -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" @@ -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 ' @@ -102,12 +93,12 @@ 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' @@ -115,19 +106,8 @@ module_mesonargs['glib'] = '--buildtype release --optimization 3 -Dbsymbol 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