1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
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
+)
|