meson: Various fixes
authorXavier Claessens <xavier.claessens@collabora.com>
Sat, 23 Apr 2022 14:33:17 +0000 (10:33 -0400)
committerØyvind Kolås <pippin@gimp.org>
Mon, 25 Apr 2022 03:33:26 +0000 (05:33 +0200)
- Add missing lcms dependencies. That's needed when lcms is a subproject
  otherwise those targets does not find its headers.
- Add lcms2 wrap so meson can build it as subproject in case the
  dependency is not found on system.
- Fix couple meson warnings
- Use meson.override_dependency() so babl can be used as subproject
  without hardcoding "babl_dep" variable name in main project.

babl/meson.build
extensions/meson.build
meson.build
subprojects/lcms2.wrap [new file with mode: 0644]
tests/meson.build
tools/meson.build

index d432dca6dc36921a96f38bb62e0d0cc7c416a32b..70fb13144d9a1315e54d5d9defc00e103e1769e7 100644 (file)
@@ -138,7 +138,7 @@ babl = library(
   link_args: babl_link_args,
   link_with: simd_extra,
   dependencies: babl_deps,
-  link_depends: version_script,
+  link_depends: version_script[0],
   version: so_version,
   install: true,
 )
@@ -165,4 +165,6 @@ if build_gir
       install: true,
     )
   endif
+else
+  babl_gir = []
 endif
index 23672bb516add183ffa76a00d577c123c0a50d3f..9935f29e9650cdadb8914375b7c998378e525eb2 100644 (file)
@@ -6,6 +6,7 @@ no_cflags = []
 babl_ext_dep = [
   math,
   thread,
+  lcms,
 ]
 
 # Include directories
index 8c93be9d1b22a7b105a51d4eb9f4db7f75702a24..002d969cfa9352a51cceb459cff87b6d33c4fcee 100644 (file)
@@ -451,6 +451,7 @@ if git_bin.found() and run_command(
     git_bin,
     'rev-parse',
     '--is-inside-work-tree',
+    check: true,
 ).returncode() == 0
   git_version_h = vcs_tag(
     input : 'git-version.h.in',
@@ -531,13 +532,14 @@ babl_dep = declare_dependency(
   link_with : babl,
   sources: [
     babl_version_h,
-    is_variable('babl_gir') ? babl_gir : []
+    build_gir ? babl_gir : []
   ],
   variables: {
     'babl_path'   : babl_extensions_build_dir,
     'babl_libdir' : babl_library_build_dir,
   },
 )
+meson.override_dependency('babl', babl_dep)
 
 ################################################################################
 # Build summary
diff --git a/subprojects/lcms2.wrap b/subprojects/lcms2.wrap
new file mode 100644 (file)
index 0000000..2cc69df
--- /dev/null
@@ -0,0 +1,12 @@
+[wrap-file]
+directory = Little-CMS-2.12
+source_url = https://github.com/mm2/Little-CMS/archive/refs/tags/2.12.tar.gz
+source_filename = lcms2-2.12.tar.gz
+source_hash = e501f1482fc424550ef3abbf86bf1c66090e1661249e89552d39ed5bf935df66
+patch_filename = lcms2_2.12-2_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/lcms2_2.12-2/get_patch
+patch_hash = 3ac6944ac4b8d8507b85961d98cb287532945183d0e8f094c77810e793b6bebe
+
+[provide]
+lcms2 = liblcms2_dep
+
index eee88956e5c680d455c8fd4be847b06f5b458a3a..7c67e70998de8d1c2a3ec47e7f0d211ca4d746cb 100644 (file)
@@ -42,7 +42,7 @@ foreach test_name : test_names
     test_name + '.c',
     include_directories: [rootInclude, bablInclude],
     link_with: babl,
-    dependencies: thread,
+    dependencies: [thread, lcms],
     export_dynamic: true,
     install: false,
   )
index 2719335ecbfba5d081d33e7ad8a3dad5a1288080..89ccf40866a63f58d31bb275f0d252334b81f22b 100644 (file)
@@ -18,7 +18,7 @@ foreach tool_name : tool_names
     tool_name + '.c',
     include_directories: [rootInclude, bablInclude],
     link_with: babl,
-    dependencies: [math, thread],
+    dependencies: [math, thread, lcms],
     install: false,
   )