File: patch-meson.diff

package info (click to toggle)
glycin 2.0.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,420 kB
  • sloc: python: 418; ansic: 212; xml: 70; makefile: 28; sh: 27; javascript: 10
file content (80 lines) | stat: -rw-r--r-- 2,656 bytes parent folder | download
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
From: Matthias Geiger <werdahias@riseup.net>
Date: Thu, 11 Jan 2024 18:19:47 +0100
Subject: Patch meson.build to allow building in debian

This patch allows building under debian by using a workaround to pass DEB_RUST_HOST
to meson to get the correct installation location.

Forwarded: not-needed
---
 glycin-loaders/meson.build     | 2 +-
 glycin-thumbnailer/meson.build | 2 +-
 libglycin/meson.build          | 2 +-
 meson.build                    | 1 -
 meson_options.txt              | 5 +++++
 5 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/glycin-loaders/meson.build b/glycin-loaders/meson.build
index 8e456ec..80ff0c4 100644
--- a/glycin-loaders/meson.build
+++ b/glycin-loaders/meson.build
@@ -103,7 +103,7 @@ foreach loader : get_option('loaders')
     output: loader,
     command: [
       'cp',
-      cargo_target_dir / rust_target / loader,
+      cargo_target_dir / get_option('host_arch') / 'release' / loader,
       '@OUTPUT@',
     ],
   )
diff --git a/glycin-thumbnailer/meson.build b/glycin-thumbnailer/meson.build
index 44c6fbb..28338e1 100644
--- a/glycin-thumbnailer/meson.build
+++ b/glycin-thumbnailer/meson.build
@@ -29,7 +29,7 @@ custom_target(
     output: 'glycin-thumbnailer',
     command: [
         'cp',
-        cargo_target_dir / rust_target / 'glycin-thumbnailer',
+        cargo_target_dir / get_option('host_arch') / 'release'/ 'glycin-thumbnailer',
         '@OUTPUT@',
     ],
 )
diff --git a/libglycin/meson.build b/libglycin/meson.build
index 209b641..81afe94 100644
--- a/libglycin/meson.build
+++ b/libglycin/meson.build
@@ -70,7 +70,7 @@ foreach package : packages
         endif
     endif
 
-    cargo_output = cargo_target_dir / rust_target / f'libglycin@suffix@.so'.replace('-', '_')
+    cargo_output = cargo_target_dir / get_option('host_arch') / 'release' / f'libglycin@suffix@.so'.replace('-', '_')
 
     # Build library with Rust
     libglycin = custom_target(
diff --git a/meson.build b/meson.build
index 1c36085..dd6a15f 100644
--- a/meson.build
+++ b/meson.build
@@ -29,7 +29,6 @@ cargo_bin = find_program('cargo')
 crate_version_bin = find_program(meson.project_source_root() / 'build-aux/crates-version.py')
 
 cargo_env = environment()
-cargo_env.set('CARGO_HOME', cargo_home)
 
 if get_option('libglycin') and get_option('libglycin-gtk4')
   # Let the libglycin-gtk4 build find the previously built libglycin
diff --git a/meson_options.txt b/meson_options.txt
index d2d368d..5967d4c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -123,3 +123,8 @@ option(
   type: 'boolean',
   description: 'Build thumbnailer',
 )
+
+option(
+  'host_arch',
+  type: 'string',
+)