From cd5fe63b1182ff4c2bbcaeb642797dd12c94a153 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 12 Mar 2022 20:35:12 +0000 Subject: [PATCH] More CI tweaks, add windows installer Signed-off-by: falkTX --- .github/workflows/build.yml | 12 ++++++-- .gitignore | 1 + utils/create-macos-installer.sh | 2 +- utils/create-windows-installer.sh | 49 +++++++++++++++++++++++++++++++ utils/inno/win64.iss | 40 +++++++++++++++++++++++++ 5 files changed, 101 insertions(+), 3 deletions(-) create mode 100755 utils/create-windows-installer.sh create mode 100644 utils/inno/win64.iss diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ee92b7..2b84bd9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -348,7 +348,7 @@ jobs: pushd deps/PawPaw; source local.env macos-universal; popd git clone --depth=1 -b master https://github.com/juce-framework/JUCE.git jucewrapper/JUCE mkdir jucewrapper/build - pushd jucewrapper/build; cmake .. && make -j $(sysctl -n hw.logicalcpu); popd + pushd jucewrapper/build; cmake -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DCMAKE_BUILD_TYPE=Release .. && make -j $(sysctl -n hw.logicalcpu); popd mv jucewrapper/build/*_artefacts/AU/*.component bin/ - name: Build macOS universal (packaging) run: | @@ -593,7 +593,15 @@ jobs: run: | pushd deps/PawPaw; source local.env win64; popd make distclean -C carla - make -C carla EXTERNAL_PLUGINS=true HAVE_DGL=false HAVE_HYLIA=false HAVE_ZYN_DEPS=false HAVE_ZYN_UI_DEPS=false USING_JUCE=false USING_JUCE_AUDIO_DEVICES=false USING_JUCE_GUI_EXTRA=false USING_RTAUDIO=false -j $(nproc) + make -C carla EXTERNAL_PLUGINS=true HAVE_DGL=false HAVE_HYLIA=false HAVE_JACK=false HAVE_LIBLO=false HAVE_ZYN_DEPS=false HAVE_ZYN_UI_DEPS=false USING_JUCE=false USING_JUCE_AUDIO_DEVICES=false USING_JUCE_GUI_EXTRA=false USING_RTAUDIO=false all win32r -j $(nproc) + make -C carla TESTING=true _CARLA_LV2_PLUGIN_FILES= _CARLA_VST2_PLUGIN_FILES= dist + make -C carla TESTING=true _CARLA_LV2_PLUGIN_FILES= _CARLA_VST2_PLUGIN_FILES= dist + make -C carla TESTING=true _CARLA_LV2_PLUGIN_FILES= _CARLA_VST2_PLUGIN_FILES= dist + make -C carla TESTING=true _CARLA_LV2_PLUGIN_FILES= _CARLA_VST2_PLUGIN_FILES= dist + - name: Build win64 cross-compiled (packaging) + run: | + pushd deps/PawPaw; source local.env win64; popd + ./utils/create-windows-installer.sh 64 - name: Set sha8 (non-release) if: startsWith(github.ref, 'refs/tags/') != true id: slug1 diff --git a/.gitignore b/.gitignore index b9e0d68..9e15837 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ bin/ build/ documentation.pdf +utils/inno/resources.iss utils/inno/version.iss diff --git a/utils/create-macos-installer.sh b/utils/create-macos-installer.sh index 4d4c894..642c40f 100755 --- a/utils/create-macos-installer.sh +++ b/utils/create-macos-installer.sh @@ -57,7 +57,7 @@ pkgbuild \ cd .. -sed -e "s|@builddir@|${PWD}/build|" ../utils/plugin.pkg/package.xml.in > build/package.xml +sed -e "s|@builddir@|${PWD}/build|" utils/plugin.pkg/package.xml.in > build/package.xml productbuild \ --distribution build/package.xml \ diff --git a/utils/create-windows-installer.sh b/utils/create-windows-installer.sh new file mode 100755 index 0000000..ed25d63 --- /dev/null +++ b/utils/create-windows-installer.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e + +if [ ! -d bin ]; then + echo "Please run this script from the root folder" + exit +fi + +# setup innosetup +dlfile="${PWD}/bin/innosetup-6.0.5.exe" +innodir="${PWD}/build/innosetup-6.0.5" +iscc="${innodir}/drive_c/InnoSetup/ISCC.exe" + +# download it +if [ ! -f "${dlfile}" ]; then + # FIXME proper dl version + curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o "${dlfile}" +fi + +# initialize wine +if [ ! -d "${innodir}"/drive_c ]; then + env WINEPREFIX="${innodir}" wineboot -u +fi + +# install innosetup in custom wineprefix +if [ ! -f "${innodir}"/drive_c/InnoSetup/ISCC.exe ]; then + env WINEPREFIX="${innodir}" wine "${dlfile}" /allusers /dir=C:\\InnoSetup /nocancel /norestart /verysilent +fi + +# generate resources +echo -n "" > utils/inno/resources.iss +IFS=' +' +for f in $(find -L bin/Cardinal.lv2/resources/ -type f); do + d=$(dirname $(echo ${f} | sed "s|bin/Cardinal.lv2/resources/||")) + echo "Source: \"..\\..\\$(echo ${f} | tr '/' '\\')\"; DestDir: \"{commoncf64}\\Cardinal\\$(echo ${d} | tr '/' '\\')\"; Components: resources; Flags: ignoreversion;" >> utils/inno/resources.iss +done + +# generate version +echo "#define VERSION \"$(make version)\"" > utils/inno/version.iss + +# create the installer file +pushd "utils/inno" +env WINEPREFIX="${innodir}" wine "${iscc}" "win64.iss" +popd + +# move installer file where CI expects it to be +mv utils/inno/*.exe . diff --git a/utils/inno/win64.iss b/utils/inno/win64.iss new file mode 100644 index 0000000..d51c6f8 --- /dev/null +++ b/utils/inno/win64.iss @@ -0,0 +1,40 @@ +#include "version.iss" + +[Setup] +ArchitecturesInstallIn64BitMode=x64 +AppName=Cardinal +AppPublisher=DISTRHO +AppPublisherURL=https://github.com/DISTRHO/Cardinal/ +AppSupportURL=https://github.com/DISTRHO/Cardinal/issues/ +AppUpdatesURL=https://github.com/DISTRHO/Cardinal/releases/ +AppVersion={#VERSION} +DefaultDirName={commonpf64}\Cardinal +DisableDirPage=yes +DisableWelcomePage=no +LicenseFile=..\..\LICENSE +OutputBaseFilename=Cardinal-win64-{#VERSION}-installer +OutputDir=. +UsePreviousAppDir=no + +[Types] +Name: "full"; Description: "Full installation"; +Name: "custom"; Description: "Custom installation"; Flags: iscustom; + +[Components] +Name: resources; Description: "Resources"; Types: full custom; Flags: fixed; +Name: lv2; Description: "LV2 plugin"; Types: full; +Name: vst2; Description: "VST2 plugin"; Types: full; +Name: vst3; Description: "VST3 plugin"; Types: full; + +[Files] +#include "resources.iss" +; lv2 +Source: "..\..\bin\Cardinal.lv2\*.*"; DestDir: "{commoncf64}\LV2\Cardinal.lv2"; Components: lv2; Flags: ignoreversion; +Source: "..\..\bin\CardinalFX.lv2\*.*"; DestDir: "{commoncf64}\LV2\CardinalFX.lv2"; Components: lv2; Flags: ignoreversion; +Source: "..\..\bin\CardinalSynth.lv2\*.*"; DestDir: "{commoncf64}\LV2\CardinalSynth.lv2"; Components: lv2; Flags: ignoreversion; +; vst2 +Source: "..\..\bin\Cardinal.vst\*.*"; DestDir: "{commoncf64}\VST2\Cardinal.vst"; Components: vst2; Flags: ignoreversion; +; vst3 +Source: "..\..\bin\Cardinal.vst3\Contents\x86_64-win\Cardinal.vst3"; DestDir: "{commoncf64}\VST3\Cardinal.vst3\Contents\x86_64-win"; Components: vst3; Flags: ignoreversion; +Source: "..\..\bin\CardinalFX.vst3\Contents\x86_64-win\CardinalFX.vst3"; DestDir: "{commoncf64}\VST3\CardinalFX.vst3\Contents\x86_64-win"; Components: vst3; Flags: ignoreversion; +Source: "..\..\bin\CardinalSynth.vst3\Contents\x86_64-win\CardinalSynth.vst3"; DestDir: "{commoncf64}\VST3\CardinalSynth.vst3\Contents\x86_64-win"; Components: vst3; Flags: ignoreversion;