1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-11 10:24:10 +01:00
dxvk/package-release.sh

88 lines
1.8 KiB
Bash
Raw Normal View History

2018-03-08 18:34:33 +01:00
#!/bin/bash
2018-10-17 06:02:22 +02:00
set -e
shopt -s extglob
2018-03-08 18:34:33 +01:00
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 version destdir [--no-package] [--dev-build]"
2018-03-08 18:34:33 +01:00
exit 1
fi
DXVK_VERSION="$1"
DXVK_SRC_DIR=`dirname $(readlink -f $0)`
DXVK_BUILD_DIR=$(realpath "$2")"/dxvk-$DXVK_VERSION"
DXVK_ARCHIVE_PATH=$(realpath "$2")"/dxvk-$DXVK_VERSION.tar.gz"
2018-03-08 18:34:33 +01:00
if [ -e "$DXVK_BUILD_DIR" ]; then
echo "Build directory $DXVK_BUILD_DIR already exists"
exit 1
fi
shift 2
opt_nopackage=0
opt_devbuild=0
crossfile="build-win"
while [ $# -gt 0 ]; do
case "$1" in
"--no-package")
opt_nopackage=1
;;
"--dev-build")
opt_nopackage=1
opt_devbuild=1
;;
*)
echo "Unrecognized option: $1" >&2
exit 1
esac
shift
done
2018-03-08 18:34:33 +01:00
function build_arch {
export WINEARCH="win$1"
export WINEPREFIX="$DXVK_BUILD_DIR/wine.$1"
2018-03-08 18:34:33 +01:00
cd "$DXVK_SRC_DIR"
meson --cross-file "$DXVK_SRC_DIR/$crossfile$1.txt" \
2018-03-08 18:34:33 +01:00
--buildtype "release" \
--prefix "$DXVK_BUILD_DIR" \
2018-03-08 18:34:33 +01:00
--strip \
--bindir "x$1" \
--libdir "x$1" \
-Denable_tests=false \
"$DXVK_BUILD_DIR/build.$1"
2018-03-08 18:34:33 +01:00
cd "$DXVK_BUILD_DIR/build.$1"
2018-03-08 18:34:33 +01:00
ninja install
if [ $opt_devbuild -eq 0 ]; then
# get rid of some useless .a files
rm "$DXVK_BUILD_DIR/x$1/"*.!(dll)
rm -R "$DXVK_BUILD_DIR/build.$1"
fi
2018-03-08 18:34:33 +01:00
}
function build_script {
cp "$DXVK_SRC_DIR/setup_dxvk.sh" "$DXVK_BUILD_DIR/setup_dxvk.sh"
chmod +x "$DXVK_BUILD_DIR/setup_dxvk.sh"
}
function package {
cd "$DXVK_BUILD_DIR/.."
2018-03-08 18:34:33 +01:00
tar -czf "$DXVK_ARCHIVE_PATH" "dxvk-$DXVK_VERSION"
rm -R "dxvk-$DXVK_VERSION"
}
build_arch 64
build_arch 32
build_script
if [ $opt_nopackage -eq 0 ]; then
package
fi