summaryrefslogtreecommitdiffstats
path: root/src/libs/dxvk-native-1.9.2a/package-native.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:17:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:17:27 +0000
commitf215e02bf85f68d3a6106c2a1f4f7f063f819064 (patch)
tree6bb5b92c046312c4e95ac2620b10ddf482d3fa8b /src/libs/dxvk-native-1.9.2a/package-native.sh
parentInitial commit. (diff)
downloadvirtualbox-f215e02bf85f68d3a6106c2a1f4f7f063f819064.tar.xz
virtualbox-f215e02bf85f68d3a6106c2a1f4f7f063f819064.zip
Adding upstream version 7.0.14-dfsg.upstream/7.0.14-dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/libs/dxvk-native-1.9.2a/package-native.sh')
-rwxr-xr-xsrc/libs/dxvk-native-1.9.2a/package-native.sh81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/libs/dxvk-native-1.9.2a/package-native.sh b/src/libs/dxvk-native-1.9.2a/package-native.sh
new file mode 100755
index 00000000..f7408088
--- /dev/null
+++ b/src/libs/dxvk-native-1.9.2a/package-native.sh
@@ -0,0 +1,81 @@
+#!/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-native-$DXVK_VERSION"
+DXVK_ARCHIVE_PATH=$(realpath "$2")"/dxvk-native-$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
+
+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 {
+ cd "$DXVK_SRC_DIR"
+
+ opt_strip=
+ if [ $opt_devbuild -eq 0 ]; then
+ opt_strip=--strip
+ fi
+
+ meson --buildtype "release" \
+ --prefix "$DXVK_BUILD_DIR" \
+ $opt_strip \
+ -Denable_tests=true \
+ -Dbuild_id=$opt_buildid \
+ "$DXVK_BUILD_DIR/build"
+
+ cd "$DXVK_BUILD_DIR/build"
+ ninja install
+
+ if [ $opt_devbuild -eq 0 ]; then
+ # get rid of some useless .a files
+ rm -R "$DXVK_BUILD_DIR/build"
+ fi
+}
+
+function package {
+ cd "$DXVK_BUILD_DIR/.."
+ tar -czf "$DXVK_ARCHIVE_PATH" "dxvk-native-$DXVK_VERSION"
+ rm -R "dxvk-native-$DXVK_VERSION"
+}
+
+build_arch
+
+if [ $opt_nopackage -eq 0 ]; then
+ package
+fi