diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 16:49:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 16:49:04 +0000 |
commit | 16f504a9dca3fe3b70568f67b7d41241ae485288 (patch) | |
tree | c60f36ada0496ba928b7161059ba5ab1ab224f9d /src/libs/dxvk-native-1.9.2a/package-release.sh | |
parent | Initial commit. (diff) | |
download | virtualbox-16f504a9dca3fe3b70568f67b7d41241ae485288.tar.xz virtualbox-16f504a9dca3fe3b70568f67b7d41241ae485288.zip |
Adding upstream version 7.0.6-dfsg.upstream/7.0.6-dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | src/libs/dxvk-native-1.9.2a/package-release.sh | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/libs/dxvk-native-1.9.2a/package-release.sh b/src/libs/dxvk-native-1.9.2a/package-release.sh new file mode 100755 index 00000000..9318226c --- /dev/null +++ b/src/libs/dxvk-native-1.9.2a/package-release.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash + +set -e + +shopt -s extglob + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "Usage: $0 version destdir [--no-package] [--dev-build]" + exit 1 +fi + +DXVK_VERSION="$1" +DXVK_SRC_DIR=`dirname $(readlink -f $0)` +DXVK_BUILD_DIR=$(realpath "$2")"/dxvk-$DXVK_VERSION" +DXVK_ARCHIVE_PATH=$(realpath "$2")"/dxvk-$DXVK_VERSION.tar.gz" + +if [ -e "$DXVK_BUILD_DIR" ]; then + echo "Build directory $DXVK_BUILD_DIR already exists" + exit 1 +fi + +shift 2 + +opt_nopackage=0 +opt_devbuild=0 +opt_buildid=false + +crossfile="build-win" + +while [ $# -gt 0 ]; do + case "$1" in + "--no-package") + opt_nopackage=1 + ;; + "--dev-build") + opt_nopackage=1 + opt_devbuild=1 + ;; + "--build-id") + opt_buildid=true + ;; + *) + echo "Unrecognized option: $1" >&2 + exit 1 + esac + shift +done + +function build_arch { + export WINEARCH="win$1" + export WINEPREFIX="$DXVK_BUILD_DIR/wine.$1" + + cd "$DXVK_SRC_DIR" + + opt_strip= + if [ $opt_devbuild -eq 0 ]; then + opt_strip=--strip + fi + + meson --cross-file "$DXVK_SRC_DIR/$crossfile$1.txt" \ + --buildtype "release" \ + --prefix "$DXVK_BUILD_DIR" \ + $opt_strip \ + --bindir "x$1" \ + --libdir "x$1" \ + -Denable_tests=false \ + -Dbuild_id=$opt_buildid \ + "$DXVK_BUILD_DIR/build.$1" + + cd "$DXVK_BUILD_DIR/build.$1" + ninja install + + if [ $opt_devbuild -eq 0 ]; then + # get rid of some useless .a files + rm "$DXVK_BUILD_DIR/x$1/"*.!(dll) + rm -R "$DXVK_BUILD_DIR/build.$1" + fi +} + +function build_script { + cp "$DXVK_SRC_DIR/setup_dxvk.sh" "$DXVK_BUILD_DIR/setup_dxvk.sh" + chmod +x "$DXVK_BUILD_DIR/setup_dxvk.sh" +} + +function package { + cd "$DXVK_BUILD_DIR/.." + tar -czf "$DXVK_ARCHIVE_PATH" "dxvk-$DXVK_VERSION" + rm -R "dxvk-$DXVK_VERSION" +} + +build_arch 64 +build_arch 32 +build_script + +if [ $opt_nopackage -eq 0 ]; then + package +fi |