Skip to content

Commit

Permalink
Build should complete on GH - still broken, though
Browse files Browse the repository at this point in the history
  • Loading branch information
yousseb committed Nov 5, 2023
1 parent 7ba46ea commit 75bae82
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 40 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3

- name: Setup JHbuild
run: |
ln -sf $PWD/osx/jhbuildrc-custom $HOME/.jhbuildrc-custom
/bin/bash -c "$(curl -fsSL https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/gtk-osx-setup.sh)"
- name: Extract Environment
working-directory: /
shell: 'bash'
Expand Down Expand Up @@ -92,3 +97,10 @@ jobs:
- name: Package
run: |
~/.new_local/bin/jhbuild run osx/build_app.sh
- name: Upload Artifact
uses: actions/upload-artifact@v3.1.3
with:
name: Environment
path: |
*.dmg
31 changes: 14 additions & 17 deletions osx/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ INSTROOT="$HOME/gtk/inst/"
CODE_SIGN_ID=""
INSTALLER_CODE_SIGN_ID=""


# TODO: Move this to build_env.sh
#icon_sizes=( "16" "22" "24" "32" "48" "64" "72" "96" "128" "256" "512" )
#for icon_size in ${icon_sizes[@]}; do
Expand All @@ -30,29 +31,24 @@ INSTALLER_CODE_SIGN_ID=""
# -o ${INSTROOT}/share/icons/hicolor/${icon_size}x${icon_size}/apps/org.gnome.Meld.png
#done;
#(cd ${INSTROOT}/share/icons/hicolor/ && gtk-update-icon-cache -fqt .)
# intltool

cp meld/conf.py.in meld/conf.py.in.orig
cp osx/conf.py meld/conf.py

python3 -c "import sys; print('\n'.join(sys.path))"
${INSTROOT}/bin/python3 -c "import sys; print('\n'.join(sys.path))"

glib-compile-schemas data
python3 setup_py2app.py build
python3 setup_py2app.py py2app --use-faulthandler
${INSTROOT}/bin/python3 setup_py2app.py build
${INSTROOT}/bin/python3 setup_py2app.py py2app --use-faulthandler

mv meld/conf.py.in.orig meld/conf.py.in
rm meld/conf.py

# py2app copies all Python framework to target..
# too busy to figure out how to solve this at the moment. Let's just
# delete the files after they've been copied.
# rm -fr $FRAMEWORKS/Python.framework

# icon themes
rsync -r -t --ignore-existing ${INSTROOT}/share/icons/Adwaita ${RES}/share/icons
rsync -r -t --ignore-existing ${INSTROOT}/share/icons/Meld-WhiteSur-Icons ${RES}/share/icons
rsync -r -t --ignore-existing ${INSTROOT}/share/icons/hicolor ${RES}/share/icons
rsync -r -t --ignore-existing ${INSTROOT}/share/icons/Os-Catalina-icons ${RES}/share/icons
(cd ${RES}/share/icons && ln -sf Os-Catalina-icons MeldIcons)
(cd ${RES}/share/icons && ln -sf Meld-WhiteSur-Icons MeldIcons)

# glib schemas
rsync -r -t $INSTROOT/share/glib-2.0/schemas $RES/share/glib-2.0
Expand All @@ -74,10 +70,11 @@ gdk-pixbuf-query-loaders | sed s=\".*/lib/gdk-pixbuf-2.0=\"@executable_path/\.\
mkdir -p $RES/share/themes
rsync -r -t $INSTROOT/share/themes/Default/ $RES/share/themes/Default
rsync -r -t $INSTROOT/share/themes/Mac/ $RES/share/themes/Mac
rsync -r -t $INSTROOT/share/themes/WhiteSur-Dark-solid/ $RES/share/themes/WhiteSur-Dark-solid
rsync -r -t $INSTROOT/share/themes/WhiteSur-Light-solid/ $RES/share/themes/WhiteSur-Light-solid
rsync -r -t $INSTROOT/share/gtksourceview-4 $RES/share
mkdir -p $RES/share/themes/Meld-Os-Catalina-gtk/gtk-3.0
rsync -r -t --ignore-existing $INSTROOT/share/themes/Meld-Os-Catalina-gtk/gtk-3.0 $RES/share/themes/Meld-Os-Catalina-gtk
cp $INSTROOT/share/themes/Mac/gtk-3.0/gtk-keys.css $RES/share/themes/Meld-Os-Catalina-gtk/gtk-3.0/gtk-keys.css
cp $INSTROOT/share/themes/Mac/gtk-3.0/gtk-keys.css $RES/share/themes/WhiteSur-Light-solid/gtk-3.0/gtk-keys.css
cp $INSTROOT/share/themes/Mac/gtk-3.0/gtk-keys.css $RES/share/themes/WhiteSur-Dark-solid/gtk-3.0/gtk-keys.css

# meld specific resources
mkdir -p $RES/share/meld
Expand All @@ -99,7 +96,7 @@ rsync -r -t data/icons/* $RES/share/icons
# rm -fr ${RES}/share/icons/Adwaita/${icon_size}x${icon_size}/categories/ || true
# rm -fr ${RES}/share/icons/Adwaita/${icon_size}x${icon_size}/status/ || true
# done;
(cd $RES/share/icons/Adwaita && gtk-update-icon-cache -fqt .)
# (cd $RES/share/icons/Adwaita && gtk-update-icon-cache -fqt .)

# update icon cache for hicolor
(cd $RES/share/icons/hicolor && gtk-update-icon-cache -fqt .)
Expand All @@ -123,7 +120,6 @@ rsync -r -t $INSTROOT/lib/gobject-introspection $RES/lib
mkdir -p $FRAMEWORKS
rsync -t $INSTROOT/lib/libglib-2.0.0.dylib $FRAMEWORKS/libglib-2.0.0.dylib
rsync -t $INSTROOT/lib/libcairo-gobject.2.dylib $FRAMEWORKS/libcairo-gobject.2.dylib
# rsync -t $INSTROOT/lib/libcairo-script-interpreter.2.dylib $FRAMEWORKS/libcairo-script-interpreter.2.dylib
rsync -t $INSTROOT/lib/libcairo.2.dylib $FRAMEWORKS/libcairo.2.dylib
rsync -t $INSTROOT/lib/libpangocairo-1.0.0.dylib $FRAMEWORKS/libpangocairo-1.0.0.dylib
rsync -t $INSTROOT/lib/libatk-1.0.0.dylib $FRAMEWORKS/libatk-1.0.0.dylib
Expand All @@ -133,7 +129,7 @@ rsync -t $INSTROOT/lib/libpango-1.0.0.dylib $FRAMEWORKS/libpango-1.0.0.dylib
rsync -t $INSTROOT/lib/libpangoft2-1.0.0.dylib $FRAMEWORKS/libpangoft2-1.0.0.dylib
rsync -t $INSTROOT/lib/libgtk-3.0.dylib $FRAMEWORKS/libgtk-3.0.dylib
rsync -t $INSTROOT/lib/libgtksourceview-4.0.dylib $FRAMEWORKS/libgtksourceview-4.0.dylib
rsync -t $INSTROOT/lib/libgtkmacintegration-gtk3.2.dylib $FRAMEWORKS/libgtkmacintegration-gtk3.2.dylib
rsync -t $INSTROOT/lib/libgtkmacintegration-gtk3.4.dylib $FRAMEWORKS/libgtkmacintegration-gtk3.4.dylib

# rename script, use wrapper
#mv $MAIN/Contents/MacOS/Meld $MAIN/Contents/MacOS/Meld-bin
Expand Down Expand Up @@ -246,6 +242,7 @@ else
#spctl -a -t exec -vv "meldmerge.dmg" && dmg_signed=1
fi

exit

# Cleanup
mkdir -p osx/Archives
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[py2app]
app = ['bin/meld']
#arch = i386
arch = universal2
iconfile = osx/meld.icns
site-packages = false
packages = gi
includes = glib, gio, cairo, pango, pangocairo, atk, gobject, gtk.keysyms
excludes = gtk-2.0
frameworks = CoreFoundation, Foundation, Python
#frameworks = CoreFoundation, Foundation, Python
argv_emulation = True
#resources = share/themes/Mac

Expand Down
44 changes: 23 additions & 21 deletions setup_py2app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'CFBundleVersion': VERSION_STRING,
'LSPrefersPPC': False,
'LSArchitecturePriority': 'x86_64',
'NSHumanReadableCopyright': u'Copyright © 2020',
'NSHumanReadableCopyright': u'Copyright © 2023',
'CFBundleDisplayName': 'Meld',
'CFBundleName': 'Meld',
'NSHighResolutionCapable': True,
Expand Down Expand Up @@ -113,28 +113,30 @@
setup_requires=["py2app"],
options={'py2app': {
'includes': [ 'cairo', 'gi', 'weakref', 'encodings' ],
'excludes': [ 'ctypes' ],
'excludes': [ 'ctypes', 'tkinter' ],
'dylib_excludes': [ 'Python' ],
'frameworks':
[ 'libpython3.6m.dylib',
'libatk-1.0.0.dylib',
'libcairo-gobject.2.dylib',
'libcairo-script-interpreter.2.dylib',
'libcairo.2.dylib',
'libgio-2.0.0.dylib',
'libgirepository-1.0.1.dylib',
'libglib-2.0.0.dylib',
'libgmodule-2.0.0.dylib',
'libgobject-2.0.0.dylib',
'libgtk-3.0.dylib',
'libgtkmacintegration-gtk3.2.dylib',
'libgtksourceview-4.dylib',
'libgtksourceview-4.0.dylib',
'libharfbuzz.0.dylib',
'libpango-1.0.0.dylib',
'libpangocairo-1.0.0.dylib',
'libpangoft2-1.0.0.dylib',
'librsvg-2.2.dylib' ],
[
# 'libpython3.11.dylib',
# 'libatk-1.0.0.dylib',
# 'libcairo-gobject.2.dylib',
# 'libcairo-script-interpreter.2.dylib',
# 'libcairo.2.dylib',
# 'libgio-2.0.0.dylib',
# 'libgirepository-1.0.1.dylib',
# 'libglib-2.0.0.dylib',
# 'libgmodule-2.0.0.dylib',
# 'libgobject-2.0.0.dylib',
# 'libgtk-3.0.dylib',
# 'libgtkmacintegration-gtk3.4.dylib',
# 'libgtksourceview-4.dylib',
# 'libgtksourceview-4.0.dylib',
# 'libharfbuzz.0.dylib',
# 'libpango-1.0.dylib',
# 'libpangocairo-1.0.0.dylib',
# 'libpangoft2-1.0.0.dylib',
# 'librsvg-2.2.dylib'
],
'argv_emulation': True,
'no_chdir': True,
'iconfile': 'osx/meld.icns',
Expand Down

0 comments on commit 75bae82

Please sign in to comment.