diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2019-01-18 09:04:51 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2019-01-29 13:39:30 +0100 |
| commit | d99d60998de6deb9e38af44e901dea38e802a262 (patch) | |
| tree | 973048075b9cd249a62d7b3aecaa509369fb074f | |
| parent | 7aa55f7944e96712a73c93987d3b9be2a1b75e4b (diff) | |
| download | mullvadvpn-d99d60998de6deb9e38af44e901dea38e802a262.tar.xz mullvadvpn-d99d60998de6deb9e38af44e901dea38e802a262.zip | |
Consider CARGO_TARGET_DIR in build.sh
| -rw-r--r-- | .gitignore | 7 | ||||
| -rwxr-xr-x | build.sh | 41 | ||||
| -rwxr-xr-x | gui/packages/desktop/electron-builder.yml | 26 |
3 files changed, 52 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore index 9d417da7a0..dd2f9c88cd 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,13 @@ .DS_Store *.log /dist-assets/relays.json +/dist-assets/mullvad +/dist-assets/mullvad-daemon +/dist-assets/problem-report +/dist-assets/libtalpid_openvpn_plugin.dylib +/dist-assets/libtalpid_openvpn_plugin.so +/dist-assets/talpid_openvpn_plugin.dll +/dist-assets/openvpn /windows/**/bin/ **/.vs/ *.bak @@ -15,6 +15,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$SCRIPT_DIR" RUSTC_VERSION=`rustc +stable --version` PRODUCT_VERSION=$(node -p "require('./gui/packages/desktop/package.json').version" | sed -Ee 's/\.0//g') +CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-"$SCRIPT_DIR/target"} source env.sh @@ -116,18 +117,40 @@ MULLVAD_ADD_MANIFEST="1" cargo +stable build --release # Other work to prepare the release. ################################################################################ -# Only strip binaries on platforms other than Windows. -if [[ "$(uname -s)" != "MINGW"* ]]; then +if [[ ("$(uname -s)" == "Darwin") ]]; then binaries=( - ./target/release/mullvad-daemon - ./target/release/mullvad - ./target/release/problem-report + mullvad-daemon + mullvad + problem-report + libtalpid_openvpn_plugin.dylib + ) +elif [[ ("$(uname -s)" == "Linux") ]]; then + binaries=( + mullvad-daemon + mullvad + problem-report + libtalpid_openvpn_plugin.so + ) +elif [[ ("$(uname -s)" == "MINGW"*) ]]; then + binaries=( + mullvad-daemon.exe + mullvad.exe + problem-report.exe + talpid_openvpn_plugin.dll ) - for binary in ${binaries[*]}; do - echo "Stripping debugging symbols from $binary" - strip $binary - done fi +for binary in ${binaries[*]}; do + SRC="$CARGO_TARGET_DIR/release/$binary" + DST="$SCRIPT_DIR/dist-assets/$binary" + if [[ "$(uname -s)" == "MINGW"* || "$binary" == *.dylib ]]; then + echo "Copying $SRC => $DST" + cp "$SRC" "$DST" + else + echo "Stripping $SRC => $DST" + strip "$SRC" -o "$DST" + fi +done + echo "Updating relay list..." set +e diff --git a/gui/packages/desktop/electron-builder.yml b/gui/packages/desktop/electron-builder.yml index c5124623cf..58a49792d5 100755 --- a/gui/packages/desktop/electron-builder.yml +++ b/gui/packages/desktop/electron-builder.yml @@ -39,13 +39,13 @@ mac: LSUIElement: true NSUserNotificationAlertStyle: alert extraResources: - - from: ../../../target/release/mullvad + - from: ../../../dist-assets/mullvad to: . - - from: ../../../target/release/problem-report + - from: ../../../dist-assets/problem-report to: . - - from: ../../../target/release/mullvad-daemon + - from: ../../../dist-assets/mullvad-daemon to: . - - from: ../../../target/release/libtalpid_openvpn_plugin.dylib + - from: ../../../dist-assets/libtalpid_openvpn_plugin.dylib to: . - from: ../../../dist-assets/binaries/macos/openvpn to: . @@ -77,13 +77,13 @@ win: - sha256 signDlls: true extraResources: - - from: ../../../target/release/mullvad.exe + - from: ../../../dist-assets/mullvad.exe to: . - - from: ../../../target/release/problem-report.exe + - from: ../../../dist-assets/problem-report.exe to: . - - from: ../../../target/release/mullvad-daemon.exe + - from: ../../../dist-assets/mullvad-daemon.exe to: . - - from: ../../../target/release/talpid_openvpn_plugin.dll + - from: ../../../dist-assets/talpid_openvpn_plugin.dll to: . - from: ../../../windows/winfw/bin/x64-Release/winfw.dll to: . @@ -101,11 +101,11 @@ linux: artifactName: MullvadVPN-${version}_${arch}.${ext} category: Network extraResources: - - from: ../../../target/release/problem-report + - from: ../../../dist-assets/problem-report to: . - - from: ../../../target/release/mullvad-daemon + - from: ../../../dist-assets/mullvad-daemon to: . - - from: ../../../target/release/libtalpid_openvpn_plugin.so + - from: ../../../dist-assets/libtalpid_openvpn_plugin.so to: . - from: ../../../dist-assets/binaries/linux/openvpn to: . @@ -119,7 +119,7 @@ deb: "--before-remove", "../../../dist-assets/linux/before-remove.sh", "--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.service", "--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.conf", - "../../../target/release/mullvad=/usr/bin/", + "../../../dist-assets/mullvad=/usr/bin/", ] afterInstall: ../../../dist-assets/linux/after-install.sh afterRemove: ../../../dist-assets/linux/after-remove.sh @@ -130,7 +130,7 @@ rpm: "--rpm-posttrans", "../../../dist-assets/linux/post-transaction.sh", "--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.service", "--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.conf", - "../../../target/release/mullvad=/usr/bin/", + "../../../dist-assets/mullvad=/usr/bin/", ] afterInstall: ../../../dist-assets/linux/after-install.sh afterRemove: ../../../dist-assets/linux/after-remove.sh |
