From 59dd08722cbc912d1c23e80a783be3b6c036c437 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 25 Jul 2020 08:03:30 +0100 Subject: [PATCH] Initial script to pack plugins for distribution --- .gitignore | 2 +- pack-plugins.sh | 88 ++++++++++++++++++++++++++++++++++++++++++ setup/inno/plugins.iss | 19 +++++++++ 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100755 pack-plugins.sh create mode 100644 setup/inno/plugins.iss diff --git a/.gitignore b/.gitignore index f06cf8d..b6f7eb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ +*.exe /jack2/ - diff --git a/pack-plugins.sh b/pack-plugins.sh new file mode 100755 index 0000000..c588612 --- /dev/null +++ b/pack-plugins.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +set -e + +cd $(dirname ${0}) +PAWPAW_ROOT="${PWD}" + +# --------------------------------------------------------------------------------------------------------------------- + +target="${1}" + +if [ -z "${target}" ]; then + echo "usage: ${0} ..." + exit 1 +fi + +shift + +# --------------------------------------------------------------------------------------------------------------------- + +source setup/check_target.sh +source setup/env.sh + +# --------------------------------------------------------------------------------------------------------------------- + +function download_and_install_innosetup { + local dlfile="${PAWPAW_DOWNLOADDIR}/innosetup-6.0.5.exe" + local pkgdir="${PAWPAW_BUILDDIR}/innosetup-6.0.5" + + if [ ! -f "${dlfile}" ]; then + # FIXME proper dl version + curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o "${dlfile}" + fi + + if [ ! -f "${pkgdir}"/drive_c/InnoSeup/ISCC.exe ]; then + env WINEARCH="${PAWPAW_TARGET}" WINEPREFIX="${pkgdir}" wine "${dlfile}" /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent + fi +} + +function create_innosetup_exe { + local pkgdir="${PAWPAW_BUILDDIR}/innosetup-6.0.5" + local iscc="${pkgdir}/drive_c/InnoSeup/ISCC.exe" + + env WINEARCH="${PAWPAW_TARGET}" WINEPREFIX="${pkgdir}" wine "${iscc}" setup/inno/plugins.iss +} + +# --------------------------------------------------------------------------------------------------------------------- + +if [ "${WIN32}" -eq 1 ]; then + download_and_install_innosetup + rm -rf /tmp/pawpaw + mkdir /tmp/pawpaw + touch /tmp/pawpaw/components.txt + touch /tmp/pawpaw/lv2bundles.txt + PAWPAW_WINE_LV2DIR="Z:$(echo ${PAWPAW_PREFIX} | tr -t '/' '\\')\\lib\\lv2\\" +fi + +# --------------------------------------------------------------------------------------------------------------------- + +for plugin in ${@}; do + pfile="${PAWPAW_ROOT}/plugins/${plugin}.json" + + if [ ! -e "${pfile}" ]; then + echo "Requested plugin file '${pfile}' does not exist" + exit 2 + fi + + name=$(jq -crM .name ${pfile}) + sname=$(echo ${name} | tr -t '-' '_') + lv2bundles=($(jq -crM .lv2bundles[] ${pfile})) + + if [ "${WIN32}" -eq 1 ]; then + echo "Name: ${sname}; Description: \"${name}\"; Types: full;" >> /tmp/pawpaw/components.txt + fi + + for lv2bundle in ${lv2bundles[@]}; do + if [ "${WIN32}" -eq 1 ]; then + echo "Source: \"${PAWPAW_WINE_LV2DIR}${lv2bundle}\\*\"; DestDir: \"{commoncf}\\LV2\\${lv2bundle}\"; Components: ${sname}; Flags: recursesubdirs" >> /tmp/pawpaw/lv2bundles.txt + fi + done +done + +if [ "${WIN32}" -eq 1 ]; then + create_innosetup_exe + rm -rf /tmp/pawpaw +fi + +# --------------------------------------------------------------------------------------------------------------------- diff --git a/setup/inno/plugins.iss b/setup/inno/plugins.iss new file mode 100644 index 0000000..936209f --- /dev/null +++ b/setup/inno/plugins.iss @@ -0,0 +1,19 @@ +[Setup] +ArchitecturesInstallIn64BitMode=x64 +AppName=PawPaw +AppVersion=0.0.0 +DefaultDirName={autopf}\PawPaw +DisableDirPage=yes +OutputBaseFilename=PawPaw-0.0.0 +OutputDir=. +UsePreviousAppDir=no + +[Types] +Name: "full"; Description: "Full installation" +Name: "custom"; Description: "Custom installation"; Flags: iscustom + +[Components] +#include "Z:\tmp\pawpaw\components.txt" + +[Files] +#include "Z:\tmp\pawpaw\lv2bundles.txt"