Debian Codegraph @

debian/patches/patch-meson-build.diff

raw
1 From: Matthias Geiger <[email protected]>
2 Date: Thu, 8 Aug 2024 18:09:32 +0200
3 Subject: Patch meson.build for building in Debian
4
5 Forwarded: not-needed
6 ---
7 meson.build | 1 -
8 meson_options.txt | 7 ++++++-
9 src/config.rs.in | 2 +-
10 src/meson.build | 7 ++-----
11 4 files changed, 9 insertions(+), 8 deletions(-)
12
13 diff --git a/meson.build b/meson.build
14 index 25d3cde..a6f8eb6 100644
15 --- a/meson.build
16 +++ b/meson.build
17 @@ -20,7 +20,6 @@ name = 'Fragments'
18 base_id = 'de.haeckerfelix.Fragments'
19 path_id = '/de/haeckerfelix/Fragments'
20 app_id = base_id
21 -vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
22 profile = get_option('profile')
23 datadir = join_paths(get_option('prefix'), get_option('datadir'))
24 localedir = join_paths(get_option('prefix'), get_option('localedir'))
25 diff --git a/meson_options.txt b/meson_options.txt
26 index 35c302b..2e2d89f 100644
27 --- a/meson_options.txt
28 +++ b/meson_options.txt
29 @@ -6,4 +6,9 @@ option (
30 'development'
31 ],
32 value: 'default'
33 -)
34 \ No newline at end of file
35 +)
36 +option(
37 + 'host_arch',
38 + type: 'string',
39 + )
40 +
41 diff --git a/src/config.rs.in b/src/config.rs.in
42 index 5358290..eef9380 100644
43 --- a/src/config.rs.in
44 +++ b/src/config.rs.in
45 @@ -4,6 +4,6 @@ pub static APP_ID: &str = @APP_ID@;
46 pub static PATH_ID: &str = @PATH_ID@;
47 pub static VERSION: &str = @VERSION@;
48 pub static PROFILE: &str = @PROFILE@;
49 -pub static VCS_TAG: &str = @VCS_TAG@;
50 +pub static VCS_TAG: &str = "";
51 pub static LOCALEDIR: &str = @LOCALEDIR@;
52 pub static DATADIR: &str = @DATADIR@;
53 diff --git a/src/meson.build b/src/meson.build
54 index 96f692d..9072a9d 100644
55 --- a/src/meson.build
56 +++ b/src/meson.build
57 @@ -6,7 +6,6 @@ conf.set_quoted('APP_ID', app_id)
58 conf.set_quoted('PATH_ID', path_id)
59 conf.set_quoted('VERSION', meson.project_version())
60 conf.set_quoted('PROFILE', profile)
61 -conf.set_quoted('VCS_TAG', vcs_tag)
62 conf.set_quoted('LOCALEDIR', localedir)
63 conf.set_quoted('DATADIR', datadir)
64
65 @@ -25,7 +24,6 @@ run_command(
66
67 # Setup cargo
68 cargo = find_program('cargo')
69 -cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
70 cargo_options = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ]
71 cargo_options += [ '--target-dir', meson.project_build_root() / 'target' ]
72
73 @@ -48,10 +46,9 @@ cargo_release = custom_target(
74 install_dir: bindir,
75 command: [
76 'env',
77 - cargo_env,
78 cargo, 'build',
79 cargo_options,
80 '&&',
81 - 'cp', 'target' / rust_target / meson.project_name(), '@OUTPUT@',
82 + 'cp', meson.project_build_root() / 'target' / get_option('host_arch') / 'release' / 'fragments', '@OUTPUT@',
83 ]
84 -)
85 \ No newline at end of file
86 +)