From d0dac5e7ad8f0cb539ba8b56af4d5099f65c7648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Moreno?= Date: Thu, 9 Nov 2017 20:57:21 +0100 Subject: [PATCH] meson release build target that generates tar.gz with vendor --- .gitignore | 1 + configure | 3 +++ meson.build | 5 +++++ scripts/release.sh | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100755 scripts/release.sh diff --git a/.gitignore b/.gitignore index 5aecb404..02ef42e1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ target Makefile _build Cargo.lock +vendor diff --git a/configure b/configure index 19525725..92a07bd2 100755 --- a/configure +++ b/configure @@ -141,6 +141,9 @@ install: uninstall: ${NINJA} ${NINJA_OPT} uninstall +release: + ${NINJA} ${NINJA_OPT} release + check: ${MESONTEST} ${NINJA_OPT} END diff --git a/meson.build b/meson.build index 308a4f4b..4ab6a6f1 100644 --- a/meson.build +++ b/meson.build @@ -29,3 +29,8 @@ cargo_release = custom_target('cargo-build', install: true, install_dir: fractal_bindir, command: ['FRACTAL_RES=' + fractal_datadir, cargo_script, '@CURRENT_SOURCE_DIR@', '@OUTPUT@']) + +run_target('release', command: ['scripts/release.sh', + meson.project_name() + '-' + fractal_version + ], + depends: [cargo_release]) diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 00000000..d04ddac7 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +VERSION=$1 +DEST=${MESON_BUILD_ROOT} +DIST=$DEST/dist/$VERSION + + +cd "${MESON_SOURCE_ROOT}" +mkdir -p $DIST + +# copying files +cp -rf src $DIST +cp build.rs $DIST +cp Cargo.toml $DIST +cp configure $DIST +cp meson.build $DIST +cp fractal.doap $DIST +cp LICENSE.txt $DIST +cp README.md $DIST +cp -rf res $DIST +cp -rf scripts $DIST + +# cargo vendor +cargo vendor +mkdir $DIST/.cargo +cat < $DIST/.cargo/config +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" +EOF +cp -rf vendor $DIST/ + +# packaging +cd $DEST/dist +tar -czvf $VERSION.tar.gz $VERSION