-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage-release.sh
executable file
·47 lines (34 loc) · 1005 Bytes
/
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
#!/bin/bash
set -e
shopt -s extglob
if [ -z "$1" ]; then
echo "Usage: package-release.sh destdir"
exit 1
fi
NVCUDA_SRC_DIR=`dirname $(readlink -f $0)`
NVCUDA_BUILD_DIR=$(realpath "$1")"/nvcuda"
if [ -e "$NVCUDA_BUILD_DIR" ]; then
echo "Build directory $NVCUDA_BUILD_DIR already exists"
exit 1
fi
# build nvcuda
function build_arch {
export WINEARCH="win$1"
cd "$NVCUDA_SRC_DIR"
meson --cross-file "$NVCUDA_SRC_DIR/build-wine$1.txt" \
--buildtype release \
--prefix "$NVCUDA_BUILD_DIR" \
--libdir "x$1" \
--strip \
"$NVCUDA_BUILD_DIR/build.$1"
cd "$NVCUDA_BUILD_DIR/build.$1"
ninja install
rm -R "$NVCUDA_BUILD_DIR/build.$1"
}
build_arch 64
build_arch 32
# cleanup
cd $NVCUDA_BUILD_DIR
find . -name \*.a -type f -delete
find . -name "*.dll.so" -type f -exec bash -c 'mv "$0" "${0%.so}"' {} \;
echo "Done building!"