|
|
|
@ -5,10 +5,10 @@ set -ex
@@ -5,10 +5,10 @@ set -ex
|
|
|
|
|
out_dir="$1" |
|
|
|
|
zrythm_src_tarball="$2" |
|
|
|
|
chroot_dir="$3" |
|
|
|
|
inno_installer_iss="$4" |
|
|
|
|
private_dir="$5" |
|
|
|
|
copy_dll_deps_sh="$6" |
|
|
|
|
rcedit_x64_exe="$7" |
|
|
|
|
private_dir="$4" |
|
|
|
|
copy_dll_deps_sh="$5" |
|
|
|
|
rcedit_x64_exe="$6" |
|
|
|
|
dll_dir="$7" |
|
|
|
|
|
|
|
|
|
inner_dir="@ZRYTHM_INNER_DIR_NAME@" |
|
|
|
|
dash_trial="@DASH_TRIAL@" |
|
|
|
@ -33,160 +33,134 @@ dist_plugins_dir=$dist_dir/plugins
@@ -33,160 +33,134 @@ 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 |
|
|
|
|
|
|
|
|
|
rm -rf $out_dir |
|
|
|
|
|
|
|
|
|
verify_bin_file () { |
|
|
|
|
bin_file="$1" |
|
|
|
|
ok_text="$2" |
|
|
|
|
echo "verifying zrythm binary $bin_file..." |
|
|
|
|
temp_file=`mktemp` |
|
|
|
|
$bin_file --version > $temp_file 2>&1 || true |
|
|
|
|
output="`cat $temp_file`" |
|
|
|
|
echo "$output" |
|
|
|
|
if [[ "$output" = *"$ok_text"* ]]; then |
|
|
|
|
echo "ok" |
|
|
|
|
else |
|
|
|
|
echo "fail" |
|
|
|
|
rm "$temp_file" |
|
|
|
|
exit 1 |
|
|
|
|
main () { |
|
|
|
|
# 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 |
|
|
|
|
|
|
|
|
|
rm -rf $out_dir |
|
|
|
|
|
|
|
|
|
# create sources distribution |
|
|
|
|
echo "TODO" > $dist_dir/THIRDPARTY_INFO |
|
|
|
|
cp $zrythm_src_tarball $installer_dir/ |
|
|
|
|
pushd $installer_dir |
|
|
|
|
tar xf $zrythm_src_tarball_filename |
|
|
|
|
rm $zrythm_src_tarball_filename |
|
|
|
|
popd |
|
|
|
|
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 |
|
|
|
|
if [ "$dash_trial" == "-trial" ]; then \ |
|
|
|
|
rm -rf $dist_dir/plugins/ZChordz*.lv2 ; \ |
|
|
|
|
rm -rf $dist_dir/plugins/ZLFO*.lv2 ; \ |
|
|
|
|
fi |
|
|
|
|
rm "$temp_file" |
|
|
|
|
exit 0 |
|
|
|
|
|
|
|
|
|
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..." |
|
|
|
|
|
|
|
|
|
cp -R "$dll_dir"/* "$dist_bindir"/ |
|
|
|
|
|
|
|
|
|
# ****************************** |
|
|
|
|
|
|
|
|
|
# ****************************** |
|
|
|
|
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" |
|
|
|
|
orig_zrythm_exe="$mingw_prefix/bin/zrythm$dash_trial.exe" |
|
|
|
|
zrythm_exe="$dist_bindir/zrythm.exe" |
|
|
|
|
"$orig_zrythm_exe" --version |
|
|
|
|
cp "$orig_zrythm_exe" "$zrythm_exe" |
|
|
|
|
"$zrythm_exe" --version |
|
|
|
|
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 "$zrythm_exe" --set-icon "$dist_dir/zrythm.ico" |
|
|
|
|
"$zrythm_exe" --version |
|
|
|
|
cp "$mingw_prefix/bin/gspawn-win64-helper.exe" "$dist_bindir/" |
|
|
|
|
cp "$mingw_prefix/bin/gspawn-win64-helper-console.exe" "$dist_bindir/" |
|
|
|
|
|
|
|
|
|
# ****************************** |
|
|
|
|
|
|
|
|
|
mv "$dist_dir" "$out_dir" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# create sources distribution |
|
|
|
|
echo "TODO" > $dist_dir/THIRDPARTY_INFO |
|
|
|
|
cp $zrythm_src_tarball $installer_dir/ |
|
|
|
|
pushd $installer_dir |
|
|
|
|
tar xf $zrythm_src_tarball_filename |
|
|
|
|
rm $zrythm_src_tarball_filename |
|
|
|
|
popd |
|
|
|
|
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 |
|
|
|
|
if [ "$dash_trial" == "-trial" ]; then \ |
|
|
|
|
rm -rf $dist_dir/plugins/ZChordz*.lv2 ; \ |
|
|
|
|
rm -rf $dist_dir/plugins/ZLFO*.lv2 ; \ |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
# verify installation |
|
|
|
|
(verify_bin_file "$dist_bindir/zrythm.exe" "built with ") |
|
|
|
|
|
|
|
|
|
# ****************************** |
|
|
|
|
|
|
|
|
|
# ****************************** |
|
|
|
|
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/" |
|
|
|
|
|
|
|
|
|
mv "$dist_dir" "$out_dir" |
|
|
|
|
main 1>&2 |
|
|
|
|