From 0d3cd674fedb6ef8b8b2539bee36cd90f9aac2cc Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Mon, 29 Jan 2018 22:55:04 +0530 Subject: [PATCH] Fix OSX builds --- picard.spec | 6 +++++- scripts/package-osx.sh | 28 +--------------------------- scripts/setup-osx.sh | 2 +- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/picard.spec b/picard.spec index 158cad089..2defdbaf9 100644 --- a/picard.spec +++ b/picard.spec @@ -4,7 +4,6 @@ import os import glob import platform - def _picard_get_locale_files(): locales = [] path_domain = { @@ -70,3 +69,8 @@ exe = EXE(pyz, console=False, icon='picard.ico', ) +if platform.system() == 'Darwin': + app = BUNDLE(exe, + name='MusicBrainz Picard.app', + icon='picard.icns', + bundle_identifier=None) \ No newline at end of file diff --git a/scripts/package-osx.sh b/scripts/package-osx.sh index cde79f326..5208d1b32 100644 --- a/scripts/package-osx.sh +++ b/scripts/package-osx.sh @@ -1,29 +1,3 @@ -curl -L -O https://github.com/acoustid/chromaprint/releases/download/v$CHROMAPRINT_FPCALC_VERSION/chromaprint-fpcalc-$CHROMAPRINT_FPCALC_VERSION-macos-x86_64.tar.gz -tar --strip-components 1 -xf chromaprint-fpcalc-$CHROMAPRINT_FPCALC_VERSION-macos-x86_64.tar.gz chromaprint-fpcalc-$CHROMAPRINT_FPCALC_VERSION-macos-x86_64/fpcalc - -curl -L -O http://ftp.musicbrainz.org/pub/musicbrainz/libdiscid/libdiscid-$DISCID_VERSION-mac.zip -unzip -jx libdiscid-$DISCID_VERSION-mac.zip libdiscid-$DISCID_VERSION-mac/intel64/libdiscid.0.dylib -export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH - -curl -L -o plugins.zip https://github.com/metabrainz/picard-plugins/archive/master.zip -unzip -x plugins.zip -mkdir contrib -mv picard-plugins-master/plugins contrib/plugins - -rm -rf e -virtualenv -p python2.7 --system-site-packages e -. e/bin/activate - -pip install mutagen==$MUTAGEN_VERSION -pip install discid==$PYTHON_DISCID_VERSION -pip install py2app==$PY2APP_VERSION - -perl -pi -e 's{plugin_dir = (.*)$}{plugin_dir = "/Developer/Applications/Qt/plugins"}' e/lib/python2.7/site-packages/py2app/recipes/sip.py - -echo 'from __future__ import absolute_import' > e/lib/python2.7/site-packages/py2app/recipes/sip.py.new -cat e/lib/python2.7/site-packages/py2app/recipes/sip.py >> e/lib/python2.7/site-packages/py2app/recipes/sip.py.new -mv e/lib/python2.7/site-packages/py2app/recipes/sip.py.new e/lib/python2.7/site-packages/py2app/recipes/sip.py - if [ -z "$CI_BUILD_TAG" ] then python setup.py patch_version --platform=osx @@ -34,7 +8,7 @@ rm -rf dist build locale python setup.py clean python setup.py build_ext -i python setup.py build_locales -i -python setup.py py2app +pyinstaller picard.spec cd dist ditto -rsrc --arch x86_64 'MusicBrainz Picard.app' 'MusicBrainz Picard.tmp' diff --git a/scripts/setup-osx.sh b/scripts/setup-osx.sh index 348c94f83..ed56c63cd 100644 --- a/scripts/setup-osx.sh +++ b/scripts/setup-osx.sh @@ -2,7 +2,7 @@ brew install python3 brew link python3 --force brew install gettext brew link gettext --force -brew install libdiscid +brew install libdiscid pip3 install --upgrade pip setuptools wheel pip3 install virtualenv virtualenv -p python3 .