build: use add_dist_script for vendoring

Our workaround for getting meson and cargo working together
included a separate 'release' target that replaced
'ninja dist' so that we could vendor dependencies.

Now we use meson's add_dist_script to vendor the
dependencies as part of 'ninja dist', so we no longer need
the 'release' target.
This commit is contained in:
Christopher Davis
2019-03-07 07:04:23 +02:00
committed by Jordan Petridis
parent 92e2006782
commit 78f29e726e
4 changed files with 16 additions and 36 deletions
+2 -1
View File
@@ -22,4 +22,5 @@ if test -d vendor; then
ARGS+=('--frozen')
fi
cargo build ${ARGS[@]} -p podcasts-gtk && cp $1/target/${TARGET}/podcasts-gtk $2
cargo build ${ARGS[@]} --manifest-path="$1"/Cargo.toml -p podcasts-gtk &&
cp $1/target/${TARGET}/podcasts-gtk $2
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
export SOURCE_ROOT="$1"
export DIST="$2"
cd "$SOURCE_ROOT"
mkdir "$DIST"/.cargo
cargo vendor | sed 's/^directory = ".*"/directory = "vendor"/g' > $DIST/.cargo/config
# Move vendor into dist tarball directory
mv vendor "$DIST"
-32
View File
@@ -1,32 +0,0 @@
#!/bin/sh
VERSION=$1
DEST=${MESON_BUILD_ROOT}
DIST=$DEST/dist/$VERSION
cd "${MESON_SOURCE_ROOT}"
mkdir -p $DIST
# copying files
cp -rf podcasts-data $DIST
cp -rf podcasts-gtk $DIST
cp -rf podcasts-downloader $DIST
cp Cargo.toml $DIST
cp Cargo.lock $DIST
cp meson.build $DIST
cp meson_options.txt $DIST
cp podcasts.doap $DIST
cp LICENSE $DIST
cp README.md $DIST
cp -rf screenshots $DIST
cp -rf scripts $DIST
#cargo vendor
mkdir $DIST/.cargo
cargo vendor | sed 's/^directory = ".*"/directory = "vendor"/g' > $DIST/.cargo/config
cp -rf vendor $DIST/
# packaging
cd $DEST/dist
tar -cJvf $VERSION.tar.xz $VERSION