blob: 919653bf22b68974d0a66e46af677a049076f53b [file] [log] [blame]
Patrick Williams03907ee2022-05-01 06:28:52 -05001From 06e16da32dfaad02434fd9937d298ea1ece256ce Mon Sep 17 00:00:00 2001
2From: Xavier Claessens <xavier.claessens@collabora.com>
3Date: Sat, 23 Apr 2022 10:33:17 -0400
4Subject: [PATCH 2/2] meson: Various fixes
5
6- Add missing lcms dependencies. That's needed when lcms is a subproject
7 otherwise those targets does not find its headers.
8- Add lcms2 wrap so meson can build it as subproject in case the
9 dependency is not found on system.
10- Fix couple meson warnings
11- Use meson.override_dependency() so babl can be used as subproject
12 without hardcoding "babl_dep" variable name in main project.
13
14Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/babl/-/commit/2dc7fc403fe427a889913ef0cfb71de85b4326ec]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 babl/meson.build | 4 +++-
18 extensions/meson.build | 1 +
19 meson.build | 4 +++-
20 subprojects/lcms2.wrap | 12 ++++++++++++
21 tests/meson.build | 2 +-
22 tools/meson.build | 2 +-
23 6 files changed, 21 insertions(+), 4 deletions(-)
24 create mode 100644 subprojects/lcms2.wrap
25
26diff --git a/babl/meson.build b/babl/meson.build
27index d432dca..70fb131 100644
28--- a/babl/meson.build
29+++ b/babl/meson.build
30@@ -138,7 +138,7 @@ babl = library(
31 link_args: babl_link_args,
32 link_with: simd_extra,
33 dependencies: babl_deps,
34- link_depends: version_script,
35+ link_depends: version_script[0],
36 version: so_version,
37 install: true,
38 )
39@@ -165,4 +165,6 @@ if build_gir
40 install: true,
41 )
42 endif
43+else
44+ babl_gir = []
45 endif
46diff --git a/extensions/meson.build b/extensions/meson.build
47index 23672bb..9935f29 100644
48--- a/extensions/meson.build
49+++ b/extensions/meson.build
50@@ -6,6 +6,7 @@ no_cflags = []
51 babl_ext_dep = [
52 math,
53 thread,
54+ lcms,
55 ]
56
57 # Include directories
58diff --git a/meson.build b/meson.build
59index 2623e93..7e7a935 100644
60--- a/meson.build
61+++ b/meson.build
62@@ -451,6 +451,7 @@ if git_bin.found() and run_command(
63 git_bin,
64 'rev-parse',
65 '--is-inside-work-tree',
66+ check: true,
67 ).returncode() == 0
68 git_version_h = vcs_tag(
69 input : 'git-version.h.in',
70@@ -531,13 +532,14 @@ babl_dep = declare_dependency(
71 link_with : babl,
72 sources: [
73 babl_version_h,
74- is_variable('babl_gir') ? babl_gir : []
75+ build_gir ? babl_gir : []
76 ],
77 variables: {
78 'babl_path' : babl_extensions_build_dir,
79 'babl_libdir' : babl_library_build_dir,
80 },
81 )
82+meson.override_dependency('babl', babl_dep)
83
84 ################################################################################
85 # Build summary
86diff --git a/subprojects/lcms2.wrap b/subprojects/lcms2.wrap
87new file mode 100644
88index 0000000..2cc69df
89--- /dev/null
90+++ b/subprojects/lcms2.wrap
91@@ -0,0 +1,12 @@
92+[wrap-file]
93+directory = Little-CMS-2.12
94+source_url = https://github.com/mm2/Little-CMS/archive/refs/tags/2.12.tar.gz
95+source_filename = lcms2-2.12.tar.gz
96+source_hash = e501f1482fc424550ef3abbf86bf1c66090e1661249e89552d39ed5bf935df66
97+patch_filename = lcms2_2.12-2_patch.zip
98+patch_url = https://wrapdb.mesonbuild.com/v2/lcms2_2.12-2/get_patch
99+patch_hash = 3ac6944ac4b8d8507b85961d98cb287532945183d0e8f094c77810e793b6bebe
100+
101+[provide]
102+lcms2 = liblcms2_dep
103+
104diff --git a/tests/meson.build b/tests/meson.build
105index eee8895..7c67e70 100644
106--- a/tests/meson.build
107+++ b/tests/meson.build
108@@ -42,7 +42,7 @@ foreach test_name : test_names
109 test_name + '.c',
110 include_directories: [rootInclude, bablInclude],
111 link_with: babl,
112- dependencies: thread,
113+ dependencies: [thread, lcms],
114 export_dynamic: true,
115 install: false,
116 )
117diff --git a/tools/meson.build b/tools/meson.build
118index 2719335..89ccf40 100644
119--- a/tools/meson.build
120+++ b/tools/meson.build
121@@ -18,7 +18,7 @@ foreach tool_name : tool_names
122 tool_name + '.c',
123 include_directories: [rootInclude, bablInclude],
124 link_with: babl,
125- dependencies: [math, thread],
126+ dependencies: [math, thread, lcms],
127 install: false,
128 )
129
130--
1312.36.0
132