-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpackage-release.sh
executable file
·49 lines (36 loc) · 1.08 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
#!/bin/bash
set -e
shopt -s extglob
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 releasename destdir"
exit 1
fi
VERSION="$1"
NVCUDA_SRC_DIR=$(dirname "$(readlink -f "$0")")
NVCUDA_BUILD_DIR=$(realpath "$2")"/nvcuda-$VERSION"
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 setup \
--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 sh -c 'mv "$1" "${1%.so}"' _ {} \;
echo "Done building!"