diff --git a/.travis.yml b/.travis.yml index e337231..5146217 100644 --- a/.travis.yml +++ b/.travis.yml @@ -107,7 +107,8 @@ stages: - name: test if: type = pull_request or (type = push and branch = master) - - name: deploy - if: type = push and tag =~ ^v + # Until deployment of the release binaries is fixed, always build them + #- name: deploy + #if: type = push and tag =~ ^v - name: update-latest if: type = push and tag =~ ^v diff --git a/build.sh b/build.sh index 3b2f527..1afe076 100755 --- a/build.sh +++ b/build.sh @@ -52,8 +52,8 @@ echo Using existing version file. fi -# For OSX compatibility >= 10.7 -MACOSX_DEPLOYMENT_TARGET=10.7 +# For OSX compatibility >= 10.8 +MACOSX_DEPLOYMENT_TARGET=10.8 echo Running $DMD... $DMD -ofbin/dub -g -O -w -version=DubUseCurl -Isource $* $LIBS @build-files.txt diff --git a/release.sh b/release.sh index ceec952..bbf6736 100755 --- a/release.sh +++ b/release.sh @@ -1,23 +1,31 @@ -#!/bin/bash +#!/usr/bin/env bash -set -v -e -o pipefail +set -eux -o pipefail VERSION=$(git describe --abbrev=0 --tags) ARCH="${ARCH:-64}" -CUSTOM_FLAGS="" - +CUSTOM_FLAGS=() unameOut="$(uname -s)" case "$unameOut" in Linux*) OS=linux - CUSTOM_FLAGS="-L--export-dynamic" + CUSTOM_FLAGS+=("-L--export-dynamic") ;; Darwin*) OS=osx + CUSTOM_FLAGS+=("-L-dead_strip") ;; *) echo "Unknown OS: $unameOut"; exit 1 esac +if [[ $(basename "$DMD") =~ ldmd.* ]] ; then + CUSTOM_FLAGS+=("-flto=full") + # ld.gold is required on Linux + if [ ${OS:-} == "linux" ] ; then + CUSTOM_FLAGS+=("-linker=gold") + fi +fi + case "$ARCH" in 64) ARCH_SUFFIX="x86_64";; 32) ARCH_SUFFIX="x86";; @@ -27,5 +35,5 @@ archiveName="dub-$VERSION-$OS-$ARCH_SUFFIX.tar.gz" echo "Building $archiveName" -DFLAGS="-release -m$ARCH ${CUSTOM_FLAGS}" DMD="$(command -v $DMD)" ./build.sh +DFLAGS="-release -m$ARCH ${CUSTOM_FLAGS[@]}" DMD="$(command -v $DMD)" ./build.sh tar cvfz "bin/$archiveName" -C bin dub