-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller_macos.sh
More file actions
executable file
·52 lines (40 loc) · 1.58 KB
/
installer_macos.sh
File metadata and controls
executable file
·52 lines (40 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
PROJECT_NAME="TrebleMaker"
IDENTIFIER="com.leocodes.treblemaker"
if [ -z "$PROJECT_VERSION" ]; then
VERSION=$(grep "project(TrebleMaker VERSION" CMakeLists.txt | sed 's/.*VERSION \([0-9.]*\).*/\1/')
else
VERSION="$PROJECT_VERSION"
fi
if [ -z "$VERSION" ]; then
echo "Error: Could not determine version from environment or CMakeLists.txt"
exit 1
fi
VST3_SOURCE="Builds/CMake/TrebleMaker_artefacts/VST3/${PROJECT_NAME}.vst3"
AU_SOURCE="Builds/CMake/TrebleMaker_artefacts/AU/${PROJECT_NAME}.component"
CLAP_SOURCE="Builds/CMake/TrebleMaker_artefacts/CLAP/${PROJECT_NAME}.clap"
mkdir -p staging/Library/Audio/Plug-Ins/VST3
mkdir -p staging/Library/Audio/Plug-Ins/Components
mkdir -p staging/Library/Audio/Plug-Ins/CLAP
echo "Copying plugins to staging..."
cp -R "$VST3_SOURCE" "staging/Library/Audio/Plug-Ins/VST3/"
cp -R "$AU_SOURCE" "staging/Library/Audio/Plug-Ins/Components/"
cp -R "$CLAP_SOURCE" "staging/Library/Audio/Plug-Ins/CLAP/"
echo "Building component package..."
pkgbuild --root staging \
--identifier "$IDENTIFIER" \
--version "$VERSION" \
--install-location "/" \
"${PROJECT_NAME}_Component.pkg"
echo "Synthesizing distribution..."
productbuild --synthesize \
--package "${PROJECT_NAME}_Component.pkg" \
distribution.xml
echo "Building final installer..."
productbuild --distribution distribution.xml \
--package-path . \
"${PROJECT_NAME}_Installer.pkg"
rm -rf staging
rm "${PROJECT_NAME}_Component.pkg"
rm distribution.xml
echo "Done! ${PROJECT_NAME}_Installer.pkg is ready."