Skip to content

Commit

Permalink
Build environment
Browse files Browse the repository at this point in the history
  • Loading branch information
yousseb committed Oct 21, 2023
1 parent 8d57171 commit fa7d738
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Homebrew & Various Tools
run: |
#/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git ccache autoconf libtool automake pkg-config sassc optipng python bison flex cmake
brew install git ccache autoconf libtool automake pkg-config sassc optipng python bison flex cmake itstool
- name: Setup JHbuild
run: |
Expand Down
11 changes: 7 additions & 4 deletions osx/build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ failure() {
}
trap 'failure ${LINENO} "$BASH_COMMAND"' ERR

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

mkdir -p $HOME/gtk/inst/bin

#brew install autoconf libtool automake pkg-config sassc optipng python bison flex
#brew install autoconf libtool automake pkg-config sassc optipng python bison flex cmake itstool xz
ln -sf /usr/local/bin/autoconf ~/gtk/inst/bin
ln -sf /usr/local/bin/autoreconf ~/gtk/inst/bin
ln -sf /usr/local/bin/automake ~/gtk/inst/bin
Expand All @@ -28,6 +27,8 @@ ln -sf /usr/local/bin/glibtoolize ~/gtk/inst/bin/libtoolize
ln -sf /usr/local/bin/glibtool ~/gtk/inst/bin/libtool
ln -sf /usr/local/bin/cmake ~/gtk/inst/bin
ln -sf /usr/local/opt/bison/bin/bison ~/gtk/inst/bin
ln -sf /usr/local/bin/itstool ~/gtk/inst/bin
ln -sf /usr/local/bin/xz ~/gtk/inst/bin

#brew install python3 ccache
#brew tap homebrew/cask
Expand All @@ -42,8 +43,10 @@ pushd . > /dev/null

export PKG_CONFIG_PATH=$HOME/gtk/inst/lib/pkgconfig:$HOME/gtk/inst/share/pkgconfig
export XDG_DATA_DIRS=$HOME/gtk/inst/share
jhbuild buildone libffi python3 libxml2
(cd $HOME/gtk/inst/bin && touch itstool && chmod +x itstool)
jhbuild buildone libffi
jhbuild buildone python3
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
Expand Down
32 changes: 22 additions & 10 deletions osx/jhbuildrc-custom
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,34 @@ from os import path

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

if path.exists("/usr/local/bin/ccache"):
print("Using ccache")
os.environ["CC"] = "/usr/local/bin/ccache /usr/bin/clang"
os.environ["CXX"] = "/usr/local/bin/ccache /usr/bin/clang++"
print("Using ccache")
os.environ["CC"] = "/usr/local/bin/ccache /usr/bin/clang"
os.environ["CXX"] = "/usr/local/bin/ccache /usr/bin/clang++"
else:
print("Not using ccache")
os.environ["CC"] = "/usr/bin/clang"
os.environ["CXX"] = "/usr/bin/clang++"
print("Not using ccache")
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"
#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")
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.15"

# 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("icu")
Expand Down Expand Up @@ -95,7 +106,8 @@ module_autogenargs['gtk+-3.0'] = '--enable-quartz-backend --enable-quartz-reloca
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'] = 'CC= CXX= --enable-optimizations --with-system-expat --disable-ipv6 --with-ensurepip=yes --without-tests --disable-tests --with-threads --with-system-expat ' + autogenargs
module_autogenargs['python3'] = '--enable-optimizations --with-system-expat --disable-ipv6 --with-ensurepip=yes --with-system-expat '
#+ autogenargs

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'
Expand Down

0 comments on commit fa7d738

Please sign in to comment.