15 changed files with 214 additions and 233 deletions
@ -0,0 +1,79 @@
@@ -0,0 +1,79 @@
|
||||
#! /bin/bash |
||||
|
||||
set -e |
||||
|
||||
out_file=$1 |
||||
private_dir=$2 |
||||
installer_sh=$3 |
||||
readme=$4 |
||||
|
||||
# dir holding each package |
||||
packages_dir="@PACKAGES_DIR@" |
||||
distros="archlinux debian10 debian11 ubuntu1804 ubuntu2004 ubuntu2010 fedora31 fedora32" |
||||
get_pkg_filename_from_distro_sh="@MESON_BUILD_ROOT@/scripts/get_pkg_filename_from_distro.sh" |
||||
zip_filename=`basename $out_file` |
||||
zip_inner_dir_name="${zip_filename%.*}" |
||||
zip_inner_dir="$private_dir/$zip_inner_dir_name" |
||||
zrythm_version="@ZRYTHM_PKG_VERSION@" |
||||
pdf_dir="@PDF_DIR@" |
||||
|
||||
rm -rf $out_file |
||||
rm -rf $private_dir |
||||
|
||||
mkdir -p $zip_inner_dir |
||||
|
||||
# returns the built package filename |
||||
get_package_filename () { |
||||
distro=$1 |
||||
set +u |
||||
trial=$2 |
||||
set -u |
||||
$get_pkg_filename_from_distro_sh $distro $trial |
||||
} |
||||
|
||||
# returns the filename to be placed inside "bin" |
||||
get_dest_package_filename () { |
||||
prefix="zrythm-$zrythm_version" |
||||
distro=$1 |
||||
res="" |
||||
case "$distro" in |
||||
"debian10" | "ubuntu"*) |
||||
res="$prefix-1_amd64.deb" |
||||
;; |
||||
"archlinux") |
||||
res="$prefix-1_x86_64.pkg.tar.zst" |
||||
;; |
||||
"fedora"*) |
||||
res="$prefix-1_x86_64.rpm" |
||||
esac |
||||
echo $res |
||||
} |
||||
|
||||
copy_package () { |
||||
distro=$1 |
||||
src_pkg_filename="$(get_package_filename $distro)" |
||||
dest_pkg_filename="$(get_dest_package_filename $distro)" |
||||
distro_bin_dir="$zip_inner_dir/bin/$distro" |
||||
mkdir -p "$distro_bin_dir" |
||||
cp "$packages_dir/$distro/$src_pkg_filename" \ |
||||
"$distro_bin_dir/$dest_pkg_filename" |
||||
} |
||||
|
||||
for distro in $distros ; do |
||||
echo "copying packages for $distro..." |
||||
copy_package $distro |
||||
echo "done" |
||||
done |
||||
|
||||
pdf="" |
||||
if [ "@TRIAL_TRUE_FALSE@" = "false" ]; then |
||||
pdf="$(ls $pdf_dir/Zrythm-*.pdf)" |
||||
fi |
||||
|
||||
echo "zipping installer..." |
||||
cp -R $pdf $installer_sh $readme $zip_inner_dir/ |
||||
pushd $private_dir |
||||
zip -r $zip_inner_dir_name.zip $zip_inner_dir_name |
||||
popd |
||||
cp $zip_inner_dir.zip $out_file |
||||
echo "done" |
@ -0,0 +1,59 @@
@@ -0,0 +1,59 @@
|
||||
# Copyright (C) 2020 Alexandros Theodotou <alex at zrythm dot org> |
||||
# |
||||
# This file is part of Zrythm |
||||
# |
||||
# Zrythm is free software: you can redistribute it and/or modify |
||||
# it under the terms of the GNU Affero General Public License as published by |
||||
# the Free Software Foundation, either version 3 of the License, or |
||||
# (at your option) any later version. |
||||
# |
||||
# Zrythm is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU Affero General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU Affero General Public License |
||||
# along with Zrythm. If not, see <https://www.gnu.org/licenses/>. |
||||
|
||||
gnu_linux_zip_conf = configuration_data () |
||||
gnu_linux_zip_conf.merge_from (global_conf) |
||||
|
||||
# configure scripts |
||||
make_installer_zip_sh = configure_file ( |
||||
output: 'make_installer_zip.sh', |
||||
input: 'make_installer_zip.sh.in', |
||||
configuration: gnu_linux_zip_conf, |
||||
) |
||||
|
||||
# configure installer script and README |
||||
installer_sh = configure_file ( |
||||
output: 'installer.sh', |
||||
input: 'installer.sh.in', |
||||
configuration: gnu_linux_zip_conf, |
||||
) |
||||
readme = configure_file ( |
||||
output: 'README', |
||||
input: 'README.in', |
||||
configuration: gnu_linux_zip_conf, |
||||
) |
||||
|
||||
installer_zip_filename = run_command ( |
||||
get_pkg_filename_from_distro, get_option ('distro')).stdout ().strip () |
||||
installer_zip = custom_target ( |
||||
'gnu-linux-installer-zip', |
||||
output: installer_zip_filename, |
||||
input: [ |
||||
make_zip_sh, installer_sh, readme, |
||||
], |
||||
command: [ |
||||
make_zip_sh, '@OUTPUT@', '@PRIVATE_DIR@', |
||||
'@INPUT1@', '@INPUT2@', |
||||
], |
||||
install: true, |
||||
install_dir: get_option ('prefix'), |
||||
) |
||||
|
||||
run_target ( |
||||
'gnu-linux', |
||||
command: [ 'echo', 'done' ], |
||||
depends: installer_zip) |
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
--- meson-0.54.0/mesonbuild/mesonlib.py.orig 2020-03-30 08:16:34.854854700 +0200
|
||||
+++ meson-0.54.0/mesonbuild/mesonlib.py 2020-03-30 08:16:45.815838600 +0200
|
||||
@@ -736,6 +736,8 @@
|
||||
|
||||
|
||||
def default_prefix() -> str: |
||||
+ if is_windows() and 'MSYSTEM' in os.environ:
|
||||
+ return sys.prefix
|
||||
return 'c:/' if is_windows() else '/usr/local' |
||||
|
||||
|
@ -1,33 +0,0 @@
@@ -1,33 +0,0 @@
|
||||
Strip the prefix from all paths when installing with DESTDIR |
||||
Otherwise we end up with <destdir>/<prefix>/<path> |
||||
--- meson-0.47.0/mesonbuild/scripts/__init__.py
|
||||
+++ meson-0.47.0/mesonbuild/scripts/__init__.py
|
||||
@@ -12,7 +12,18 @@
|
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
+import os
|
||||
+from ..mesonlib import is_windows
|
||||
+
|
||||
def destdir_join(d1, d2): |
||||
+ # When the installation path starts with PREFIX, strip it away
|
||||
+ if d1 and is_windows() and 'MSYSTEM' in os.environ:
|
||||
+ assert os.path.isabs(d2) and 'MESON_INSTALL_PREFIX' in os.environ
|
||||
+ prefix = os.environ['MESON_INSTALL_PREFIX']
|
||||
+ rel_to_prefix = os.path.relpath(d2, prefix)
|
||||
+ if not rel_to_prefix.startswith(os.pardir + os.sep):
|
||||
+ return os.path.join(d1, rel_to_prefix)
|
||||
+
|
||||
# c:\destdir + c:\prefix must produce c:\destdir\prefix |
||||
if len(d1) > 1 and d1[1] == ':' \ |
||||
and len(d2) > 1 and d2[1] == ':': |
||||
--- meson-0.47.0/mesonbuild/minstall.py.orig
|
||||
+++ meson-0.47.0/mesonbuild/minstall.py
|
||||
@@ -286,6 +286,7 @@
|
||||
with open(datafilename, 'rb') as ifile: |
||||
d = pickle.load(ifile) |
||||
d.destdir = os.environ.get('DESTDIR', '') |
||||
+ os.environ['MESON_INSTALL_PREFIX'] = d.prefix
|
||||
d.fullprefix = destdir_join(d.destdir, d.prefix) |
||||
|
||||
if d.install_umask is not None: |
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
--- meson-0.50.1/mesonbuild/mlog.py.orig 2019-03-06 21:48:10.000000000 +0100
|
||||
+++ meson-0.50.1/mesonbuild/mlog.py 2019-04-17 17:46:10.229092600 +0200
|
||||
@@ -31,7 +31,7 @@
|
||||
stdout = kernel.GetStdHandle(-11) |
||||
mode = DWORD() |
||||
if not kernel.GetConsoleMode(stdout, byref(mode)): |
||||
- return False
|
||||
+ return os.isatty(sys.stdout.fileno())
|
||||
# ENABLE_VIRTUAL_TERMINAL_PROCESSING == 0x4 |
||||
# If the call to enable VT processing fails (returns 0), we fallback to |
||||
# original behavior |
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
--- meson-0.48.0/setup.py.orig 2018-09-22 15:22:03.000000000 +0200
|
||||
+++ meson-0.48.0/setup.py 2018-09-23 13:48:10.509756600 +0200
|
||||
@@ -36,7 +36,7 @@
|
||||
'mesonbuild.scripts', |
||||
'mesonbuild.wrap'] |
||||
data_files = [] |
||||
-if sys.platform != 'win32':
|
||||
+if sys.platform != 'win32' or 1:
|
||||
# Only useful on UNIX-like systems |
||||
data_files = [('share/man/man1', ['man/meson.1']), |
||||
('share/polkit-1/actions', ['data/com.mesonbuild.install.policy'])] |
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
#!@BASH@ |
||||
|
||||
# distro (eg, debian10) |
||||
distro="$1" |
||||
|
||||
# "-trial" if trial |
||||
trial="$2" |
||||
|
||||
zrythm_pkg_ver="@ZRYTHM_PKG_VERSION@" |
||||
get_pkg_filename_sh="@GET_PKG_FILENAME_SH_PATH@" |
||||
|
||||
distro_to_pkg_type () { |
||||
distro=$1 |
||||
case "$distro" in |
||||
"archlinux") |
||||
echo "ARCH" |
||||
;; |
||||
"debian"* | "ubuntu"* ) |
||||
echo "DEBIAN" |
||||
;; |
||||
"fedora"*) |
||||
echo "FEDORA" |
||||
;; |
||||
"windows10") |
||||
echo "WINDOWS" |
||||
;; |
||||
"windows10-msys") |
||||
echo "WINDOWS_MSYS" |
||||
;; |
||||
"osx" | "macos"*) |
||||
echo "OSX" |
||||
;; |
||||
"osx-brew-zip") |
||||
echo "OSX_BREW_ZIP" |
||||
;; |
||||
"gnu-linux") |
||||
echo "GNU_LINUX" |
||||
;; |
||||
esac |
||||
} |
||||
pkg_type=$(distro_to_pkg_type $distro) |
||||
$get_pkg_filename_sh $pkg_type |
@ -1,132 +0,0 @@
@@ -1,132 +0,0 @@
|
||||
#! /bin/bash |
||||
|
||||
set -e |
||||
|
||||
# args: |
||||
# 1: zrythm version |
||||
# 2: installer zip filename |
||||
# 3: zplugins version |
||||
# 4: `-trial` if trial, otherwise empty |
||||
|
||||
zrythm_version=$1 |
||||
installer_zip=$2 |
||||
zplugins_version=$3 |
||||
trial=$4 |
||||
distros="archlinux debian10 debian11 ubuntu1804 ubuntu2004 ubuntu2010 fedora31 fedora32" |
||||
|
||||
rm -rf $installer_zip |
||||
|
||||
sed -i -e "s/ZRYTHM_PKG_VERSION=.*/ZRYTHM_PKG_VERSION=$zrythm_version/" Makefile |
||||
|
||||
is_trial () { |
||||
[ "$trial" = "-trial" ] |
||||
} |
||||
|
||||
copy_plugins () { |
||||
distro=$1 |
||||
src_dir=artifacts/$distro/zplugins |
||||
dest_dir=bin/$distro/zplugins |
||||
mkdir -p $dest_dir |
||||
|
||||
# copy common |
||||
for plugin in ZCompressorSP.lv2 ZLimiterSP.lv2 ZPhaserSP.lv2 ZSaw.lv2 ZVerbSP.lv2 ; do |
||||
cp -Rf $src_dir/$plugin $dest_dir/ |
||||
done |
||||
|
||||
# copy remaining if not trial |
||||
if ! is_trial ; then |
||||
for plugin in ZChordz.lv2 ZLFO.lv2 ; do |
||||
cp -Rf $src_dir/$plugin $dest_dir/ |
||||
done |
||||
fi |
||||
} |
||||
|
||||
# returns the built package filename |
||||
get_package_filename () { |
||||
search_str="" |
||||
distro=$1 |
||||
case "$distro" in |
||||
"debian"* | "ubuntu"*) |
||||
search_str="DEBIAN" |
||||
;; |
||||
"archlinux") |
||||
search_str="ARCH" |
||||
;; |
||||
"fedora"*) |
||||
search_str="FEDORA" |
||||
;; |
||||
esac |
||||
if is_trial ; then |
||||
echo "$(make --no-print-directory -s pkg-trial-filename-$search_str)" |
||||
else |
||||
echo "$(make --no-print-directory -s pkg-filename-$search_str)" |
||||
fi |
||||
} |
||||
|
||||
# returns the filename to be placed inside "bin" |
||||
get_dest_package_filename () { |
||||
prefix="zrythm-$zrythm_version" |
||||
distro=$1 |
||||
res="" |
||||
case "$distro" in |
||||
"debian10" | "ubuntu"*) |
||||
res="$prefix-1_amd64.deb" |
||||
;; |
||||
"archlinux") |
||||
res="$prefix-1_x86_64.pkg.tar.zst" |
||||
;; |
||||
"fedora"*) |
||||
res="$prefix-1_x86_64.rpm" |
||||
esac |
||||
echo $res |
||||
} |
||||
|
||||
copy_package () { |
||||
distro=$1 |
||||
src_pkg_file="$(get_package_filename $distro)" |
||||
dest_pkg_file="$(get_dest_package_filename $distro)" |
||||
cp "artifacts/$distro/$src_pkg_file" "bin/$distro/$dest_pkg_file" |
||||
} |
||||
|
||||
echo "removing previous backup (if any)" |
||||
# remove prev backup |
||||
rm -rf bin.bak |
||||
mv bin bin.bak || true |
||||
|
||||
for distro in $distros ; do |
||||
mkdir -p bin/$distro |
||||
echo "copying plugins for $distro..." |
||||
copy_plugins $distro |
||||
echo "done" |
||||
echo "copying packages for $distro..." |
||||
copy_package $distro |
||||
echo "done" |
||||
done |
||||
|
||||
#cp artifacts/debian9/Zrythm$(2)-$(ZRYTHM_PKG_VERSION)-x86_64.AppImage \ |
||||
#Zrythm$(2)-$(ZRYTHM_PKG_VERSION)-x86_64.AppImage |
||||
|
||||
sed -e "s/@VERSION@/$zrythm_version/" \ |
||||
-e 's/@_AT_@/@/' < README$trial.in > README |
||||
sed -e "s/@VERSION@/$zrythm_version/" \ |
||||
-e "s/@ZPLUGINS_VERSION@/$zplugins_version/" \ |
||||
-e "s/@TRIAL@/$trial/" \ |
||||
< installer.sh.in > installer.sh |
||||
chmod +x installer.sh |
||||
|
||||
pdf="" |
||||
if ! is_trial ; then |
||||
pdf="$(ls Zrythm-*.pdf)" |
||||
fi |
||||
|
||||
echo "zipping installer..." |
||||
installer_zip_dir=${installer_zip::-4} |
||||
mkdir $installer_zip_dir |
||||
cp -R $pdf installer.sh README bin $installer_zip_dir/ |
||||
zip -r $installer_zip $installer_zip_dir |
||||
echo "done" |
||||
|
||||
echo "cleaning up..." |
||||
#rm -rf README installer.sh *.AppImage $pdf |
||||
rm -rf README installer.sh *.AppImage $installer_zip_dir |
||||
echo "done" |
Loading…
Reference in new issue