VirtualBox

source: vbox/trunk/src/libs/dxvk-2.3.1/package-native.sh@ 106443

Last change on this file since 106443 was 105107, checked in by vboxsync, 5 months ago

libs/dxvk-2.3.1: Make it build, bugref:10716

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1#!/usr/bin/env bash
2
3set -e
4
5shopt -s extglob
6
7if [ -z "$1" ] || [ -z "$2" ]; then
8 echo "Usage: $0 version destdir [--no-package] [--dev-build]"
9 exit 1
10fi
11
12DXVK_VERSION="$1"
13DXVK_SRC_DIR=$(readlink -f "$0")
14DXVK_SRC_DIR=$(dirname "$DXVK_SRC_DIR")
15DXVK_BUILD_DIR=$(realpath "$2")"/dxvk-native-$DXVK_VERSION"
16DXVK_ARCHIVE_PATH=$(realpath "$2")"/dxvk-native-$DXVK_VERSION.tar.gz"
17
18if [ -e "$DXVK_BUILD_DIR" ]; then
19 echo "Build directory $DXVK_BUILD_DIR already exists"
20 exit 1
21fi
22
23shift 2
24
25opt_nopackage=0
26opt_devbuild=0
27opt_buildid=false
28
29CC=${CC:="gcc"}
30CXX=${CXX:="g++"}
31
32while [ $# -gt 0 ]; do
33 case "$1" in
34 "--no-package")
35 opt_nopackage=1
36 ;;
37 "--dev-build")
38 opt_nopackage=1
39 opt_devbuild=1
40 ;;
41 "--build-id")
42 opt_buildid=true
43 ;;
44 *)
45 echo "Unrecognized option: $1" >&2
46 exit 1
47 esac
48 shift
49done
50
51function build_arch {
52 cd "$DXVK_SRC_DIR"
53
54 opt_strip=
55 if [ $opt_devbuild -eq 0 ]; then
56 opt_strip=--strip
57 fi
58
59 CC="$CC -m$1" CXX="$CXX -m$1" meson setup \
60 --buildtype "release" \
61 --prefix "$DXVK_BUILD_DIR/usr" \
62 $opt_strip \
63 --bindir "$2" \
64 --libdir "$2" \
65 -Dbuild_id=$opt_buildid \
66 --force-fallback-for=libdisplay-info \
67 "$DXVK_BUILD_DIR/build.$1"
68
69 cd "$DXVK_BUILD_DIR/build.$1"
70 ninja install
71
72 if [ $opt_devbuild -eq 0 ]; then
73 rm -r "$DXVK_BUILD_DIR/build.$1"
74 fi
75}
76
77function package {
78 cd "$DXVK_BUILD_DIR"
79 tar -czf "$DXVK_ARCHIVE_PATH" "usr"
80 cd ".."
81 rm -R "dxvk-native-$DXVK_VERSION"
82}
83
84build_arch 64 lib
85build_arch 32 lib32
86
87if [ $opt_nopackage -eq 0 ]; then
88 package
89fi
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette