Browse Source

fix windows installer build

zplugins_osx
Alexandros Theodotou 2 years ago
parent
commit
648c39f4cf
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 2
      meson.build
  2. 5
      meson_options.txt
  3. 7
      osx-brew/make_bottle.sh.in
  4. 23
      scripts/make_osx_brew_bottle.sh.in
  5. 7
      scripts/make_windows_chroot.sh.in
  6. 191
      scripts/make_windows_installer.sh.in
  7. 17
      sources/meson.build
  8. 0
      windows-msys/copy-dll-deps.sh
  9. 46
      windows-msys/meson.build

2
meson.build

@ -146,6 +146,8 @@ global_conf.set ( @@ -146,6 +146,8 @@ global_conf.set (
'PACKAGES_DIR', get_option ('packages-dir'))
global_conf.set (
'PDF_DIR', get_option ('pdf-dir'))
global_conf.set (
'MANUALS_ZIP_FILE', get_option ('manuals-zip-file'))
subdir ('scripts')
subdir ('sources')

5
meson_options.txt

@ -116,3 +116,8 @@ option ( @@ -116,3 +116,8 @@ option (
'pdf-dir', type: 'string',
value: '/tmp/pdf',
description: 'Dir holding each manual PDF (for GNU/Linux zip)')
option (
'manuals-zip-file', type: 'string',
value: '/tmp/manuals.zip',
description: 'Zip file containing manuals (for Windows and MacOS installers)')

7
osx-brew/make_bottle.sh.in

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!@BASH@
set -ex
set -e
out_file="$1"
formula_file="$2"
@ -27,8 +27,11 @@ cp $src_tarball $formula_cache_file @@ -27,8 +27,11 @@ cp $src_tarball $formula_cache_file
# build bottle
pushd $private_dir
echo "unlinking $formula_name..."
brew unlink $formula_name || true
brew install --verbose --debug --build-bottle $formula_name
echo "installing $formula_name..."
brew install --verbose --debug --build-bottle $formula_name || true
echo "bottling $formula_name..."
brew bottle $formula_name
ls -l
popd

23
scripts/make_osx_brew_bottle.sh.in

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
#!@BASH@
set -e
out_pkg="$1"
pkgbuild=$2
zrythm_src_tarball="$3"
zrythm_src_tarball_filename="$4"
arch_pkg_filename="$5"
private_dir="$6"
rm -rf $private_dir
mkdir -p $private_dir
cp $pkgbuild $private_dir/
cp $zrythm_src_tarball $private_dir/
# build manuals
pushd $private_dir
makepkg -f
popd
cp $private_dir/*.pkg.tar.zst $out_pkg

7
scripts/make_windows_chroot.sh.in

@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
#!@BASH@
set -e
# chroot dir
chroot_dir="$1"
@ -7,6 +9,7 @@ src_tarball="$2" @@ -7,6 +9,7 @@ src_tarball="$2"
# full paths to each package (pkg.tar.zst) to install
packages="${@:3}"
packages_array=($packages)
dash_trial="@DASH_TRIAL@"
@ -19,11 +22,9 @@ pacman -S \ @@ -19,11 +22,9 @@ pacman -S \
filesystem bash pacman \
mingw-w64-x86_64-gtksourceview4 \
--noconfirm --needed --root $chroot_dir
for pkg in "$packages"; do
for pkg in "${packages_array[@]}"; do
pacman -U "$pkg" --noconfirm --needed --root $chroot_dir
done
pacman -U $zrythm_pkg_tar \
--noconfirm --needed --root $chroot_dir
cp -R /mingw64/lib/carla "$chroot_dir/mingw64/lib/"
glib-compile-schemas.exe \
"$chroot_dir/mingw64/share/glib-2.0/schemas"

191
scripts/make_windows_installer.sh.in

@ -1,40 +1,58 @@ @@ -1,40 +1,58 @@
#!@BASH@
out_file="$1"
set -ex
mingw_zrythm_pkg="$2"
zrythm_src_tarball="$3"
chroot_dir="$4"
gen_windows_installer_sh="$5"
inno_installer_iss="$6"
meson_src_root="$7"
private_dir="$"
out_file="$1"
zrythm_src_tarball="$2"
chroot_dir="$3"
inno_installer_iss="$4"
private_dir="$5"
copy_dll_deps_sh="$6"
rcedit_x64_exe="$7"
inner_dir="@ZRYTHM_INNER_DIR_NAME@"
dash_trial="@DASH_TRIAL@"
zrythm_pkg_ver="@ZRYTHM_PKG_VERSION@"
meson_src_root="@MESON_SOURCE_ROOT@"
manuals_zip="@MANUALS_ZIP_FILE@"
zrythm_inner_dir_name="@ZRYTHM_INNER_DIR_NAME@"
breeze_dark_path="@BREEZE_DARK_PATH@"
tempdir=`mktemp -d -p @PRIVATE_DIR@`
tempdir2=`mktemp -d -p @PRIVATE_DIR@`
mingw_prefix="$chroot_dir/mingw64"
app_name="Zrythm$dash_trial"
# create sources distribution
mkdir -p $tempdir/installer/dist/plugins
# add thirdparty version info
echo "TODO" > $tempdir/installer/dist/THIRDPARTY_INFO
# copy other files
tar xf $zrythm_src_tarball -C $tempdir2
zrythm_tmp_src_dir=$tempdir2/$inner_dir
installer_dir=$tempdir/installer
installer_dir=$private_dir/installer
src_dir=$installer_dir/src
dist_dir=$installer_dir/dist
cp $zrythm_tmp_src_dir/AUTHORS $dist_dir/
cp $zrythm_tmp_src_dir/COPYING* $dist_dir/
cp $zrythm_tmp_src_dir/README.md $dist_dir/README.txt
cp $zrythm_tmp_src_dir/CONTRIBUTING.md $dist_dir/
cp $zrythm_tmp_src_dir/THANKS $dist_dir/
cp $zrythm_tmp_src_dir/TRANSLATORS $dist_dir/
cp $zrythm_tmp_src_dir/CHANGELOG.md $dist_dir/
cp $zrythm_tmp_src_dir/data/windows/zrythm.ico $dist_dir/zrythm.ico
#cp $(BUILD_DIR)/$(RCEDIT64_EXE) $(BUILD_WINDOWS_MSYS_DIR)/installer/
dist_bindir=$dist_dir/bin
dist_libdir=$dist_dir/lib
dist_sharedir=$dist_dir/share
dist_etcdir=$dist_dir/etc
dist_plugins_dir=$dist_dir/plugins
install_data="install -m 644"
glib_schemas_dir_suffix=share/glib-2.0/schemas
# make the dirs
rm -rf $private_dir
mkdir -p $dist_bindir
mkdir -p $dist_libdir
mkdir -p $dist_sharedir
mkdir -p $dist_etcdir
mkdir -p $dist_plugins_dir
# create sources distribution
echo "TODO" > $dist_dir/THIRDPARTY_INFO
tar xf $zrythm_src_tarball -C $installer_dir/
mv $installer_dir/$zrythm_inner_dir_name $src_dir
cp $src_dir/AUTHORS $dist_dir/
cp $src_dir/COPYING* $dist_dir/
cp $src_dir/README.md $dist_dir/README.txt
cp $src_dir/CONTRIBUTING.md $dist_dir/
cp $src_dir/THANKS $dist_dir/
cp $src_dir/TRANSLATORS $dist_dir/
cp $src_dir/CHANGELOG.md $dist_dir/
cp $src_dir/data/windows/zrythm.ico $dist_dir/zrythm.ico
# copy plugins from the chroot dir
cp -R $chroot_dir/mingw64/lib/lv2/Z*.lv2 $dist_dir/plugins/
# remove some plugins if trial ver
@ -42,12 +60,115 @@ if [ "$dash_trial" == "-trial" ]; then \ @@ -42,12 +60,115 @@ if [ "$dash_trial" == "-trial" ]; then \
rm -rf $dist_dir/plugins/ZChordz*.lv2 ; \
rm -rf $dist_dir/plugins/ZLFO*.lv2 ; \
fi
# create installer
chmod +x $gen_windows_installer_sh
sed -i -e "s/sudo //g" $gen_windows_installer_sh
$gen_windows_installer_sh $chroot_dir/mingw64 \
$zrythm_pkg_ver $installer_dir \
$inno_installer_iss "Zrythm$dash_trial" \
plugins "@BREEZE_DARK_PATH@" \
"$meson_src_root/user-manual.zip" "$dash_trial"
mkdir -p $dist_dir/$glib_schemas_dir_suffix
glib-compile-schemas $mingw_prefix/$glib_schemas_dir_suffix
cp $mingw_prefix/$glib_schemas_dir_suffix/* $dist_dir/$glib_schemas_dir_suffix/
# ******************************
echo "Copying dlls..."
$copy_dll_deps_sh \
--infile "$mingw_prefix/bin/zrythm$dash_trial.exe" \
--destdir $dist_bindir/ \
--recursivesrcdir "$mingw_prefix/bin" \
--srcdir "$mingw_prefix/bin" \
--objdump "/mingw64/bin/objdump.exe" \
--copy
# some dlls need to be copied manually
cp $mingw_prefix/bin/librsvg-2-2.dll $dist_bindir/
cp $mingw_prefix/lib/carla/*.dll $dist_bindir/
# for an unknown reason it doesn't work unless it
# is named CarlaNativePlugin.dll
mv $dist_bindir/libcarla_native-plugin.dll \
$dist_bindir/CarlaNativePlugin.dll
# ******************************
# ******************************
if [ "$dash_trial" != "-trial" ]; then
echo "packaging user manuals" ;
unzip -o $manuals_zip -d $dist_dir/ ;
fi
# ******************************
# ******************************
cp -R $mingw_prefix/etc/fonts $dist_etcdir
# ******************************
# ******************************
echo "packaging breeze icons"
mkdir -p "$dist_sharedir/icons"
# the icons are preinstalled here
cp -R "$breeze_dark_path" "$dist_sharedir/icons"/breeze-dark
echo "packaging existing hicolor icons"
cp -R "$mingw_prefix/share/icons/hicolor" "$dist_sharedir/icons/"
# ******************************
# ******************************
echo "packaging gtksourceview files"
cp -R $mingw_prefix/share/gtksourceview-4 $dist_sharedir/
# ******************************
# ******************************
echo "packaging locales"
cp -R $mingw_prefix/share/locale $dist_sharedir/
# ******************************
# ******************************
echo "packaging other assets"
cp -R $mingw_prefix/share/zrythm $dist_sharedir/
# ******************************
# ******************************
echo "packaging fonts"
cp -R $mingw_prefix/share/fonts $dist_sharedir/
# ******************************
# ******************************
echo "packaging gdk pixbuf loaders"
pixbuf_dir="lib/gdk-pixbuf-2.0/2.10.0"
mkdir -p "$dist_dir/$pixbuf_dir/loaders"
cp "$mingw_prefix/$pixbuf_dir/loaders/"*.dll \
"$dist_dir/$pixbuf_dir/loaders/"
gdk_pixbuf_module_dir="$mingw_prefix/$pixbuf_dir/loaders" \
$mingw_prefix/bin/gdk-pixbuf-query-loaders.exe \
$mingw_prefix/$pixbuf_dir/loaders/libpixbufloader-svg.dll \
$mingw_prefix/$pixbuf_dir/loaders/libpixbufloader-jpeg.dll \
$mingw_prefix/$pixbuf_dir/loaders/libpixbufloader-gif.dll \
$mingw_prefix/$pixbuf_dir/loaders/libpixbufloader-bmp.dll \
$mingw_prefix/$pixbuf_dir/loaders/libpixbufloader-tiff.dll \
$mingw_prefix/$pixbuf_dir/loaders/libpixbufloader-png.dll > \
"$dist_dir/$pixbuf_dir/loaders.cache"
sed -i -e 's|.*loaders/|"lib\\\\gdk-pixbuf-2.0\\\\2.10.0\\\\loaders\\\\|g' \
"$dist_dir/$pixbuf_dir/loaders.cache"
# ******************************
# ******************************
echo "packaging binaries"
cp "$mingw_prefix/bin/zrythm$dash_trial.exe" "$dist_bindir/zrythm.exe"
cp $mingw_prefix/bin/carla*.exe "$dist_bindir/"
if [ -f "$mingw_prefix/bin/gdbus.exe" ]; then
cp "$mingw_prefix/bin/gdbus.exe" "$dist_bindir/"
fi
$rcedit_x64_exe "$dist_bindir/zrythm.exe" --set-icon "$dist_dir/zrythm.ico"
cp "$mingw_prefix/bin/gspawn-win64-helper.exe" "$dist_bindir/"
cp "$mingw_prefix/bin/gspawn-win64-helper-console.exe" "$dist_bindir/"
# ******************************
cp "$inno_installer_iss" "$dist_dir"/installer.iss
pushd $dist_dir
~/.wine/drive_c/Program\ Files\ \(x86\)/Inno\ Setup\ 6/ISCC.exe \
"//DAppName=$app_name" "//DAppVersion=$zrythm_pkg_ver" \
"//DAppInfoVersion=${zrythm_pkg_ver:0:7}" \
"//DPluginsDir=plugins" \
installer.iss
popd
cp "$dist_dir/Output/Zrythm$dash_trial $zrythm_pkg_ver.exe" $out_file

17
sources/meson.build

@ -33,9 +33,9 @@ zrythm_src_tarball = custom_target ( @@ -33,9 +33,9 @@ zrythm_src_tarball = custom_target (
'tar xf @INPUT@ && ' +
'mv ' + orig_inner_dir_name + ' ' +
zrythm_inner_dir_name + ' && ' +
'tar czf ' +
'tar czf \'' +
meson.current_build_dir () / zrythm_src_tarball_filename +
' ' + zrythm_inner_dir_name,
'\' ' + zrythm_inner_dir_name,
],
install: false,
)
@ -94,3 +94,16 @@ lsp_dsp_lib_src_tarball = custom_target ( @@ -94,3 +94,16 @@ lsp_dsp_lib_src_tarball = custom_target (
],
install: false,
)
filename = 'rcedit-x64.exe'
url = 'https://github.com/electron/rcedit/releases/download/v1.1.1/' + filename
rcedit_x64_exe = custom_target (
'rcedit-x64-exe',
output: filename,
command: [
bash, '-c',
'wget ' + url + ' -O \'@OUTPUT@\' && ' +
'chmod +x \'@OUTPUT@\''
],
install: false,
)

0
tools/copy-dll-deps.sh → windows-msys/copy-dll-deps.sh

46
windows-msys/meson.build

@ -168,8 +168,7 @@ mingw_zrythm_pkg = custom_target ( @@ -168,8 +168,7 @@ mingw_zrythm_pkg = custom_target (
mingw_install_carla_bins_target, lilv_pkg,
independent_deps,
],
install: true,
install_dir: get_option ('prefix'),
install: false,
)
chroot_dir = '/tmp/zrythm' + dash_trial + '-chroot'
@ -180,30 +179,49 @@ windows_chroot_target = custom_target ( @@ -180,30 +179,49 @@ windows_chroot_target = custom_target (
zrythm_src_tarball, independent_deps[0],
independent_deps[1], lv2_pkg, serd_pkg, sord_pkg,
sratom_pkg, lilv_pkg, mingw_zrythm_pkg,
make_windows_chroot,
],
command: [
bash, '-c', make_windows_chroot, chroot_dir,
'@INPUT0@', '@INPUT1@', '@INPUT2@',
'@INPUT3@', '@INPUT4@', '@INPUT5@', '@INPUT6@',
'@INPUT7@', '@INPUT8@',
bash, '-c',
meson.build_root () / 'scripts/make_windows_chroot.sh ' +
chroot_dir + ' ' +
zrythm_src_tarball.full_path () + ' ' +
independent_deps[0].full_path () + ' ' +
independent_deps[1].full_path () + ' ' +
lv2_pkg.full_path () + ' ' +
serd_pkg.full_path () + ' ' +
sord_pkg.full_path () + ' ' +
sratom_pkg.full_path () + ' ' +
lilv_pkg.full_path () + ' ' +
mingw_zrythm_pkg.full_path () +
' && touch @OUTPUT@'
],
depends: [
],
install: false,
)
if false
windows_msys_installer_filename = run_command (
get_pkg_filename, 'WINDOWS_MSYS', dash_trial).stdout ().strip ()
bash, '-c',
meson.build_root () / 'scripts/get_pkg_filename.sh' +
' WINDOWS_MSYS ' + dash_trial).stdout ().strip ()
windows_msys_installer = custom_target (
'windows-msys-installer',
output: windows_msys_installer_filename,
input: [
bash, '-c', mingw_zrythm_pkg, zrythm_src_tarball,
make_windows_installer, zrythm_src_tarball,
'installer.iss', 'copy-dll-deps.sh',
rcedit_x64_exe,
],
command: [
make_windows_installer, '@OUTPUT@', '@INPUT0@',
chroot_dir,
bash, '-c',
meson.build_root () / 'scripts/make_windows_installer.sh' +
' @OUTPUT@ ' + zrythm_src_tarball.full_path () + ' ' +
chroot_dir + ' ' +
meson.current_source_dir () / 'installer.iss' +
' @PRIVATE_DIR@ ' +
meson.current_source_dir () / 'copy-dll-deps.sh' + ' ' +
rcedit_x64_exe.full_path ()
],
depends: [
windows_chroot_target,
@ -211,9 +229,3 @@ windows_msys_installer = custom_target ( @@ -211,9 +229,3 @@ windows_msys_installer = custom_target (
install: true,
install_dir: get_option ('prefix'),
)
endif
run_target (
'windows-msys',
command: [ 'echo', 'done' ],
depends: windows_chroot_target)

Loading…
Cancel
Save