[PATCH] lvgl.py: install the lvgl headers in PREFIX following a similar tree to the source tree

Vijay Kumar Banerjee vijaykumar9597 at gmail.com
Fri Aug 30 18:32:41 UTC 2019


This is required to be able to add the PREFIX path as the include
path in an lvgl based app.
---
 lvgl.py | 12 ++++++++----
 wscript |  1 -
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lvgl.py b/lvgl.py
index bc3eae2..6d83c63 100644
--- a/lvgl.py
+++ b/lvgl.py
@@ -67,9 +67,13 @@ def build(bld):
     sources, includes = source_list()
     includes.append('.')
     objects = []
+    include_paths = []
 
     for source in sources:
         objects.append(source[:-1] + 'o')
+        source_dir = os.path.dirname(source)
+        if source_dir not in include_paths:
+            include_paths.append(source_dir)
 
     bld.objects(target = objects,
                 features = 'c',
@@ -88,10 +92,10 @@ def build(bld):
     arch_inc_path = rtems.arch_bsp_include_path(bld.env.RTEMS_VERSION,
                                                 bld.env.RTEMS_ARCH_BSP)
 
-    include_paths = ['lv_drivers/display', 'lvgl', 'lv_drivers', 'lvgl/src', '.']
-    include_headers = []
+    include_paths.extend(['lvgl/', 'lv_drivers', 'lvgl/src', '.'])
     for include_path in include_paths:
         files = os.listdir(include_path)
-        include_headers.extend([os.path.join(include_path, x) for x in files if (x[-2:] == '.h')])
+        include_headers = [os.path.join(include_path, x) for x in files if (x[-2:] == '.h')]
+        bld.install_files(os.path.join("${PREFIX}/" , arch_inc_path, include_path),
+                          include_headers)
     bld.install_files('${PREFIX}/' + arch_lib_path, ["liblvgl.a"])
-    bld.install_files("${PREFIX}/" + arch_inc_path, include_headers)
diff --git a/wscript b/wscript
index fb5d932..03e010c 100644
--- a/wscript
+++ b/wscript
@@ -28,7 +28,6 @@
 from __future__ import print_function
 
 import lvgl
-import runpy
 import sys
 
 rtems_version = "5"
-- 
2.20.1



More information about the devel mailing list