2 # Based on DXVK build script - https://github.com/doitsujin/dxvk/blob/master/package-release.sh
5 echo "Usage: package-release.sh version destdir [options]
7 --no-package: Do not build tar package
8 --keep-builddir: Do not delete builddir, use this to keep logfiles for debugging
9 --no-32bit: Do not build 32 bit binaries
10 --no-64bit: Do not build 64 bit binaries
11 --debug: Build debug version of the library
12 --no-pch: Do not use precompiled headers"
15 if [ -z "$1" ] ||
[ -z "$2" ]; then
20 if [ -z "$(export -p | grep WINEPREFIX\=)" ]; then
21 export WINEPREFIX
=~
/.wine
/VK9-build
24 # Get positional arguments and remove them from argument list
26 VK9_SRC_DIR
=`dirname $(readlink -f $0)`
27 VK9_BUILD_DIR
=$
(realpath
"$2")"/vk9-$VK9_VERSION"
28 VK9_ARCHIVE_PATH
=$
(realpath
"$2")"/vk9-$VK9_VERSION.tar.gz"
70 echo "Found unknown argument \"$key\". Abort!"
77 echo "Building VK9 with the following options:"
78 echo " tar package: $BUILD_PACKAGE"
79 echo " 32 bit: $BUILD_32BIT"
80 echo " 64 bit: $BUILD_64BIT"
81 echo " build type: $BUILD_TYPE"
82 echo " keep builddir: $KEEP_BUILDDIR"
83 echo " precompiled header: $USE_PCH"
88 PKG_CONFIG_PATH_SET
=true
89 PKG_CONFIG_PATH_CUSTOM_SET
=true
91 if [ -z "$(export -p | grep PKG_CONFIG_PATH\=)" ]; then
92 export PKG_CONFIG_PATH
=.
/dep
$1
93 PKG_CONFIG_PATH_SET
=false
95 if [ -z "$(export -p | grep PKG_CONFIG_PATH_CUSTOM\=)" ]; then
96 # Some distributions use PKG_CONFIG_PATH_CUSTOM instead.
97 export PKG_CONFIG_PATH_CUSTOM
=.
/dep
$1
98 PKG_CONFIG_PATH_CUSTOM_SET
=false
101 BOOST_INCLUDEDIR_SET
=true
102 BOOST_LIBRARYDIR_SET
=true
103 source .
/dep
$1/boost.sh
105 meson
--cross-file "$VK9_SRC_DIR/build-win$1.txt" \
106 --buildtype $BUILD_TYPE \
107 --prefix "$VK9_BUILD_DIR/install.$1" \
111 -Denable_tests=false \
112 "$VK9_BUILD_DIR/build.$1"
114 cd "$VK9_BUILD_DIR/build.$1"
117 mkdir
-p "$VK9_BUILD_DIR/x$1"
119 cp "$VK9_BUILD_DIR/install.$1/bin/d3d9.dll" "$VK9_BUILD_DIR/x$1/d3d9.dll"
120 cp "$VK9_SRC_DIR/VK9-Library/VK9.conf" "$VK9_BUILD_DIR/x$1/VK9.conf"
121 cp "$VK9_BUILD_DIR/install.$1/bin/setup_vk9.sh" "$VK9_BUILD_DIR/x$1/setup_vk9.sh"
122 cp "$VK9_SRC_DIR/wine_utils/setup_vk9.verb" "$VK9_BUILD_DIR/setup_vk9.verb"
124 if [ $KEEP_BUILDDIR == false
]; then
125 rm -R "$VK9_BUILD_DIR/build.$1"
126 rm -R "$VK9_BUILD_DIR/install.$1"
129 # Clean up environment variables.
130 if [ $BOOST_INCLUDEDIR_SET == false
]; then
131 unset BOOST_INCLUDEDIR
133 if [ $BOOST_LIBRARYDIR_SET == false
]; then
134 unset BOOST_LIBRARYDIR
136 if [ $PKG_CONFIG_PATH_SET == false
]; then
137 unset PKG_CONFIG_PATH
139 if [ $PKG_CONFIG_PATH_CUSTOM_SET == false
]; then
140 unset PKG_CONFIG_PATH_CUSTOM
145 echo "Building package..."
146 cd "$VK9_BUILD_DIR/.."
148 if [ -d "vk9-$VK9_VERSION/x64" ]; then
149 TAR_DIRS
="vk9-$VK9_VERSION/x64"
151 if [ -d "vk9-$VK9_VERSION/x32" ]; then
152 TAR_DIRS
="$TAR_DIRS vk9-$VK9_VERSION/x32"
154 TAR_DIRS
="$TAR_DIRS vk9-$VK9_VERSION/setup_vk9.verb"
156 tar -czvf "$VK9_ARCHIVE_PATH" $TAR_DIRS
157 if [ $KEEP_BUILDDIR == false
]; then
158 rm -R "vk9-$VK9_VERSION"
163 if [ $BUILD_32BIT == true
]; then
167 if [ $BUILD_64BIT == true
]; then
171 if [ $BUILD_PACKAGE == true
]; then