2022-02-21 02:41:36 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
XZ_DIR="mingw-w64-x86_64-xz"
|
|
|
|
XZ_PACKAGE_VERSION_FILE="${XZ_DIR}/version"
|
|
|
|
XZ_PACKAGE_VERSION="mingw-w64-x86_64-xz-5.2.5-2-any.pkg.tar.zst"
|
|
|
|
|
|
|
|
if [ -f "${XZ_DIR}/version" ]; then
|
|
|
|
XZ_PACKAGE_INSTALLED_VERSION=$(<$XZ_PACKAGE_VERSION_FILE)
|
|
|
|
else
|
|
|
|
XZ_PACKAGE_INSTALLED_VERSION=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${XZ_PACKAGE_VERSION}" != "${XZ_PACKAGE_INSTALLED_VERSION}" ]; then
|
|
|
|
rm -rf ${XZ_DIR}
|
|
|
|
mkdir ${XZ_DIR}
|
|
|
|
(cd mingw-w64-x86_64-xz && \
|
2022-02-21 08:28:23 +01:00
|
|
|
wget -qO- https://ftp.nluug.nl/pub/os/windows/msys2/builds/mingw/mingw64/mingw-w64-x86_64-xz-5.2.5-2-any.pkg.tar.zst | \
|
2022-02-21 02:41:36 +01:00
|
|
|
unzstd - | \
|
|
|
|
tar -xf -)
|
|
|
|
echo ${XZ_PACKAGE_VERSION} > ${XZ_PACKAGE_VERSION_FILE}
|
|
|
|
fi
|
|
|
|
|
|
|
|
export MINGWPATHS="-Imingw-w64-x86_64-xz/mingw64/include -Lmingw-w64-x86_64-xz/mingw64/lib"
|
|
|
|
|
|
|
|
case "$(uname -s)" in
|
|
|
|
Linux)
|
|
|
|
export CC="x86_64-w64-mingw32-gcc"
|
|
|
|
export CXX="x86_64-w64-mingw32-g++"
|
|
|
|
;;
|
|
|
|
|
|
|
|
MINGW*)
|
|
|
|
export CC="gcc"
|
|
|
|
export CXX="g++"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
make clean
|
|
|
|
make
|