Last change
on this file since 106594 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 |
|
---|
3 | set -e
|
---|
4 |
|
---|
5 | shopt -s extglob
|
---|
6 |
|
---|
7 | if [ -z "$1" ] || [ -z "$2" ]; then
|
---|
8 | echo "Usage: $0 version destdir [--no-package] [--dev-build]"
|
---|
9 | exit 1
|
---|
10 | fi
|
---|
11 |
|
---|
12 | DXVK_VERSION="$1"
|
---|
13 | DXVK_SRC_DIR=$(readlink -f "$0")
|
---|
14 | DXVK_SRC_DIR=$(dirname "$DXVK_SRC_DIR")
|
---|
15 | DXVK_BUILD_DIR=$(realpath "$2")"/dxvk-native-$DXVK_VERSION"
|
---|
16 | DXVK_ARCHIVE_PATH=$(realpath "$2")"/dxvk-native-$DXVK_VERSION.tar.gz"
|
---|
17 |
|
---|
18 | if [ -e "$DXVK_BUILD_DIR" ]; then
|
---|
19 | echo "Build directory $DXVK_BUILD_DIR already exists"
|
---|
20 | exit 1
|
---|
21 | fi
|
---|
22 |
|
---|
23 | shift 2
|
---|
24 |
|
---|
25 | opt_nopackage=0
|
---|
26 | opt_devbuild=0
|
---|
27 | opt_buildid=false
|
---|
28 |
|
---|
29 | CC=${CC:="gcc"}
|
---|
30 | CXX=${CXX:="g++"}
|
---|
31 |
|
---|
32 | while [ $# -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
|
---|
49 | done
|
---|
50 |
|
---|
51 | function 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 |
|
---|
77 | function package {
|
---|
78 | cd "$DXVK_BUILD_DIR"
|
---|
79 | tar -czf "$DXVK_ARCHIVE_PATH" "usr"
|
---|
80 | cd ".."
|
---|
81 | rm -R "dxvk-native-$DXVK_VERSION"
|
---|
82 | }
|
---|
83 |
|
---|
84 | build_arch 64 lib
|
---|
85 | build_arch 32 lib32
|
---|
86 |
|
---|
87 | if [ $opt_nopackage -eq 0 ]; then
|
---|
88 | package
|
---|
89 | fi
|
---|
Note:
See
TracBrowser
for help on using the repository browser.