Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M1 build fixes #148

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osx/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cp osx/conf.py meld/conf.py
${INSTROOT}/bin/python3 -c "import sys; print('\n'.join(sys.path))"

PY_SITE_PACKAGES=$(~/gtk/inst/bin/python3 -c 'import site; print(site.getsitepackages()[0], end="")')
/usr/local/bin/pip3 install --upgrade --force-reinstall distro pyobjc-core pyobjc-framework-Cocoa py2app six pygments --target $PY_SITE_PACKAGES
/opt/homebrew/bin/pip3 install --upgrade --force-reinstall distro pyobjc-core pyobjc-framework-Cocoa py2app six pygments --target $PY_SITE_PACKAGES

glib-compile-schemas data
${INSTROOT}/bin/python3 setup_py2app.py build
Expand Down
28 changes: 14 additions & 14 deletions osx/build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ 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 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
ln -sf /usr/local/bin/autopoint ~/gtk/inst/bin
ln -sf /usr/local/bin/pkg-config ~/gtk/inst/bin
ln -sf /usr/local/bin/aclocal ~/gtk/inst/bin
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
ln -sf /opt/homebrew/bin/autoconf ~/gtk/inst/bin
ln -sf /opt/homebrew/bin/autoreconf ~/gtk/inst/bin
ln -sf /opt/homebrew/bin/automake ~/gtk/inst/bin
ln -sf /opt/homebrew/bin/autopoint ~/gtk/inst/bin
ln -sf /opt/homebrew/bin/pkg-config ~/gtk/inst/bin
ln -sf /opt/homebrew/bin/aclocal ~/gtk/inst/bin
ln -sf /opt/homebrew/bin/glibtoolize ~/gtk/inst/bin/libtoolize
ln -sf /opt/homebrew/bin/glibtool ~/gtk/inst/bin/libtool
ln -sf /opt/homebrew/bin/cmake ~/gtk/inst/bin
ln -sf /opt/homebrew/opt/bison/bin/bison ~/gtk/inst/bin
ln -sf /opt/homebrew/bin/itstool ~/gtk/inst/bin
ln -sf /opt/homebrew/bin/xz ~/gtk/inst/bin

pushd . > /dev/null

Expand Down Expand Up @@ -106,15 +106,15 @@ 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
/opt/homebrew/bin/pip3 install six pygments --target $PY_SITE_PACKAGES

# 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
/opt/homebrew/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
mv $HOME/gtk/inst/lib/pkgconfig/epoxy.pc $HOME/gtk/inst/lib/pkgconfig/epoxy.pc.orig
Expand Down
16 changes: 8 additions & 8 deletions osx/build_icon_theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ fi
if [[ ${color} == '-dark' ]]; then
mkdir -p ${THEME_DIR}/{apps,categories,emblems,devices,mimes,places,status}

cp -cRP "${SRC_DIR}"/src/actions ${THEME_DIR}
cp -cRP "${SRC_DIR}"/src/apps/symbolic ${THEME_DIR}/apps
cp -cRP "${SRC_DIR}"/src/categories/symbolic ${THEME_DIR}/categories
cp -cRP "${SRC_DIR}"/src/emblems/symbolic ${THEME_DIR}/emblems
cp -cRP "${SRC_DIR}"/src/mimes/symbolic ${THEME_DIR}/mimes
cp -cRP "${SRC_DIR}"/src/devices/{16,22,24,symbolic} ${THEME_DIR}/devices
cp -cRP "${SRC_DIR}"/src/places/{16,22,24,symbolic} ${THEME_DIR}/places
cp -cRP "${SRC_DIR}"/src/status/{16,22,24,symbolic} ${THEME_DIR}/status
cp -RP "${SRC_DIR}"/src/actions ${THEME_DIR}
cp -RP "${SRC_DIR}"/src/apps/symbolic ${THEME_DIR}/apps
cp -RP "${SRC_DIR}"/src/categories/symbolic ${THEME_DIR}/categories
cp -RP "${SRC_DIR}"/src/emblems/symbolic ${THEME_DIR}/emblems
cp -RP "${SRC_DIR}"/src/mimes/symbolic ${THEME_DIR}/mimes
cp -RP "${SRC_DIR}"/src/devices/{16,22,24,symbolic} ${THEME_DIR}/devices
cp -RP "${SRC_DIR}"/src/places/{16,22,24,symbolic} ${THEME_DIR}/places
cp -RP "${SRC_DIR}"/src/status/{16,22,24,symbolic} ${THEME_DIR}/status

if [[ ${bold:-} == 'true' ]]; then
cp -RP "${SRC_DIR}"/bold/* ${THEME_DIR}
Expand Down
4 changes: 2 additions & 2 deletions osx/jhbuildrc-custom
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ module_autogenargs['tango-icon-theme'] ='--disable-nls --disable-icon-frami
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 --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['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

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['glib'] = '--buildtype release --optimization 3 -Dbsymbolic_functions=false -Dgtk_doc=false -Db_bitcode=true -Db_ndebug=true -Dtests=false'
module_mesonargs['pango'] = '--buildtype release --optimization 3 -Dintrospection=enabled'
module_mesonargs['pygobject3'] = '--buildtype release --optimization 3 -Dtests=false -Dpycairo=enabled'
module_mesonargs['gtksourceview4'] = '--buildtype release --optimization 3 -Dvapi=false'
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be ok, but I'll probably have to have different file setup.cfg.in and generate the file during build for m1&x64. Maybe even skip this altogether and use py2app's arg from command line for arch.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[py2app]
app = ['bin/meld']
arch = x86_64
arch = universal2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know if this works. :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it works! universal2 works, universal does not.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you very much for doing this.


[flake8]

Expand Down
4 changes: 2 additions & 2 deletions setup_py2app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'CFBundleSignature': '???',
'CFBundleVersion': VERSION_STRING,
'LSPrefersPPC': False,
'LSArchitecturePriority': 'x86_64',
'LSArchitecturePriority': 'arm64',
'NSHumanReadableCopyright': u'Copyright © 2023',
'CFBundleDisplayName': 'Meld',
'CFBundleName': 'Meld',
Expand Down Expand Up @@ -116,7 +116,7 @@
'includes': [ 'gi', 'weakref', 'encodings', 'pycairo', 'PyGObject',
'pyobjc-core', 'pyobjc-framework-Cocoa',
'CoreFoundation', 'Foundation' ],
'excludes': [ 'tkinter' ],
'excludes': [ 'tkinter', 'ssl' ],
'dylib_excludes': [ 'Python' ],
'frameworks': [ ],
'argv_emulation': False,
Expand Down