[gimp] issue #8274: Port .def files check in meson.



commit 4c77c5acafff3186c0bbc052a42e348ce54807e0
Author: Jehan <jehan girinstud io>
Date:   Sun Jul 31 20:03:12 2022 +0200

    issue #8274: Port .def files check in meson.
    
    The check script now takes into account both the autotools and meson
    file hierarchy (in autotools, built libs are in .libs/ subdirs).
    
    Also it now properly fails on missing lib.

 libgimp/meson.build | 33 +++++++++++++++++++++++++++++++++
 tools/defcheck.py   | 10 ++++++++--
 2 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/libgimp/meson.build b/libgimp/meson.build
index 8f0fffc8db..d379acb328 100644
--- a/libgimp/meson.build
+++ b/libgimp/meson.build
@@ -491,3 +491,36 @@ else
     )
   endif
 endif
+
+if have_python
+  # Check .def files for Windows.
+  custom_target('check-def-files',
+    input: [
+      '../libgimpbase/gimpbase.def',
+      '../libgimpcolor/gimpcolor.def',
+      '../libgimpconfig/gimpconfig.def',
+      '../libgimp/gimp.def',
+      '../libgimp/gimpui.def',
+      '../libgimpmath/gimpmath.def',
+      '../libgimpmodule/gimpmodule.def',
+      '../libgimpthumb/gimpthumb.def',
+      '../libgimpwidgets/gimpwidgets.def',
+    ],
+    depends: [
+      libgimpbase,
+      libgimpcolor,
+      libgimpconfig,
+      libgimp,
+      libgimpui,
+      libgimpmath,
+      libgimpmodule,
+      libgimpthumb,
+      libgimpwidgets
+    ],
+    output: [ 'check-def-files', ],
+    command: [
+      python, meson.source_root() / 'tools' / 'defcheck.py', meson.source_root(),
+    ],
+    build_by_default: true,
+  )
+endif
diff --git a/tools/defcheck.py b/tools/defcheck.py
index 0f6571aa81..3eeaf3168f 100755
--- a/tools/defcheck.py
+++ b/tools/defcheck.py
@@ -84,8 +84,14 @@ for df in def_files:
    status, nm = subprocess.getstatusoutput ("nm --defined-only --extern-only " +
                                             libname)
    if status != 0:
-      print("trouble reading %s - has it been compiled?" % libname)
-      continue
+      libname_meson = path.join(directory, "lib" + basename + "-*.so")
+      print("trouble reading {} - trying {}".format(libname, libname_meson))
+      status, nm = subprocess.getstatusoutput ("nm --defined-only --extern-only " +
+                                               libname_meson)
+      if status != 0:
+        print("trouble reading {} - has it been compiled?".format(libname_meson))
+        have_errors = -1
+        continue
 
    nmsymbols = nm.split()[2::3]
    nmsymbols = [s for s in nmsymbols if s[0] != '_']


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]