forked from jp7677/dxvk-nvapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage-release.sh
executable file
·135 lines (112 loc) · 2.9 KB
/
package-release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/bin/bash
set -e
shopt -s extglob
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 version destdir"
exit 1
fi
VERSION="$1"
SRC_DIR=$(dirname "$(readlink -f "$0")")
BUILD_DIR=$(realpath "$2")"/dxvk-nvapi-$VERSION"
if [ -e "$BUILD_DIR" ]; then
echo "Build directory $BUILD_DIR already exists"
exit 1
fi
shift 2
opt_enabletests=false
opt_disablelayer=0
opt_devbuild=0
crossfile="build-win"
while [ $# -gt 0 ]; do
case "$1" in
"--no-package")
echo "Ignoring option: --no-package"
;;
"--enable-tests")
opt_enabletests=true
;;
"--disable-layer")
opt_disablelayer=1
;;
"--dev-build")
opt_devbuild=1
;;
*)
echo "Unrecognized option: $1" >&2
exit 1
esac
shift
done
function prepare {
python3 validate-methods.py \
src/nvapi.cpp \
src/nvapi_sys.cpp \
src/nvapi_disp.cpp \
src/nvapi_mosaic.cpp \
src/nvapi_ngx.cpp \
src/nvapi_drs.cpp \
src/nvapi_gpu.cpp \
src/nvapi_d3d.cpp \
src/nvapi_d3d11.cpp \
src/nvapi_d3d12.cpp \
src/nvapi_vulkan.cpp \
src/nvapi_interface.cpp \
external/nvapi/nvapi_interface.h
}
function build_arch {
cd "$SRC_DIR"
# remove generated files, because otherwise the existing
# files get into the build instead of the generated ones
rm -f version.h config.h
meson setup \
--cross-file "$SRC_DIR/$crossfile$1.txt" \
--buildtype "release" \
--prefix "$BUILD_DIR" \
--strip \
--bindir "x$1" \
--libdir "x$1" \
-Denable_tests=$opt_enabletests \
"$BUILD_DIR/build.$1"
cd "$BUILD_DIR/build.$1"
ninja install
cp version.h "$SRC_DIR"
cp config.h "$SRC_DIR"
if [ $opt_devbuild -eq 0 ]; then
# get rid of some useless .a files
rm "$BUILD_DIR/x$1/"*.!(dll|exe)
rm -R "$BUILD_DIR/build.$1"
fi
}
function build_layer {
# remove generated files, because otherwise the existing
# files get into the build instead of the generated ones
rm -f "$SRC_DIR"/layer/{version,config}.h
meson setup \
--buildtype "release" \
--prefix "$BUILD_DIR/layer" \
--libdir '' \
--strip \
-Dabsolute_library_path=false \
-Dlibrary_path_prefix=./ \
-Dmanifest_install_dir=. \
"$BUILD_DIR/build.layer" \
"$SRC_DIR/layer"
ninja -C "$BUILD_DIR/build.layer" install
cp "$BUILD_DIR"/build.layer/{version,config}.h "$SRC_DIR/layer"
if (( ! opt_devbuild )); then
rm -R "$BUILD_DIR/build.layer"
fi
}
function copy_extra {
cd "$SRC_DIR"
cp LICENSE "$BUILD_DIR"
cp README.md "$BUILD_DIR"
}
prepare
build_arch 32
build_arch 64
cd "$SRC_DIR"
if (( ! opt_disablelayer )); then
build_layer
fi
copy_extra