From 2e237d41e8317d5b040e29a7744185d31addfb03 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sun, 2 Apr 2023 17:45:51 -0400 Subject: [PATCH] build: Add dist script This script will vendor the Rust dependencies of the app so that our tarballs can be built offline. --- build-aux/meson/dist-vendor.sh | 9 +++++++++ meson.build | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100644 build-aux/meson/dist-vendor.sh diff --git a/build-aux/meson/dist-vendor.sh b/build-aux/meson/dist-vendor.sh new file mode 100644 index 0000000..59580a9 --- /dev/null +++ b/build-aux/meson/dist-vendor.sh @@ -0,0 +1,9 @@ +#!/bin/sh +export DIST="$1" +export SOURCE_ROOT="$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" diff --git a/meson.build b/meson.build index 22b5da5..b7faa87 100644 --- a/meson.build +++ b/meson.build @@ -66,3 +66,9 @@ gnome.post_install( glib_compile_schemas: true, update_desktop_database: true, ) + +meson.add_dist_script( + 'build-aux/meson/dist-vendor.sh', + join_paths(meson.project_build_root(), 'meson-dist', meson.project_name() + '-' + meson.project_version()), + meson.source_root() +) \ No newline at end of file