diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee05369..774823a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -235,14 +235,14 @@ jobs: - name: Pack if: steps.cache.outputs.cache-hit == 'true' run: | - ./utils/macos/macos-dmg.sh ${{ matrix.target }} - mv mod-desktop-app-*.dmg mod-desktop-app-${{ github.event.pull_request.number || env.SHA8 }}-macOS.dmg + ./utils/macos/macos-pkg.sh ${{ matrix.target }} + mv mod-desktop-app-*.pkg mod-desktop-app-${{ github.event.pull_request.number || env.SHA8 }}-macOS.pkg - uses: actions/upload-artifact@v3 if: ${{ matrix.os == env.RELEASE_OS_MAC && matrix.target == 'macos-universal-10.15' }} with: name: mod-desktop-app-${{ github.event.pull_request.number || env.SHA8 }}-macOS path: | - *.dmg + *.pkg - uses: softprops/action-gh-release@v1 if: ${{ matrix.os == env.RELEASE_OS_MAC && startsWith(github.ref, 'refs/tags/') }} with: @@ -251,7 +251,7 @@ jobs: draft: false prerelease: false files: | - *.dmg + *.pkg win64: strategy: diff --git a/.gitignore b/.gitignore index 1390bb7..ac7b0bf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.dmg *.exe *.o +*.pkg *.tar.gz *.zip qrc_*.hpp diff --git a/Makefile b/Makefile index 0b71576..1f30f61 100644 --- a/Makefile +++ b/Makefile @@ -326,9 +326,9 @@ build-ui/lib/libmod_utils$(SO_EXT): src/mod-ui/utils/libmod_utils$(SO_EXT) build # --------------------------------------------------------------------------------------------------------------------- -build/mod-desktop-app.app/Contents/Info.plist: utils/macos/Info.plist +build/mod-desktop-app.app/Contents/Info.plist: utils/macos/app.plist.in @mkdir -p build/mod-desktop-app.app/Contents - ln -sf $(abspath $<) $@ + sed -e "s/@version@/$(VERSION)/" $< > $@ build/mod-desktop-app.app/Contents/Frameworks/Qt%.framework: $(PAWPAW_PREFIX)/lib/Qt%.framework @mkdir -p build/mod-desktop-app.app/Contents/Frameworks diff --git a/utils/macos/Info.plist b/utils/macos/app.plist.in similarity index 94% rename from utils/macos/Info.plist rename to utils/macos/app.plist.in index e24e073..aaddb37 100644 --- a/utils/macos/Info.plist +++ b/utils/macos/app.plist.in @@ -12,6 +12,8 @@ mod-logo.icns CFBundleIdentifier audio.mod.desktop-app + CFBundleShortVersionString + @version@ NSHighResolutionCapable NSRequiresAquaSystemAppearance diff --git a/utils/macos/build.plist b/utils/macos/build.plist new file mode 100644 index 0000000..3e0ae57 --- /dev/null +++ b/utils/macos/build.plist @@ -0,0 +1,18 @@ + + + + + + BundleHasStrictIdentifier + + BundleIsRelocatable + + BundleIsVersionChecked + + BundleOverwriteAction + upgrade + RootRelativeBundlePath + MOD Desktop App.app + + + diff --git a/utils/macos/macos-dmg.sh b/utils/macos/macos-pkg.sh similarity index 65% rename from utils/macos/macos-dmg.sh rename to utils/macos/macos-pkg.sh index 4cebd45..8e3e1c8 100755 --- a/utils/macos/macos-dmg.sh +++ b/utils/macos/macos-pkg.sh @@ -13,25 +13,25 @@ else PAWPAW_PREFIX="${HOME}/PawPawBuilds/targets/macos-universal-10.15" fi -QTLIBS=("Core" "Gui" "OpenGL" "PrintSupport" "Svg" "Widgets") - +rm -rf build/pkg build/*.pkg rm -rf mod-ui/mod/__pycache__ rm -rf mod-ui/mod/communication/__pycache__ rm -rf mod-ui/modtools/__pycache__ -rm -rf build/dmg -mkdir build/dmg +# create pkg dir for placing patched app bundle inside +mkdir build/pkg +gcp -rL "build/mod-desktop-app.app" "build/pkg/MOD Desktop App.app" -gcp -rL "build/mod-desktop-app.app" "build/dmg/MOD Desktop App.app" -gcp utils/macos/macos-readme.txt build/dmg/README.txt - -pushd "build/dmg/MOD Desktop App.app/Contents" +# patch rpath for Qt libs and jack tools +pushd "build/pkg/MOD Desktop App.app/Contents" rm -rf Frameworks/*/*.prl rm -rf Frameworks/*/Headers rm -rf Frameworks/*/Versions rm -rf MacOS/data +QTLIBS=("Core" "Gui" "OpenGL" "PrintSupport" "Svg" "Widgets") + for f in $(ls Frameworks/*/Qt* PlugIns/*/libq*.dylib); do for q in "${QTLIBS[@]}"; do install_name_tool -change "@rpath/Qt${q}.framework/Versions/5/Qt${q}" "@executable_path/../Frameworks/Qt${q}.framework/Qt${q}" "${f}" @@ -50,5 +50,24 @@ done popd -hdiutil create "mod-desktop-app-$(cat VERSION)-macOS.dmg" -srcfolder build/dmg -volname "MOD Desktop App" -fs HFS+ -ov -rm -rf build/dmg +# create base app pkg +pkgbuild \ + --identifier "audio.mod.desktop-app" \ + --component-plist "utils/macos/build.plist" \ + --install-location "/Applications/" \ + --root "${PWD}/build/pkg/" \ + build/mod-desktop-app.pkg + +# create final pkg +sed -e "s|@builddir@|${PWD}/build|" \ + utils/macos/package.xml.in > build/package.xml + +productbuild \ + --distribution build/package.xml \ + --identifier "audio.mod.desktop-app" \ + --package-path "${PWD}/build" \ + --version 0 \ + mod-desktop-app-$(cat VERSION)-macOS.pkg + +# cleanup +rm -rf build/pkg diff --git a/utils/macos/macos-readme.txt b/utils/macos/macos-readme.txt deleted file mode 100644 index 33030e9..0000000 --- a/utils/macos/macos-readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -README for MOD Desktop App for macOS - -For the moment the application bundle is not signed, and as such it will refuse to run by default. - -To allow the application to run, please right-click on it and select open. -A warning will appear saying macOS cannot verify the application, that is expected. -Right-click and select to open it a 2nd time, and this time pick the new "Open" option to allow it to run. - -Also, MOD Desktop App requires macOS 10.15 or later, it will not run on older versions. diff --git a/utils/macos/package.xml.in b/utils/macos/package.xml.in new file mode 100644 index 0000000..3aa3a1e --- /dev/null +++ b/utils/macos/package.xml.in @@ -0,0 +1,15 @@ + + + MOD Desktop App + + + + + + + mod-desktop-app.pkg + + + + + diff --git a/utils/macos/welcome.txt b/utils/macos/welcome.txt new file mode 100644 index 0000000..e3e5ac3 --- /dev/null +++ b/utils/macos/welcome.txt @@ -0,0 +1,11 @@ +MOD Audio is on the desktop! + +This is an installer for the MOD Desktop App for macOS. +After installation a "MOD Desktop App" will be available on your applications folder. + +NOTE: At this point this tool should be considered in beta state. +Most things already work but we are still tweaking and fixing a lot. +Feedback and testing is very much appreciated, make sure to report issues you find during your own testing. + +Discussion page: https://forum.mod.audio/t/introducing-the-mod-app-for-desktops-beta-release/10495 +Project page: https://github.com/moddevices/mod-desktop-app