From 0d3cd674fedb6ef8b8b2539bee36cd90f9aac2cc Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Mon, 29 Jan 2018 22:55:04 +0530 Subject: [PATCH 01/15] 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 . From 0626c2e8900aa8e9ddab95469fda346dc7b6a4d2 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Mon, 29 Jan 2018 22:58:13 +0530 Subject: [PATCH 02/15] Build OSX packages on travis --- .travis.yml | 100 +++++++++++++++++++++-------------------- scripts/package-osx.sh | 16 ++++--- scripts/setup-osx.sh | 1 - 3 files changed, 61 insertions(+), 56 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b4262a2c..8099df35c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,66 +3,68 @@ dist: trusty language: python sudo: required python: - - "3.6" - - "3.5" +- '3.6' +- '3.5' cache: - - apt - - pip +- apt +- pip env: global: - - PIP_INSTALL="pip3 install" - - DISCID="$PIP_INSTALL discid" MUTAGEN="$PIP_INSTALL mutagen>=1.37" - - BABEL="$PIP_INSTALL babel" - - NOSE="$PIP_INSTALL nose2" - - COVERAGE="$PIP_INSTALL nose-cov" - - CODACY="$PIP_INSTALL codacy-coverage" + - PIP_INSTALL="pip3 install" + - DISCID="$PIP_INSTALL discid" MUTAGEN="$PIP_INSTALL mutagen>=1.37" + - BABEL="$PIP_INSTALL babel" + - NOSE="$PIP_INSTALL nose2" + - COVERAGE="$PIP_INSTALL nose-cov" + - CODACY="$PIP_INSTALL codacy-coverage" matrix: - - PYQT="$PIP_INSTALL pyqt5==5.9" - - PYQT="$PIP_INSTALL pyqt5==5.8" + - PYQT="$PIP_INSTALL pyqt5==5.9" + - PYQT="$PIP_INSTALL pyqt5==5.8" matrix: include: - - os: osx - osx_image: xcode8.3 - language: generic + - os: osx + osx_image: xcode8.3 + language: generic allow_failures: - - os: osx + - os: osx fast_finish: true before_install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq && sudo apt-get install -qq transifex-client libdiscid0 libdiscid0-dev qt5-default; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/setup-osx.sh; fi - - $BABEL - - $PYQT - - $MUTAGEN - - $DISCID - - $NOSE - - if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $COVERAGE; fi - - touch ~/.transifexrc - - printf "[https://www.transifex.com]\nhostname = https://www.transifex.com\npassword = $TX_PASSWORD\ntoken =\nusername = $TX_USERNAME" > ~/.transifexrc +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq && sudo apt-get + install -qq transifex-client libdiscid0 libdiscid0-dev qt5-default; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/setup-osx.sh; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source bin/activate; fi +- "$BABEL" +- "$PYQT" +- "$MUTAGEN" +- "$DISCID" +- "$NOSE" +- if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $COVERAGE; fi +- touch ~/.transifexrc +- printf "[https://www.transifex.com]\nhostname = https://www.transifex.com\npassword + = $TX_PASSWORD\ntoken =\nusername = $TX_USERNAME" > ~/.transifexrc install: - # Set up Picard - - python3 setup.py clean - - python3 setup.py clean_ui - - python3 setup.py build_ui - - python3 setup.py build_ext -i - - python3 setup.py regen_pot_file - - 'if [ ! -z "${TX_PASSWORD}" ]; then python3 setup.py get_po_files; fi' - - 'if [ ! -z "${TX_PASSWORD}" ]; then python3 setup.py update_constants; fi' - - python3 setup.py build_locales -i - - python3 setup.py patch_version --platform=test - # Travis OSX image has a permission issue while installing. Thus using sudo for it. - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo python3 setup.py install; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then python3 setup.py install; fi -# Run the tests! -script: "nose2 -v --with-coverage --coverage picard --coverage-report xml" +- python3 setup.py clean +- python3 setup.py clean_ui +- python3 setup.py build_ui +- python3 setup.py build_ext -i +- python3 setup.py regen_pot_file +- if [ ! -z "${TX_PASSWORD}" ]; then python3 setup.py get_po_files; fi +- if [ ! -z "${TX_PASSWORD}" ]; then python3 setup.py update_constants; fi +- python3 setup.py build_locales -i +- python3 setup.py patch_version --platform=test +- python3 setup.py install +script: nose2 -v --with-coverage --coverage picard --coverage-report xml after_success: - - 'if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $CODACY; python-codacy-coverage -r coverage.xml; fi' -# Tell people that tests were run +- if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $CODACY; python-codacy-coverage -r coverage.xml; + fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/package-osx.sh; fi notifications: - irc: "chat.freenode.net#metabrainz" - -# Only build commits pushed to master or 1.4 dev branch. -# This avoid duplicate builds when we make a PR from the original repo + irc: chat.freenode.net#metabrainz branches: only: - - master - - 1.4.x + - master + - 1.4.x +deploy: + provider: releases + api_key: + secure: JgtlHc3OkQ+VzfpV7QGSIo/uJQdXSYgssi/f6rfwTYEy3nkLNRys7EQAYa8VExeK+QytiTuW6/2/hIUgFbjYywpkIBv+JiVrDStBOB8jI8QPcWx1fYWKnZOSITbvLXbKWNk4zMe8ccNIeP0+wRkZwio6FqrADbgg1On6n7setzU= + file: dist/*.dmg diff --git a/scripts/package-osx.sh b/scripts/package-osx.sh index 5208d1b32..4752382d6 100644 --- a/scripts/package-osx.sh +++ b/scripts/package-osx.sh @@ -1,17 +1,21 @@ if [ -z "$CI_BUILD_TAG" ] then - python setup.py patch_version --platform=osx + python3 setup.py patch_version --platform=osx fi -VERSION=`python -c 'import picard; print picard.__version__'` +VERSION=$(python3 -c 'import picard; print(picard.__version__)') rm -rf dist build locale -python setup.py clean -python setup.py build_ext -i -python setup.py build_locales -i +python3 setup.py clean +python3 setup.py build_ext +python3 setup.py build_locales +pip3 install pyinstaller pyinstaller picard.spec cd dist ditto -rsrc --arch x86_64 'MusicBrainz Picard.app' 'MusicBrainz Picard.tmp' rm -r 'MusicBrainz Picard.app' mv 'MusicBrainz Picard.tmp' 'MusicBrainz Picard.app' -hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Picard.app' -ov -format UDBZ ../MusicBrainz-Picard-$VERSION.dmg +hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Picard.app' -ov -format UDBZ ../picard.dmg +cd .. +ls +curl --upload-file "picard.dmg" https://transfer.sh/picard.dmg diff --git a/scripts/setup-osx.sh b/scripts/setup-osx.sh index ed56c63cd..1c19a3513 100644 --- a/scripts/setup-osx.sh +++ b/scripts/setup-osx.sh @@ -6,4 +6,3 @@ brew install libdiscid pip3 install --upgrade pip setuptools wheel pip3 install virtualenv virtualenv -p python3 . -source bin/activate From b89f70bcd18986b0b74aa479cdc0a32085243978 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 30 Jan 2018 01:40:34 +0530 Subject: [PATCH 03/15] Enable high-dpi mode while building app --- picard.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/picard.spec b/picard.spec index 2defdbaf9..106823898 100644 --- a/picard.spec +++ b/picard.spec @@ -70,7 +70,16 @@ exe = EXE(pyz, icon='picard.ico', ) if platform.system() == 'Darwin': + import plistlib + app_name = 'MusicBrainz Picard.app' app = BUNDLE(exe, - name='MusicBrainz Picard.app', + name=app_name, icon='picard.icns', - bundle_identifier=None) \ No newline at end of file + bundle_identifier=None) + # We need to do the below changes to plist in order to enable High-DPI in + # our final packaged app + plist_path = os.path.join('dist', app_name, 'Contents', 'Info.plist') + values = plistlib.readPlist(plist_path) + values['NSPrincipalClass'] = 'NSApplication' + values['NSHighResolutionCapable'] = 'True' + plistlib.writePlist(values, plist_path) From ae6afb9e0cc60118ca5d6e1419c4d8897f8e04fc Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 30 Jan 2018 16:23:58 +0530 Subject: [PATCH 04/15] Update OSX scripts with shebang and execution bits --- scripts/package-osx.sh | 1 + scripts/setup-osx.sh | 1 + 2 files changed, 2 insertions(+) mode change 100644 => 100755 scripts/package-osx.sh mode change 100644 => 100755 scripts/setup-osx.sh diff --git a/scripts/package-osx.sh b/scripts/package-osx.sh old mode 100644 new mode 100755 index 4752382d6..790cbac45 --- a/scripts/package-osx.sh +++ b/scripts/package-osx.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash if [ -z "$CI_BUILD_TAG" ] then python3 setup.py patch_version --platform=osx diff --git a/scripts/setup-osx.sh b/scripts/setup-osx.sh old mode 100644 new mode 100755 index 1c19a3513..b34285e16 --- a/scripts/setup-osx.sh +++ b/scripts/setup-osx.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash brew install python3 brew link python3 --force brew install gettext From 0d57653529a4f9c506347ffe6659aa4b3a00f72a Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 30 Jan 2018 16:28:16 +0530 Subject: [PATCH 05/15] Fix artifact upload --- .travis.yml | 3 +++ scripts/package-osx.sh | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8099df35c..f09dc76bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,7 @@ after_success: - if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $CODACY; python-codacy-coverage -r coverage.xml; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/package-osx.sh; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl --upload-file "dist/picard.dmg" https://transfer.sh/picard.dmg; fi notifications: irc: chat.freenode.net#metabrainz branches: @@ -67,4 +68,6 @@ deploy: provider: releases api_key: secure: JgtlHc3OkQ+VzfpV7QGSIo/uJQdXSYgssi/f6rfwTYEy3nkLNRys7EQAYa8VExeK+QytiTuW6/2/hIUgFbjYywpkIBv+JiVrDStBOB8jI8QPcWx1fYWKnZOSITbvLXbKWNk4zMe8ccNIeP0+wRkZwio6FqrADbgg1On6n7setzU= + file_glob: true + skip_cleanup: true file: dist/*.dmg diff --git a/scripts/package-osx.sh b/scripts/package-osx.sh index 790cbac45..a26607d4a 100755 --- a/scripts/package-osx.sh +++ b/scripts/package-osx.sh @@ -16,7 +16,4 @@ cd dist ditto -rsrc --arch x86_64 'MusicBrainz Picard.app' 'MusicBrainz Picard.tmp' rm -r 'MusicBrainz Picard.app' mv 'MusicBrainz Picard.tmp' 'MusicBrainz Picard.app' -hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Picard.app' -ov -format UDBZ ../picard.dmg -cd .. -ls -curl --upload-file "picard.dmg" https://transfer.sh/picard.dmg +hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Picard.app' -ov -format UDBZ picard.dmg From d13d257ade8d15b7364b305e12c635554009e590 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 6 Feb 2018 15:12:42 +0530 Subject: [PATCH 06/15] Use pyinstaller to modify info.plist --- picard.spec | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/picard.spec b/picard.spec index 106823898..1f54e3457 100644 --- a/picard.spec +++ b/picard.spec @@ -4,6 +4,7 @@ import os import glob import platform + def _picard_get_locale_files(): locales = [] path_domain = { @@ -64,22 +65,15 @@ exe = EXE(pyz, name='picard', debug=False, strip=False, - upx=True, runtime_tmpdir=None, console=False, icon='picard.ico', ) if platform.system() == 'Darwin': - import plistlib - app_name = 'MusicBrainz Picard.app' + info_plist = {'NSHighResolutionCapable': 'True', 'NSPrincipalClass': 'NSApplication'} app = BUNDLE(exe, - name=app_name, + name='MusicBrainz Picard.app', icon='picard.icns', - bundle_identifier=None) - # We need to do the below changes to plist in order to enable High-DPI in - # our final packaged app - plist_path = os.path.join('dist', app_name, 'Contents', 'Info.plist') - values = plistlib.readPlist(plist_path) - values['NSPrincipalClass'] = 'NSApplication' - values['NSHighResolutionCapable'] = 'True' - plistlib.writePlist(values, plist_path) + bundle_identifier=None, + info_plist=info_plist + ) From 16311cabc91b470e398cc2cf6c1dc7a8bcd20de4 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 6 Feb 2018 15:17:12 +0530 Subject: [PATCH 07/15] Add Picard version string to dmg and generate md5 hashes --- .travis.yml | 1 - scripts/package-osx.sh | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f09dc76bc..b53463887 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,6 @@ after_success: - if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $CODACY; python-codacy-coverage -r coverage.xml; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/package-osx.sh; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl --upload-file "dist/picard.dmg" https://transfer.sh/picard.dmg; fi notifications: irc: chat.freenode.net#metabrainz branches: diff --git a/scripts/package-osx.sh b/scripts/package-osx.sh index a26607d4a..1577ece3b 100755 --- a/scripts/package-osx.sh +++ b/scripts/package-osx.sh @@ -16,4 +16,9 @@ cd dist ditto -rsrc --arch x86_64 'MusicBrainz Picard.app' 'MusicBrainz Picard.tmp' rm -r 'MusicBrainz Picard.app' mv 'MusicBrainz Picard.tmp' 'MusicBrainz Picard.app' -hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Picard.app' -ov -format UDBZ picard.dmg +hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Picard.app' -ov -format UDBZ "MusicBrainz Picard $VERSION.dmg" +if [ -n "$UPLOAD_OSX" ] +then + curl --upload-file "MusicBrainz Picard $VERSION.dmg" https://transfer.sh/ + md5 -r "MusicBrainz Picard $VERSION.dmg" +fi \ No newline at end of file From 1c3378d3a3804f11f1a054fe6f8246959e2127bd Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 6 Feb 2018 15:59:16 +0530 Subject: [PATCH 08/15] Use OSX 10.11 to build packages --- .travis.yml | 2 +- scripts/package-osx.sh | 2 ++ scripts/setup-osx.sh | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b53463887..f25289a81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ env: matrix: include: - os: osx - osx_image: xcode8.3 + osx_image: xcode8 language: generic allow_failures: - os: osx diff --git a/scripts/package-osx.sh b/scripts/package-osx.sh index 1577ece3b..e019770d9 100755 --- a/scripts/package-osx.sh +++ b/scripts/package-osx.sh @@ -20,5 +20,7 @@ hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Pi if [ -n "$UPLOAD_OSX" ] then curl --upload-file "MusicBrainz Picard $VERSION.dmg" https://transfer.sh/ + # Required for a newline between the outputs + echo -e "\n" md5 -r "MusicBrainz Picard $VERSION.dmg" fi \ No newline at end of file diff --git a/scripts/setup-osx.sh b/scripts/setup-osx.sh index b34285e16..40ff4c26b 100755 --- a/scripts/setup-osx.sh +++ b/scripts/setup-osx.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +brew update brew install python3 brew link python3 --force brew install gettext From bca576744d21fd30e2cabf4f9014006056162d12 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 6 Feb 2018 16:46:09 +0530 Subject: [PATCH 09/15] Only build releases on tags --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index f25289a81..d16a46e55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,3 +70,5 @@ deploy: file_glob: true skip_cleanup: true file: dist/*.dmg + on: + tags: true From 22cb70a8cf5a8dc03f7906d17343e1e5ae9021e6 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 6 Feb 2018 17:07:11 +0530 Subject: [PATCH 10/15] Fix OSX builds by adding libdiscid binaries --- .travis.yml | 1 + picard.spec | 3 +++ scripts/setup-osx.sh | 1 + 3 files changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index d16a46e55..4f54608c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq && sudo apt-get install -qq transifex-client libdiscid0 libdiscid0-dev qt5-default; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/setup-osx.sh; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source bin/activate; fi - "$BABEL" - "$PYQT" diff --git a/picard.spec b/picard.spec index 1f54e3457..1d6ccfe91 100644 --- a/picard.spec +++ b/picard.spec @@ -40,6 +40,9 @@ if os_name == 'Windows': fpcalc_name = 'fpcalc.exe' binaries += [('discid.dll', '')] +if os_name == 'Darwin': + binaries += [('libdiscid.0.dylib', '')] + if os.path.isfile(fpcalc_name): binaries += [(fpcalc_name, '')] diff --git a/scripts/setup-osx.sh b/scripts/setup-osx.sh index 40ff4c26b..207d234c6 100755 --- a/scripts/setup-osx.sh +++ b/scripts/setup-osx.sh @@ -5,6 +5,7 @@ brew link python3 --force brew install gettext brew link gettext --force brew install libdiscid +cp /usr/local/Cellar/libdiscid/0.6.2/lib/libdiscid.0.dylib . pip3 install --upgrade pip setuptools wheel pip3 install virtualenv virtualenv -p python3 . From cd5800a2e6d13cf30408606e63e3c5a6f31b15b1 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 6 Feb 2018 19:35:26 +0530 Subject: [PATCH 11/15] Add brew caching --- .travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4f54608c8..a4bea6bf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,10 @@ python: cache: - apt - pip +cache: + ccache: true + directories: + - $HOME/Library/Caches/Homebrew env: global: - PIP_INSTALL="pip3 install" @@ -22,7 +26,7 @@ env: matrix: include: - os: osx - osx_image: xcode8 + osx_image: xcode6.4 language: generic allow_failures: - os: osx @@ -30,6 +34,9 @@ matrix: before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq && sudo apt-get install -qq transifex-client libdiscid0 libdiscid0-dev qt5-default; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/setup-osx.sh; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source bin/activate; fi From 2b9ef3c6bd03f7ab50addcbab02e1f5c1e327ac7 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 6 Feb 2018 22:25:37 +0530 Subject: [PATCH 12/15] Use an env. variable for discid version --- scripts/setup-osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup-osx.sh b/scripts/setup-osx.sh index 207d234c6..ffcd979ed 100755 --- a/scripts/setup-osx.sh +++ b/scripts/setup-osx.sh @@ -5,7 +5,7 @@ brew link python3 --force brew install gettext brew link gettext --force brew install libdiscid -cp /usr/local/Cellar/libdiscid/0.6.2/lib/libdiscid.0.dylib . +cp "/usr/local/Cellar/libdiscid/$DISCID_VERSION/lib/libdiscid.0.dylib" . pip3 install --upgrade pip setuptools wheel pip3 install virtualenv virtualenv -p python3 . From 7843124c9e2a216b85c54d979bada685a59ba219 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Tue, 6 Feb 2018 23:23:34 +0530 Subject: [PATCH 13/15] Build discid from source --- scripts/setup-osx.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/setup-osx.sh b/scripts/setup-osx.sh index ffcd979ed..f211f9c19 100755 --- a/scripts/setup-osx.sh +++ b/scripts/setup-osx.sh @@ -4,8 +4,13 @@ brew install python3 brew link python3 --force brew install gettext brew link gettext --force -brew install libdiscid -cp "/usr/local/Cellar/libdiscid/$DISCID_VERSION/lib/libdiscid.0.dylib" . +wget "ftp://ftp.musicbrainz.org/pub/musicbrainz/libdiscid/libdiscid-$DISCID_VERSION.tar.gz" +tar -xf "libdiscid-$DISCID_VERSION.tar.gz" +cd "libdiscid-$DISCID_VERSION" +./configure --prefix="$HOME/libdiscid" +make install +cd .. +cp "$HOME/libdiscid/lib/libdiscid.0.dylib" . pip3 install --upgrade pip setuptools wheel pip3 install virtualenv virtualenv -p python3 . From cbc989d00e1c2c9fa29757cb0368aec534f68fec Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Thu, 8 Feb 2018 01:04:40 +0100 Subject: [PATCH 14/15] Prevent multiple calls to tagger.exit() When Picard is stopped by signal (ie. CTRL-C from linux command line), exit() may be called more than once. --- picard/tagger.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/picard/tagger.py b/picard/tagger.py index e74c7c473..8e8443ae9 100644 --- a/picard/tagger.py +++ b/picard/tagger.py @@ -278,8 +278,10 @@ class Tagger(QtWidgets.QApplication): self.nats.update() def exit(self): - log.debug("Picard stopping") + if self.stopping: + return self.stopping = True + log.debug("Picard stopping") self._acoustid.done() self.thread_pool.waitForDone() self.save_thread_pool.waitForDone() From 1dabaaf1ff4e6604c7d731961c48a9ae0f5e9c89 Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Thu, 8 Feb 2018 14:16:09 +0100 Subject: [PATCH 15/15] Set builtin search dialog horizontal to pixel mode Without this option, it may be hard to resize very wide columns. --- picard/ui/searchdialog/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/picard/ui/searchdialog/__init__.py b/picard/ui/searchdialog/__init__.py index 8e8159660..4c2831f7f 100644 --- a/picard/ui/searchdialog/__init__.py +++ b/picard/ui/searchdialog/__init__.py @@ -49,6 +49,7 @@ class ResultTable(QtWidgets.QTableWidget): parent.scrolled.emit() self.horizontalScrollBar().valueChanged.connect(emit_scrolled) self.verticalScrollBar().valueChanged.connect(emit_scrolled) + self.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) class SearchBox(QtWidgets.QWidget):