diff --git a/osx-brew/make_pkg.sh.in b/osx-brew/make_pkg.sh.in new file mode 100755 index 0000000..de5d0d7 --- /dev/null +++ b/osx-brew/make_pkg.sh.in @@ -0,0 +1,55 @@ +#!@BASH@ + +set -ex + +out_file="$1" +zrythm_formula_file=$2 +carla_bottle_file=$3 +installer_sh_file=$4 +readme_file=$5 +private_dir=$6 +installer_builder_dir="$7" +welcome_html="$8" +postinstall_script="$9" + +dash_trial="@DASH_TRIAL@" +manuals_zip="@MANUALS_ZIP_FILE@" +breeze_dark="@BREEZE_DARK@" +zrythm_pkg_ver="@ZRYTHM_PKG_VERSION@" +zrythm_bottle_name="zrythm$dash_trial" +carla_bottle_ver="@CARLA_BOTTLE_VER@" + +inner_dir_name="${out_file%.*}" +inner_dir_name="`basename $inner_dir_name`" +inner_dir=$private_dir/$inner_dir_name + +rm -rf $private_dir +mkdir -p $inner_dir + +# copy the template +cp -rfv $installer_builder_dir/* $inner_dir/ + +# copy the content of each formula (already installed) +cp -rfv /usr/local/Cellar/carla-git/$carla_bottle_ver/* \ + $inner_dir/macOS-x64/application/ +cp -rfv /usr/local/Cellar/$zrythm_bottle_name/$zrythm_pkg_ver/* \ + $inner_dir/macOS-x64/application/ + +# copy resources +cp $welcome_html $inner_dir/macOS-x64/darwin/Resources/ +cp $postinstall_script $inner_dir/macOS-x64/darwin/scripts/ + +#cp $readme_file $inner_dir/README +#cp -r "$breeze_dark" $inner_dir/icons/ + +#if [ "$dash_trial" != "-trial" ]; then + #echo "adding user manuals" ; + #unzip -o $manuals_zip -d $inner_dir/ ; +#fi + +# run command to build installer +pushd $inner_dir/macOS-x64 +./build-macos-x64.sh Zrythm $zrythm_pkg_ver +popd + +cp $inner_dir/macOS-x64/target/pkg/Zrythm-macos-installer-x64-$zrythm_pkg_ver.pkg $out_file diff --git a/osx-brew/meson.build b/osx-brew/meson.build index dd95d82..4dc6f00 100644 --- a/osx-brew/meson.build +++ b/osx-brew/meson.build @@ -17,7 +17,7 @@ osx_brew_conf = configuration_data () osx_brew_conf.merge_from (global_conf) -carla_bottle_ver = '0.1.3' +carla_bottle_ver = '0.2.1' carla_bottle_filename = 'carla-git--' + carla_bottle_ver + '.catalina.bottle.tar.gz' zrythm_bottle_filename = 'zrythm' + dash_trial + '--' + zrythm_pkg_ver + '.catalina.bottle.tar.gz' osx_brew_conf.set ( @@ -43,8 +43,11 @@ zrythm_brew_src_sum = run_command ( osx_brew_conf.set ( 'ZRYTHM_BREW_SHA256', zrythm_brew_src_sum) installer_zip_filename = 'zrythm' + dash_trial + '-' + zrythm_pkg_ver + '-osx-installer.zip' +installer_pkg_filename = 'zrythm' + dash_trial + '-' + zrythm_pkg_ver + '-osx-installer.pkg' osx_brew_conf.set ( 'OSX_INSTALLER_ZIP_FILENAME', installer_zip_filename) +osx_brew_conf.set ( + 'OSX_INSTALLER_PKG_FILENAME', installer_pkg_filename) osx_brew_conf.set ( 'BREEZE_DARK', breeze_icons.full_path ()) osx_brew_conf.set ( @@ -62,6 +65,11 @@ make_zip_sh = configure_file ( input: 'make_zip.sh.in', configuration: osx_brew_conf, ) +make_pkg_sh = configure_file ( + output: 'make_pkg.sh', + input: 'make_pkg.sh.in', + configuration: osx_brew_conf, + ) # configure installer script and README installer_sh = configure_file ( @@ -74,6 +82,16 @@ readme = configure_file ( input: 'README-osx.in', configuration: osx_brew_conf, ) +welcome_html = configure_file ( + output: 'welcome.html', + input: 'welcome.html.in', + configuration: osx_brew_conf, + ) +postinstall_script = configure_file ( + output: 'postinstall', + input: 'postinstall.in', + configuration: osx_brew_conf, + ) # prepare formulas carla_formula = configure_file ( @@ -119,6 +137,7 @@ zrythm_bottle = custom_target ( install: false, ) +# previous zip-based installer installer_zip = custom_target ( 'osx-installer-zip', output: installer_zip_filename, @@ -137,6 +156,27 @@ installer_zip = custom_target ( install_dir: get_option ('prefix'), ) +# .pkg installer +installer_pkg = custom_target ( + 'osx-installer-pkg', + output: installer_pkg_filename, + input: [ + make_pkg_sh, zrythm_formula, + carla_bottle, installer_sh, + readme, zrythm_bottle, + ], + command: [ + make_pkg_sh, '@OUTPUT@', + '@INPUT1@', '@INPUT2@', '@INPUT3@', '@INPUT4@', + '@PRIVATE_DIR@', + meson.source_root() / 'ext/macos-installer-builder', + welcome_html, postinstall_script, + ], + console: true, + install: true, + install_dir: get_option ('prefix'), + ) + run_target ( 'osx-brew-prepare', command: [ 'echo', 'done' ], @@ -147,4 +187,4 @@ run_target ( run_target ( 'osx-brew', command: [ 'echo', 'done' ], - depends: installer_zip) + depends: installer_pkg) diff --git a/osx-brew/postinstall.in b/osx-brew/postinstall.in new file mode 100755 index 0000000..9d853b0 --- /dev/null +++ b/osx-brew/postinstall.in @@ -0,0 +1,22 @@ +#!/bin/bash + +echo "Post installation process finished" + +#Custermize this for your application +#APPLICATION_FILE_PATH=bin/zrythm + +#Parameters +#PRODUCT_HOME=/Library/__PRODUCT__/__VERSION__ + +#echo "Post installation process started" + +#Change permissions in home directory +#echo "Change permissions in product home" +#cd ${PRODUCT_HOME} +#chmod -R 755 . +#[ -d /usr/local/bin ] || mkdir /usr/local/bin + +#Add application shortcut to /usr/local/bin +#rm -f /usr/local/bin/__PRODUCT__-__VERSION__ +#ln -s ${PRODUCT_HOME}/${APPLICATION_FILE_PATH} /usr/local/bin/__PRODUCT__-__VERSION__ +#echo "Post installation process finished" diff --git a/osx-brew/welcome.html.in b/osx-brew/welcome.html.in new file mode 100644 index 0000000..50f28dd --- /dev/null +++ b/osx-brew/welcome.html.in @@ -0,0 +1,14 @@ + + + + + + +
+
+

This will install Zrythm@DASH_TRIAL@ @ZRYTHM_PKG_VERSION@ on your computer. You will be guided through the steps necessary to install this software.

+
+

Click “Continue" to continue the setup

+
+ +