Skip to content

Commit

Permalink
Update build environment
Browse files Browse the repository at this point in the history
  • Loading branch information
yousseb committed Nov 4, 2023
1 parent e6aa49d commit a112f26
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 33 deletions.
71 changes: 68 additions & 3 deletions osx/build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,84 @@ export PKG_CONFIG_PATH=$HOME/gtk/inst/lib/pkgconfig:$HOME/gtk/inst/share/pkgconf
export PKG_CONFIG_LIBDIR==$HOME/gtk/inst/lib/pkgconfig
export XDG_DATA_DIRS=$HOME/gtk/inst/share

[ -d $HOME/gtk/inst/lib/gettext ] || \
(
cd $HOME/Source
rm -fr libiconv-1.17 libiconv-1.17.tar.gz || true
curl -OL https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz
tar xf libiconv-1.17.tar.gz
cd libiconv-1.17
jhbuild run ./configure --disable-debug \
--disable-dependency-tracking \
--enable-extra-encodings \
--enable-static \
--disable-shared \
--prefix=$HOME/gtk/inst
jhbuild run make -j8
jhbuild run make install

cd $HOME/Source/
rm -fr gettext-0.22.3 gettext-0.22.3.tar.xz || true
curl -OL https://ftp.gnu.org/gnu/gettext/gettext-0.22.3.tar.xz
tar xf gettext-0.22.3.tar.xz
cd gettext-0.22.3
jhbuild run ./configure --without-emacs \
--disable-silent-rules \
--disable-java \
--disable-native-java \
--disable-libasprintf \
--disable-csharp \
--with-included-glib \
--with-included-libcroco \
--with-included-gettext \
--with-included-libunistring \
--without-git \
--without-cvs \
--without-xz \
--prefix=$HOME/gtk/inst
jhbuild run make -j8
jhbuild run make install

cd $HOME/Source/libiconv-1.17
)

# jhbuild bootstrap
jhbuild buildone libffi zlib

#jhbuild bootstrap || true
# For later - perhaps make python use this library instead.
# (cd $HOME/Source/ && rm -fr tinygettext || true)
# (cd $HOME/Source/ && git clone https://github.com/tinygettext/tinygettext)
# (cd $HOME/Source/tinygettext/external && rm -fr tinycmmc)
# (cd $HOME/Source/tinygettext/external && git clone https://github.com/Grumbel/tinycmmc)
# (cd $HOME/Source/tinygettext && mkdir -p build && cd build && cmake .. && make -j8 && cmake --install . --prefix $HOME/gtk/inst)

# For now: stub gettext
# (
# cd $HOME/Source/
# rm -fr gettext-tiny || true
# git clone https://github.com/sabotage-linux/gettext-tiny
# cd $HOME/Source/gettext-tiny
# #gsed -i 's=/usr/local=/=g' Makefile;
# make LIBINTL=NOOP DESTDIR=$HOME/gtk/inst prefix=/ install
# #DESTDIR=$HOME/gtk/inst make install
# )

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)

PY_SITE_PACKAGES=$(~/gtk/inst/bin/python3 -c 'import site; print(site.getsitepackages()[0], end="")')
/usr/local/bin/pip3 install six pygments --target $PY_SITE_PACKAGES

PYTHON=$HOME/gtk/inst/bin/python3 jhbuild build --nodeps --ignore-suggests #-s freetype-no-harfbuzz
# Build all the way up to freetype, then fix its pkg-config
PYTHON=$HOME/gtk/inst/bin/python3 jhbuild build freetype
gsed -i '/^Requires.private.*/d' $HOME/gtk/inst/lib/pkgconfig/freetype2.pc

# Continue
PYTHON=$HOME/gtk/inst/bin/python3 jhbuild build #-s freetype-no-harfbuzz
/usr/local/bin/pip3 install pyobjc-core pyobjc-framework-Cocoa py2app --target $PY_SITE_PACKAGES

cat $HOME/gtk/inst/lib/pkgconfig/epoxy.pc | grep -v x11 > $HOME/gtk/inst/lib/pkgconfig/epoxy.pc.1
Expand Down
43 changes: 13 additions & 30 deletions osx/jhbuildrc-custom
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ from os import path

#prefix = "/tmp/meldroot"
checkoutroot = os.path.expanduser("~/Source/gtk")
#setup_sdk(target='native', sdk_version=None, architectures=["x86_64"])
#setup_sdk()
setup_sdk()
setup_release()
os.environ['CONFIG_SHELL'] = '/bin/bash'
_gtk_osx_use_jhbuild_python = False
_gtk_osx_use_jhbuild_python = True

if path.exists("/usr/local/bin/ccache"):
print("Using ccache")
Expand All @@ -28,24 +27,8 @@ else:

environ_prepend('CXXFLAGS', '-std=c++11 -stdlib=libc++')

# From bootstrap (we only want gettext, xz)
skip.append('m4')
skip.append('m4-common')
skip.append('libxml2')
skip.append("cmake")
skip.append("autoconf-archive")
skip.append("libtool")
skip.append("autoconf")
skip.append("automake")
skip.append("pkg-config")
skip.append("bison")
skip.append("flex")
skip.append("gtk-osx-docbook")
skip.append("gnumake")
skip.append("intltool")

# From modulesets
skip.append("libiconv")
skip.append("icu")
skip.append("cups")
skip.append("gnome-themes-standard")
Expand All @@ -56,15 +39,16 @@ skip.append("openssl")
skip.append("python")
skip.append("python3") # We'll install it manually
skip.append("itstool")
skip.append("libtiff")
skip.append("libxslt")
skip.append("yelp-xsl")
skip.append("yelp-tools")
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('gtk-mac-integration')
#skip.append('gtk-mac-integration-python')
skip.append('adwaita-icon-theme')
skip.append('gtk-4') # only for gtksourceview4

Expand All @@ -86,7 +70,7 @@ skip.append('gtk-4') # only for gtksourceview4
modules = [
"zlib",
"libjpeg",
"libtiff",
#"libtiff",
"libpng",
"glib",
"fribidi",
Expand All @@ -106,8 +90,8 @@ modules = [
# Temporarily until modulesets are fixed...
branches["openssl"] = "https://ftp.openssl.org/source/old/1.1.1/openssl-1.1.1c.tar.gz"

module_extra_env['gettext-tools'] = 'CC=/usr/bin/clang CFLAGS=-O LDFLAGS=-L/usr/lib'
module_autogenargs['gettext'] = ' --disable-rpath --enable-relocatable --disable-c++ --disable-java --disable-native-java --disable-curses --without-emacs --without-bzip2 --disable-nls '
#module_extra_env['gettext-tools'] = 'CC=/usr/bin/clang CFLAGS=-O LDFLAGS=-L/usr/lib'
#module_autogenargs['gettext'] = ' --disable-rpath --enable-relocatable --disable-c++ --disable-java --disable-native-java --disable-curses --without-emacs --without-bzip2'

#module_autogenargs['zlib'] = ''
module_autogenargs['yelp'] = '--disable-Werror'
Expand All @@ -116,9 +100,8 @@ module_autogenargs['gobject-introspection'] = '--with-cairo=yes '# + autogenargs
module_autogenargs['tango-icon-theme'] ='--disable-nls --disable-icon-framing '# + autogenargs
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 --disable-ipv6 --with-ensurepip=yes --with-system-expat --without-readline --with-pkg-config --disable-test-modules '
module_extra_env['python3'] = 'LIBS=""'
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 --disable-cache-build --disable-docs --disable-dependency-tracking'
#module_autogenargs['python3'] = '--enable-optimizations --disable-ipv6 --with-ensurepip=yes --with-system-expat --without-readline --with-pkg-config --disable-test-modules '

module_autogenargs['libxml2'] = '--with-zlib --enable-ipv6=no '
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
Expand All @@ -137,7 +120,7 @@ module_mesonargs['gtk+-3.0'] = '--buildtype release --optimization 3 -Dx11
# nobuild=True # Download only
# quiet_mode=True
# Don't respect suggests
ignore_suggests = True
exit_on_error = True # For CI
interact = False # For CI
#ignore_suggests = True
#exit_on_error = True # For CI
#interact = False # For CI
shallow_clone = True

0 comments on commit a112f26

Please sign in to comment.