The following two patches fix the problem with the generation of the
`nm-settings-docs.xml` and `nm-property-docs.xml` files, which made
the meson build port to fail when documentation generation was
enabled.

This patch adds a new optional parameter, `-l` or `--lib-path` that
can be used to pass different paths to be prepended without using the
`LD_LIBRARY_PATH` environment. `LD_LIBRARY_PATH` can still be used but
paths passed as parameters take precedence.

Best regards,
From b2396272e1f8aecd0615bb5e1f18b6e6e8c9d808 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= <[email protected]>
Date: Thu, 14 Dec 2017 12:40:12 +0100
Subject: [PATCH 1/2] build: Library paths as parameters for
 generate-settings-docs.py

generate-settings-docs.py script uses the `LD_LIBRARY_PATH` to
prepend directories to the library search path, which is useful to
load a just built libnm shared library, when generating the
`nm-settings-docs.xml` and `nm-property-docs.xml` files.

However, this is a problem for meson, which is not able to set
environment variables when executing the script.

This patch adds a new optional parameter, `-l` or `--lib-path` that
can be used to pass different paths to be prepended without using
the `LD_LIBRARY_PATH` environment, which can still be used.
---
 libnm/generate-setting-docs.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py
index f888ff223..e96fffad3 100755
--- a/libnm/generate-setting-docs.py
+++ b/libnm/generate-setting-docs.py
@@ -183,6 +183,7 @@ def usage():
     exit()
 
 parser = argparse.ArgumentParser()
+parser.add_argument('-l', '--lib-path', metavar='PATH', action='append', help='path to scan for shared libraries')
 parser.add_argument('-g', '--gir', metavar='FILE', help='NM-1.0.gir file')
 parser.add_argument('-x', '--overrides', metavar='FILE', help='documentation overrides file')
 parser.add_argument('-o', '--output', metavar='FILE', help='output file')
@@ -191,6 +192,9 @@ args = parser.parse_args()
 if args.gir is None or args.output is None:
     usage()
 
+for lib in args.lib_path:
+    GIRepository.Repository.prepend_library_path(lib)
+
 girxml = ET.parse(args.gir).getroot()
 outfile = open(args.output, mode='w')
 
-- 
2.15.1

_______________________________________________
networkmanager-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to