]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala/meson.build: Use Python to generate libvala-0.xx.vapi
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 24 Jan 2022 11:14:57 +0000 (19:14 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 28 Jan 2022 08:16:43 +0000 (16:16 +0800)
This way, we do not need to depend on the 'cat' utility program which is
not readily available on Windows unless one is using MSYS2 or Cygwin.

vala/generate-libvala-vapi.py [new file with mode: 0644]
vala/meson.build

diff --git a/vala/generate-libvala-vapi.py b/vala/generate-libvala-vapi.py
new file mode 100644 (file)
index 0000000..a8b802f
--- /dev/null
@@ -0,0 +1,13 @@
+#! /usr/bin/env python3
+
+# Generate libvala-0.xx.vapi from dependent vapi's
+
+import os
+import sys
+
+def generate_libvala_vapi(argv):
+    for f in argv[1:]:
+        with open(f, 'r') as l:
+            print(l.read())
+
+sys.exit(generate_libvala_vapi(sys.argv))
\ No newline at end of file
index 3352df20c8df4c46f219c93893c83f7241fb2abf..c3461321360ed2821d0c2a2ac80ce7f8540b7349 100644 (file)
@@ -197,7 +197,7 @@ valacore_dep = declare_dependency(
 custom_target(
        'libvala@0@.vapi'.format(vala_version_suffix),
        command: [
-               find_program('cat'),
+               find_program('generate-libvala-vapi.py'),
                join_paths(meson.build_root(), 'gee', 'gee.vapi'),
                join_paths(meson.current_build_dir(), 'vala.vapi'),
        ],