Skip to content

Commit

Permalink
replace dmg with an installer
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Jan 21, 2024
1 parent f322673 commit 72e5cb6
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -251,7 +251,7 @@ jobs:
draft: false
prerelease: false
files: |
*.dmg
*.pkg
win64:
strategy:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.dmg
*.exe
*.o
*.pkg
*.tar.gz
*.zip
qrc_*.hpp
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions utils/macos/Info.plist → utils/macos/app.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<string>mod-logo.icns</string>
<key>CFBundleIdentifier</key>
<string>audio.mod.desktop-app</string>
<key>CFBundleShortVersionString</key>
<string>@version@</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
Expand Down
18 changes: 18 additions & 0 deletions utils/macos/build.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>BundleHasStrictIdentifier</key>
<true/>
<key>BundleIsRelocatable</key>
<false/>
<key>BundleIsVersionChecked</key>
<false/>
<key>BundleOverwriteAction</key>
<string>upgrade</string>
<key>RootRelativeBundlePath</key>
<string>MOD Desktop App.app</string>
</dict>
</array>
</plist>
39 changes: 29 additions & 10 deletions utils/macos/macos-dmg.sh → utils/macos/macos-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
9 changes: 0 additions & 9 deletions utils/macos/macos-readme.txt

This file was deleted.

15 changes: 15 additions & 0 deletions utils/macos/package.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
<title>MOD Desktop App</title>
<domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true" />
<license file="@builddir@/../LICENSE" mime-type="text/plain" />
<options customize="always" hostArchitectures="arm64,x86_64" require-scripts="false" rootVolumeOnly="true" />
<pkg-ref id="audio.mod.desktop-app" />
<welcome file="@builddir@/../utils/macos/welcome.txt" mime-type="text/plain" />
<choice id="audio.mod.desktop-app-pkg" title="MOD Desktop App" description='MOD Desktop App macOS bundle' visible="true" enabled="false" selected="true">
<pkg-ref id="audio.mod.desktop-app-pkg" version="0">mod-desktop-app.pkg</pkg-ref>
</choice>
<choices-outline>
<line choice="audio.mod.desktop-app-pkg"/>
</choices-outline>
</installer-gui-script>
11 changes: 11 additions & 0 deletions utils/macos/welcome.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 72e5cb6

Please sign in to comment.