File: patch_meson_build.diff

package info (click to toggle)
kooha 2.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,228 kB
  • sloc: xml: 24; makefile: 21; sh: 16
file content (59 lines) | stat: -rw-r--r-- 1,503 bytes parent folder | download | duplicates (2)
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
From: Matthias Geiger <werdahias@debian.org>
Date: Sat, 7 Sep 2024 12:44:01 +0200
Subject: Patch src/meson.build to allow building with debian crates

As we need CARGO_HOME to be set by d/rules we patch it out here.
Furthermore, DEB_HOST_RUST_TYPE is passed to d/rules to set the
correct installation directory

Forwarded: not-needed
---
 meson_options.txt | 4 ++++
 src/meson.build   | 5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/meson_options.txt b/meson_options.txt
index c2e7e6b..23bb5dd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,3 +8,7 @@ option(
   value: 'default',
   description: 'The build profile for Kooha. One of "default" or "development".'
 )
+option(
+  'host_arch',
+  type: 'string',
+  )
diff --git a/src/meson.build b/src/meson.build
index 397b231..72f46e1 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -30,7 +30,6 @@ else
   message('Building in debug mode')
 endif
 
-cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
 
 custom_target(
   'cargo-build',
@@ -43,11 +42,10 @@ custom_target(
   depends: resources,
   command: [
     'env',
-    cargo_env,
     cargo, 'build',
     cargo_options,
     '&&',
-    'cp', 'src' / rust_target / meson.project_name(), '@OUTPUT@',
+    'cp', 'src' / get_option('host_arch') / 'release'/ meson.project_name(), '@OUTPUT@',
   ]
 )
 
@@ -62,7 +60,6 @@ test(
   ],
   env: [
     'RUST_BACKTRACE=1',
-    cargo_env
   ],
   timeout: 300, # give cargo more time
 )