Browse Source

simplify windows build

use_builds_script
Alexandros Theodotou 3 years ago
parent
commit
d4b606f938
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 3
      meson.build
  2. 18
      scripts/make_mingw_pkg.sh.in
  3. 49
      scripts/meson.build
  4. 13
      windows-msys/install_carla.sh.in
  5. 18
      windows-msys/make_mingw_pkg.sh.in
  6. 10
      windows-msys/make_windows_chroot.sh.in
  7. 0
      windows-msys/make_windows_installer.sh.in
  8. 0
      windows-msys/make_zrythm_mingw_pkg.sh.in
  9. 151
      windows-msys/meson.build

3
meson.build

@ -148,6 +148,9 @@ global_conf.set ( @@ -148,6 +148,9 @@ global_conf.set (
'PDF_DIR', get_option ('pdf-dir'))
global_conf.set (
'MANUALS_ZIP_FILE', get_option ('manuals-zip-file'))
global_conf.set (
'GET_PKG_FILENAME_SH_PATH',
meson.build_root () / 'scripts/get_pkg_filename.sh')
subdir ('scripts')
subdir ('sources')

18
scripts/make_mingw_pkg.sh.in

@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
#!@BASH@
set -x
out_file="$1"
pkgbuild="$2"
tempdir=`mktemp -d`
cp $pkgbuild $tempdir/PKGBUILD
pushd $tempdir
MINGW_INSTALLS=mingw64 makepkg-mingw -fs --noconfirm
pacman -U $tempdir/*.pkg.tar.zst --noconfirm --overwrite='*'
popd
cp $tempdir/*.pkg.tar.zst $out_file
rm -rf $tempdir

49
scripts/meson.build

@ -15,93 +15,64 @@ @@ -15,93 +15,64 @@
# You should have received a copy of the GNU Affero General Public License
# along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
scripts_conf = configuration_data ()
scripts_conf.merge_from (global_conf)
scripts_conf.set ('GET_PKG_FILENAME_SH_PATH', meson.current_build_dir () / 'get_pkg_filename.sh')
# configure each script
make_windows_chroot = configure_file (
output: 'make_windows_chroot.sh',
input: 'make_windows_chroot.sh.in',
configuration: scripts_conf,
)
make_windows_installer = configure_file (
output: 'make_windows_installer.sh',
input: 'make_windows_installer.sh.in',
configuration: scripts_conf,
)
make_debian_pkg = configure_file (
output: 'make_debian_pkg.sh',
input: 'make_debian_pkg.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
make_rpm_pkg = configure_file (
output: 'make_rpm_pkg.sh',
input: 'make_rpm_pkg.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
make_arch_pkg = configure_file (
output: 'make_arch_pkg.sh',
input: 'make_arch_pkg.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
make_nixos_pkg = configure_file (
output: 'make_nixos_pkg.sh',
input: 'make_nixos_pkg.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
make_user_manual = configure_file (
output: 'make_user_manual.sh',
input: 'make_user_manual.sh.in',
configuration: scripts_conf,
)
make_mingw_pkg = configure_file (
output: 'make_mingw_pkg.sh',
input: 'make_mingw_pkg.sh.in',
configuration: scripts_conf,
)
make_zrythm_mingw_pkg = configure_file (
output: 'make_zrythm_mingw_pkg.sh',
input: 'make_zrythm_mingw_pkg.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
make_carla = configure_file (
output: 'make_carla.sh',
input: 'make_carla.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
make_lsp_dsp_lib = configure_file (
output: 'make_lsp_dsp_lib.sh',
input: 'make_lsp_dsp_lib.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
get_pkg_filename = configure_file (
output: 'get_pkg_filename.sh',
input: 'get_pkg_filename.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
get_pkg_filename_from_distro = configure_file (
output: 'get_pkg_filename_from_distro.sh',
input: 'get_pkg_filename_from_distro.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
make_zplugins = configure_file (
output: 'make_zplugins.sh',
input: 'make_zplugins.sh.in',
configuration: scripts_conf,
configuration: global_conf,
)
built_scripts_dir = meson.current_build_dir ()

13
windows-msys/install_carla.sh.in

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
#!@BASH@
set -ex
out_file="$1"
carla_woe32_binary_64="$2"
carla_woe32_binary_32="$3"
unzip -o $carla_woe32_binary_64 -d /mingw64/
unzip -o $carla_woe32_binary_32 -d /mingw64/lib/carla
touch $out_file

18
windows-msys/make_mingw_pkg.sh.in

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
#!@BASH@
set -x
out_file="$1"
pkgbuild="$2"
private_dir="$3"
rm -rf $private_dir
mkdir -p $private_dir
cp $pkgbuild $private_dir/PKGBUILD
pushd $private_dir
MINGW_INSTALLS=mingw64 makepkg-mingw -fs --noconfirm
popd
pacman -U $private_dir/*.pkg.tar.zst --noconfirm --overwrite='*'
cp $private_dir/*.pkg.tar.zst $out_file

10
scripts/make_windows_chroot.sh.in → windows-msys/make_windows_chroot.sh.in

@ -2,13 +2,15 @@ @@ -2,13 +2,15 @@
set -e
out_file="$1"
# chroot dir
chroot_dir="$1"
chroot_dir="$2"
src_tarball="$2"
src_tarball="$3"
# full paths to each package (pkg.tar.zst) to install
packages="${@:3}"
packages="${@:4}"
packages_array=($packages)
dash_trial="@DASH_TRIAL@"
@ -30,3 +32,5 @@ glib-compile-schemas.exe \ @@ -30,3 +32,5 @@ glib-compile-schemas.exe \
"$chroot_dir/mingw64/share/glib-2.0/schemas"
cp $chroot_dir/mingw64/bin/zrythm.exe $chroot_dir/mingw64/bin/zrythm$dash_trial.exe || true
touch $out_file

0
scripts/make_windows_installer.sh.in → windows-msys/make_windows_installer.sh.in

0
scripts/make_zrythm_mingw_pkg.sh.in → windows-msys/make_zrythm_mingw_pkg.sh.in

151
windows-msys/meson.build

@ -24,86 +24,88 @@ mingw_zrythm_pkgbuild = configure_file ( @@ -24,86 +24,88 @@ mingw_zrythm_pkgbuild = configure_file (
configuration: windows_msys_conf,
)
# configure scripts
make_windows_chroot = configure_file (
output: 'make_windows_chroot.sh',
input: 'make_windows_chroot.sh.in',
configuration: global_conf,
)
make_windows_installer = configure_file (
output: 'make_windows_installer.sh',
input: 'make_windows_installer.sh.in',
configuration: global_conf,
)
make_mingw_pkg = configure_file (
output: 'make_mingw_pkg.sh',
input: 'make_mingw_pkg.sh.in',
configuration: global_conf,
)
make_zrythm_mingw_pkg = configure_file (
output: 'make_zrythm_mingw_pkg.sh',
input: 'make_zrythm_mingw_pkg.sh.in',
configuration: global_conf,
)
install_carla = configure_file (
output: 'install_carla.sh',
input: 'install_carla.sh.in',
configuration: global_conf,
)
make_mingw_pkg_cmd = [
bash, '-c', '@INPUT0@ "$1" "$2" "$3"', '_ignored',
'@OUTPUT@', '@INPUT1@', '@PRIVATE_DIR@'
]
# install dependencies
make_mingw_pkg_full_path = meson.build_root () / 'scripts/make_mingw_pkg.sh'
independent_dep_names = [ 'jack2', 'lsp-dsp-lib', ]
independent_deps = []
foreach dep_name : independent_dep_names
src_pkgbuild = 'PKGBUILD-' + dep_name + '-mingw'
independent_deps += custom_target (
'mingw-' + dep_name,
output: dep_name + '.pkg.tar.zst',
input: [ make_mingw_pkg, src_pkgbuild, ],
command: [
# does not work with @INPUT0@ and @INPUT1@
bash, '-c', make_mingw_pkg_full_path +
' @OUTPUT@ ' +
meson.current_source_dir () / src_pkgbuild,
input: [
make_mingw_pkg, 'PKGBUILD-' + dep_name + '-mingw',
],
command: make_mingw_pkg_cmd,
install: false,
)
endforeach
src_pkgbuild = 'PKGBUILD-lv2-mingw'
lv2_pkg = custom_target (
'mingw-lv2',
output: 'lv2.pkg.tar.zst',
input: [ src_pkgbuild, make_mingw_pkg, ],
command: [
bash, '-c', make_mingw_pkg_full_path +
' @OUTPUT@ ' +
meson.current_source_dir () / src_pkgbuild,
],
input: [ make_mingw_pkg, 'PKGBUILD-lv2-mingw', ],
command: make_mingw_pkg_cmd,
install: false,
)
src_pkgbuild = 'PKGBUILD-serd-mingw'
serd_pkg = custom_target (
'mingw-serd',
output: 'serd.pkg.tar.zst',
input: [ src_pkgbuild, make_mingw_pkg, ],
command: [
bash, '-c', make_mingw_pkg_full_path +
' @OUTPUT@ ' +
meson.current_source_dir () / src_pkgbuild,
],
input: [ make_mingw_pkg, 'PKGBUILD-serd-mingw', ],
command: make_mingw_pkg_cmd,
depends: lv2_pkg,
install: false,
)
src_pkgbuild = 'PKGBUILD-sord-mingw'
sord_pkg = custom_target (
'mingw-sord',
output: 'sord.pkg.tar.zst',
input: [ src_pkgbuild, make_mingw_pkg, ],
command: [
bash, '-c', make_mingw_pkg_full_path +
' @OUTPUT@ ' +
meson.current_source_dir () / src_pkgbuild,
],
input: [ make_mingw_pkg, 'PKGBUILD-sord-mingw', ],
command: make_mingw_pkg_cmd,
depends: serd_pkg,
install: false,
)
src_pkgbuild = 'PKGBUILD-sratom-mingw'
sratom_pkg = custom_target (
'mingw-sratom',
output: 'sratom.pkg.tar.zst',
input: [ src_pkgbuild, make_mingw_pkg, ],
command: [
bash, '-c', make_mingw_pkg_full_path +
' @OUTPUT@ ' +
meson.current_source_dir () / src_pkgbuild,
],
input: [ make_mingw_pkg, 'PKGBUILD-sratom-mingw', ],
command: make_mingw_pkg_cmd,
depends: sord_pkg,
install: false,
)
src_pkgbuild = 'PKGBUILD-lilv-mingw'
lilv_pkg = custom_target (
'mingw-lilv',
output: 'lilv.pkg.tar.zst',
input: [ src_pkgbuild, make_mingw_pkg, ],
command: [
bash, '-c', make_mingw_pkg_full_path +
' @OUTPUT@ ' +
meson.current_source_dir () / src_pkgbuild,
],
input: [ make_mingw_pkg, 'PKGBUILD-lilv-mingw', ],
command: make_mingw_pkg_cmd,
depends: sratom_pkg,
install: false,
)
@ -137,36 +139,26 @@ mingw_install_carla_bins_target = custom_target ( @@ -137,36 +139,26 @@ mingw_install_carla_bins_target = custom_target (
'mingw-install-carla',
output: 'carla-installed',
input: [
carla_woe32_binary_64_zip, carla_woe32_binary_32_zip,
install_carla, carla_woe32_binary_64_zip,
carla_woe32_binary_32_zip,
],
command: [
bash, '-c', 'unzip -o ' +
carla_woe32_binary_64_zip.full_path () +
' -d /mingw64/ && unzip -o ' +
carla_woe32_binary_32_zip.full_path () +
' -d /mingw64/lib/carla' +
' && touch @OUTPUT@'
bash, '-c', '@INPUT0@ "$1" "$2" "$3"', '_ignored',
'@OUTPUT@', '@INPUT1@', '@INPUT2@'
],
install: false,
)
output_file = 'zrythm' + dash_trial + '.pkg.tar.zst'
mingw_zrythm_pkgbuild_full_path = meson.current_build_dir () / 'PKGBUILD'
mingw_zrythm_pkg = custom_target (
'mingw-zrythm-pkg',
output: output_file,
output: 'zrythm' + dash_trial + '.pkg.tar.zst',
input: [
mingw_zrythm_pkgbuild, zrythm_src_tarball,
zplugins_src_tarball,
make_zrythm_mingw_pkg, mingw_zrythm_pkgbuild,
zrythm_src_tarball, zplugins_src_tarball,
],
command: [
bash, '-c',
meson.build_root () / 'scripts/make_zrythm_mingw_pkg.sh ' +
meson.current_build_dir () / output_file + ' ' +
mingw_zrythm_pkgbuild_full_path + ' ' +
zrythm_src_tarball.full_path () + ' ' +
zplugins_src_tarball.full_path () + ' ' +
'@PRIVATE_DIR@'
bash, '-c', '@INPUT0@ "$1" "$2" "$3" "$4"', '_ignored',
'@OUTPUT@', '@INPUT1@', '@INPUT2@', '@PRIVATE_DIR@',
],
depends: [
mingw_install_carla_bins_target, lilv_pkg,
@ -180,27 +172,19 @@ windows_chroot_target = custom_target ( @@ -180,27 +172,19 @@ windows_chroot_target = custom_target (
'windows-chroot',
output: 'zrythm-test',
input: [
zrythm_src_tarball, independent_deps[0],
make_windows_chroot, 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',
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: [
'@INPUT0@ "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" ' +
'"$9" "${10}" "${11}"',
'_ignored',
'@OUTPUT@', chroot_dir, '@INPUT1@', '@INPUT2@',
'@INPUT3@', '@INPUT4@', '@INPUT5@', '@INPUT6@',
'@INPUT7@', '@INPUT8@', '@INPUT9@',
],
install: false,
)
@ -219,13 +203,10 @@ windows_msys_installer = custom_target ( @@ -219,13 +203,10 @@ windows_msys_installer = custom_target (
],
command: [
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 ()
'@INPUT0@ "$1" "$2" "$3" "$4" "$5" "$6" "$7"',
'_ignored',
'@OUTPUT@', '@INPUT1@', chroot_dir, '@INPUT2@',
'@PRIVATE_DIR@', '@INPUT3@', '@INPUT4@',
],
depends: [
windows_chroot_target,

Loading…
Cancel
Save