From: Matthias Geiger <werdahias@debian.org>
Date: Thu, 8 Aug 2024 18:09:32 +0200
Subject: Patch meson.build for building in Debian

Forwarded: not-needed
---
 meson.build       | 1 -
 meson_options.txt | 7 ++++++-
 src/config.rs.in  | 2 +-
 src/meson.build   | 7 ++-----
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/meson.build b/meson.build
index 25d3cde..a6f8eb6 100644
--- a/meson.build
+++ b/meson.build
@@ -20,7 +20,6 @@ name       = 'Fragments'
 base_id    = 'de.haeckerfelix.Fragments'
 path_id    = '/de/haeckerfelix/Fragments'
 app_id     = base_id
-vcs_tag    = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
 profile    = get_option('profile')
 datadir    = join_paths(get_option('prefix'), get_option('datadir'))
 localedir  = join_paths(get_option('prefix'), get_option('localedir'))
diff --git a/meson_options.txt b/meson_options.txt
index 35c302b..2e2d89f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,4 +6,9 @@ option (
     'development'
   ],
   value: 'default'
-)
\ No newline at end of file
+)
+option(
+  'host_arch',
+  type: 'string',
+  )
+
diff --git a/src/config.rs.in b/src/config.rs.in
index 5358290..eef9380 100644
--- a/src/config.rs.in
+++ b/src/config.rs.in
@@ -4,6 +4,6 @@ pub static APP_ID: &str = @APP_ID@;
 pub static PATH_ID: &str = @PATH_ID@;
 pub static VERSION: &str = @VERSION@;
 pub static PROFILE: &str = @PROFILE@;
-pub static VCS_TAG: &str = @VCS_TAG@;
+pub static VCS_TAG: &str = "";
 pub static LOCALEDIR: &str = @LOCALEDIR@;
 pub static DATADIR: &str = @DATADIR@;
diff --git a/src/meson.build b/src/meson.build
index 96f692d..9072a9d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -6,7 +6,6 @@ conf.set_quoted('APP_ID', app_id)
 conf.set_quoted('PATH_ID', path_id)
 conf.set_quoted('VERSION', meson.project_version())
 conf.set_quoted('PROFILE', profile)
-conf.set_quoted('VCS_TAG', vcs_tag)
 conf.set_quoted('LOCALEDIR', localedir)
 conf.set_quoted('DATADIR', datadir)
 
@@ -25,7 +24,6 @@ run_command(
 
 # Setup cargo
 cargo = find_program('cargo')
-cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
 cargo_options = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ]
 cargo_options += [ '--target-dir', meson.project_build_root() / 'target' ]
 
@@ -48,10 +46,9 @@ cargo_release = custom_target(
   install_dir: bindir,
   command: [
     'env',
-    cargo_env,
     cargo, 'build',
     cargo_options,
     '&&',
-    'cp', 'target' / rust_target / meson.project_name(), '@OUTPUT@',
+    'cp', meson.project_build_root() / 'target' / get_option('host_arch') / 'release' / 'fragments', '@OUTPUT@',
   ]
-)
\ No newline at end of file
+)
