Last change
on this file since 107044 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.9 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-$DXVK_VERSION"
|
---|
16 | DXVK_ARCHIVE_PATH=$(realpath "$2")"/dxvk-$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 | crossfile="build-win"
|
---|
30 |
|
---|
31 | while [ $# -gt 0 ]; do
|
---|
32 | case "$1" in
|
---|
33 | "--no-package")
|
---|
34 | opt_nopackage=1
|
---|
35 | ;;
|
---|
36 | "--dev-build")
|
---|
37 | opt_nopackage=1
|
---|
38 | opt_devbuild=1
|
---|
39 | ;;
|
---|
40 | "--build-id")
|
---|
41 | opt_buildid=true
|
---|
42 | ;;
|
---|
43 | *)
|
---|
44 | echo "Unrecognized option: $1" >&2
|
---|
45 | exit 1
|
---|
46 | esac
|
---|
47 | shift
|
---|
48 | done
|
---|
49 |
|
---|
50 | function build_arch {
|
---|
51 | export WINEARCH="win$1"
|
---|
52 | export WINEPREFIX="$DXVK_BUILD_DIR/wine.$1"
|
---|
53 |
|
---|
54 | cd "$DXVK_SRC_DIR"
|
---|
55 |
|
---|
56 | opt_strip=
|
---|
57 | if [ $opt_devbuild -eq 0 ]; then
|
---|
58 | opt_strip=--strip
|
---|
59 | fi
|
---|
60 |
|
---|
61 | meson setup --cross-file "$DXVK_SRC_DIR/$crossfile$1.txt" \
|
---|
62 | --buildtype "release" \
|
---|
63 | --prefix "$DXVK_BUILD_DIR" \
|
---|
64 | $opt_strip \
|
---|
65 | --bindir "x$1" \
|
---|
66 | --libdir "x$1" \
|
---|
67 | -Dbuild_id=$opt_buildid \
|
---|
68 | "$DXVK_BUILD_DIR/build.$1"
|
---|
69 |
|
---|
70 | cd "$DXVK_BUILD_DIR/build.$1"
|
---|
71 | ninja install
|
---|
72 |
|
---|
73 | if [ $opt_devbuild -eq 0 ]; then
|
---|
74 | # get rid of some useless .a files
|
---|
75 | rm "$DXVK_BUILD_DIR/x$1/"*.!(dll)
|
---|
76 | rm -R "$DXVK_BUILD_DIR/build.$1"
|
---|
77 | fi
|
---|
78 | }
|
---|
79 |
|
---|
80 | function package {
|
---|
81 | cd "$DXVK_BUILD_DIR/.."
|
---|
82 | tar -czf "$DXVK_ARCHIVE_PATH" "dxvk-$DXVK_VERSION"
|
---|
83 | rm -R "dxvk-$DXVK_VERSION"
|
---|
84 | }
|
---|
85 |
|
---|
86 | build_arch 64
|
---|
87 | build_arch 32
|
---|
88 |
|
---|
89 | if [ $opt_nopackage -eq 0 ]; then
|
---|
90 | package
|
---|
91 | fi
|
---|
Note:
See
TracBrowser
for help on using the repository browser.