Mesa (master): egl: put full path to libEGL_mesa.so in GLVND json

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Feb 2 18:09:45 UTC 2020


Module: Mesa
Branch: master
Commit: 0021f7dc307f4852955359adb5ac2b7667e6d4ac
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0021f7dc307f4852955359adb5ac2b7667e6d4ac

Author: Eric Engestrom <eric.engestrom at intel.com>
Date:   Fri Dec  6 16:17:12 2019 +0000

egl: put full path to libEGL_mesa.so in GLVND json

This is useful when installing to a non-standard path.

glvnd_icd.py copied & adapted from src/intel/vulkan/anv_icd.py

Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Acked-by: Matt Turner <mattst88 at gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3038>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3038>

---

 src/egl/glvnd_icd.py      | 24 ++++++++++++++++++++++++
 src/egl/main/50_mesa.json |  6 ------
 src/egl/meson.build       | 14 ++++++++++++--
 3 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/src/egl/glvnd_icd.py b/src/egl/glvnd_icd.py
new file mode 100644
index 00000000000..39850873a90
--- /dev/null
+++ b/src/egl/glvnd_icd.py
@@ -0,0 +1,24 @@
+# Copyright 2019 Intel Corporation
+# SPDX-License-Identifier: MIT
+
+import argparse
+import json
+import os.path
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--out', help='Output json file.', required=True)
+    parser.add_argument('--lib-path', help='Path to libEGL_mesa.so', required=True)
+    args = parser.parse_args()
+
+    path = os.path.join(args.lib_path, 'libEGL_mesa.so')
+
+    json_data = {
+        'file_format_version': '1.0.0',
+        'ICD': {
+            'library_path': path,
+        },
+    }
+
+    with open(args.out, 'w') as f:
+        json.dump(json_data, f, indent=4, sort_keys=True, separators=(',', ': '))
diff --git a/src/egl/main/50_mesa.json b/src/egl/main/50_mesa.json
deleted file mode 100644
index 8aaaa100ffa..00000000000
--- a/src/egl/main/50_mesa.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-    "file_format_version" : "1.0.0",
-    "ICD" : {
-        "library_path" : "libEGL_mesa.so.0"
-    }
-}
diff --git a/src/egl/meson.build b/src/egl/meson.build
index 12d74ec37fa..db34453ee9b 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -152,8 +152,18 @@ else
   deps_for_egl += dep_glvnd
   files_egl += [g_egldispatchstubs_h, g_egldispatchstubs_c]
   files_egl += files('main/eglglvnd.c', 'main/egldispatchstubs.c')
-  install_data(
-    'main/50_mesa.json',
+
+  egl_icd = custom_target(
+    'glvnd_icd',
+    input : 'glvnd_icd.py',
+    output : '50_mesa.json',
+    command : [
+      prog_python, '@INPUT@',
+      '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
+      '--out', '@OUTPUT@',
+    ],
+    build_by_default : true,
+    install : true,
     install_dir : join_paths(get_option('datadir'), 'glvnd', 'egl_vendor.d')
   )
 endif



More information about the mesa-commit mailing list