Merge branch 'patch-1' into 'master'

Support vendored builds / distribution packaging

See merge request World/podcasts!85
This commit is contained in:
Jordan Petridis 2018-11-30 11:25:59 +00:00
commit 2f843a4d40

View File

@ -1,4 +1,6 @@
#!/bin/sh #!/bin/bash
set -ex
export CARGO_HOME=$1/target/cargo-home export CARGO_HOME=$1/target/cargo-home
export LOCALEDIR="$3" export LOCALEDIR="$3"
@ -6,11 +8,18 @@ export APP_ID="$4"
export VERSION="$5" export VERSION="$5"
export PROFILE="$6" export PROFILE="$6"
if [[ "$PROFILE" == "Devel" ]] TARGET=debug
then ARGS=()
echo "DEBUG MODE"
cargo build -p podcasts-gtk && cp $1/target/debug/podcasts-gtk $2 if test "$PROFILE" != "Devel"; then
else
echo "RELEASE MODE" echo "RELEASE MODE"
cargo build --release -p podcasts-gtk && cp $1/target/release/podcasts-gtk $2 ARGS+=('--release')
fi TARGET=release
fi
if test -d vendor; then
echo "VENDORED"
ARGS+=('--frozen')
fi
cargo build ${ARGS[@]} -p podcasts-gtk && cp $1/target/${TARGET}/podcasts-gtk $2