From a7bf5b3958a2bcc1c7ffc04f970e794a2c51d744 Mon Sep 17 00:00:00 2001 From: Geod24 Date: Wed, 26 Aug 2020 12:44:57 +0900 Subject: [PATCH] Update release LDC to v1.23.0 The LDC used for release hasn't been updated in years, and was severely lacking behind. The script used is very clearly a copy of the one in DUB, which has been overhauled in dlang/dub#1849, so copying those improvements over. --- .travis.yml | 14 +++--- setup-ldc-windows.sh | 100 ++++++++++++++++++------------------------- 2 files changed, 46 insertions(+), 68 deletions(-) diff --git a/.travis.yml b/.travis.yml index 046ecee..26321bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ dist: xenial -sudo: false language: d + d: - dmd - ldc-beta @@ -28,7 +28,7 @@ jobs: include: - stage: GitHub Release #if: tag IS present - d: ldc-1.13.0 + d: ldc-1.23.0 os: linux script: echo "Deploying to GitHub releases ..." && ./release.sh deploy: @@ -42,7 +42,7 @@ jobs: tags: true - stage: GitHub Release #if: tag IS present - d: ldc-1.13.0 + d: ldc-1.23.0 os: osx script: echo "Deploying to GitHub releases ..." && ./release.sh deploy: @@ -56,10 +56,8 @@ jobs: tags: true - stage: GitHub Release #if: tag IS present - d: dmd + d: ldc-1.23.0 os: linux - language: generic - sudo: yes script: echo "Deploying to GitHub releases ..." && ./release-windows.sh addons: apt: @@ -76,10 +74,8 @@ jobs: tags: true - stage: GitHub Release #if: tag IS present - d: dmd + d: ldc-1.23.0 os: linux - language: generic - sudo: yes script: echo "Deploying to GitHub releases ..." && ARCH=64 ./release-windows.sh addons: apt: diff --git a/setup-ldc-windows.sh b/setup-ldc-windows.sh index 0656b5a..6d5544b 100644 --- a/setup-ldc-windows.sh +++ b/setup-ldc-windows.sh @@ -1,70 +1,52 @@ #!/usr/bin/env bash -# sets up LDC for cross-compilation. Source this script, s.t. the new LDC is in PATH +# 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.23.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 <