diff --git a/build.d b/build.d index 5a171d8..040b502 100755 --- a/build.d +++ b/build.d @@ -88,14 +88,6 @@ return 1; } - // Check dub - auto check = execute([DubBinPath, "--version"]); - if (check.status != 0) - { - writeln("Running newly built `dub` failed: ", check.output); - return 1; - } - writeln("DUB has been built as: ", DubBinPath); version (Posix) writeln("You may want to run `sudo ln -s ", DubBinPath, " /usr/local/bin` now"); diff --git a/release-windows.sh b/release-windows.sh index bf4e38b..20da0cc 100755 --- a/release-windows.sh +++ b/release-windows.sh @@ -8,17 +8,14 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR -# Save the rdmd used to run build.d -RDMD=$(command -v rdmd) - +# Setup cross compiler source setup-ldc-windows.sh # Run LDC with cross-compilation archiveName="$BIN_NAME-$VERSION-$OS-$ARCH_SUFFIX.zip" echo "Building $archiveName" mkdir -p bin -DMD=ldmd2 ${RDMD} ./build.d -release ${DFLAGS} +DMD=ldmd2 ldc2 -run ./build.d -release ${LDC_XDFLAGS} cd bin -mv "${BIN_NAME}" "${BIN_NAME}.exe" zip "$archiveName" "${BIN_NAME}.exe" diff --git a/setup-ldc-windows.sh b/setup-ldc-windows.sh index 0656b5a..664e24b 100644 --- a/setup-ldc-windows.sh +++ b/setup-ldc-windows.sh @@ -2,69 +2,51 @@ # sets up LDC for cross-compilation. Source this script, s.t. the new LDC is in PATH -LDC_VERSION="1.13.0" +# Make sure this version matches the version of LDC2 used in .travis.yml, +# otherwise the compiler and the lib used might mismatch. +LDC_VERSION="1.18.0" ARCH=${ARCH:-32} VERSION=$(git describe --abbrev=0 --tags) OS=windows -# Step 0: install ldc -if [ ! -f install.sh ] ; then - wget https://dlang.org/install.sh -fi -. $(bash ./install.sh -a "ldc-${LDC_VERSION}") +# LDC should already be installed (see .travis.yml) +# However, we need the libraries, so download them +# We can't use the downloaded ldc2 itself, because obviously it's for Windows -# for the install.sh script only -LDC_PATH="$(dirname $(dirname $(which ldc2)))" - -# Step 1a: download the LDC x64 windows binaries -if [ "${ARCH}" == 64 ] && [ ! -d "ldc2-${LDC_VERSION}-windows-x64" ] ; then - wget "https://github.com/ldc-developers/ldc/releases/download/v1.13.0/ldc2-${LDC_VERSION}-windows-x64.7z" - 7z x "ldc2-${LDC_VERSION}-windows-x64.7z" > /dev/null - # Step 2a: Add LDC windows binaries to LDC Linux - if [ ! -d "${LDC_PATH}/lib-win64" ] ; then - cp -r ldc2-1.13.0-windows-x64/lib "${LDC_PATH}/lib-win64" - cat >> "$LDC_PATH"/etc/ldc2.conf < /dev/null - # Step 2b: Add LDC windows binaries to LDC Linux - if [ ! -d "${LDC_PATH}/lib-win32" ] ; then - cp -r ldc2-1.13.0-windows-x86/lib "${LDC_PATH}/lib-win32" - cat >> "$LDC_PATH"/etc/ldc2.conf < /dev/null +fi + +# Step 2: Generate a config file with the proper path +cat > ${LDC_DIR_PATH}/etc/ldc2.conf <