From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> With meson, we have to support out-of-tree build. Fix path lookup. Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> --- pylibfdt/setup.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pylibfdt/setup.py b/pylibfdt/setup.py index 53f2bef..fd50b6c 100755 --- a/pylibfdt/setup.py +++ b/pylibfdt/setup.py @@ -20,22 +20,21 @@ VERSION_PATTERN = '^#define DTC_VERSION "DTC ([^"]*)"$' def get_version(): - version_file = "../version_gen.h" + version_file = "version_gen.h" f = open(version_file, 'rt') m = re.match(VERSION_PATTERN, f.readline()) return m.group(1) setupdir = os.path.dirname(os.path.abspath(sys.argv[0])) -os.chdir(setupdir) libfdt_module = Extension( '_libfdt', - sources=['libfdt.i'], - include_dirs=['../libfdt'], + sources=[os.path.join(setupdir, 'libfdt.i')], + include_dirs=[os.path.join(setupdir, '../libfdt')], libraries=['fdt'], - library_dirs=['../libfdt'], - swig_opts=['-I../libfdt'], + library_dirs=[os.path.join(setupdir, '../libfdt')], + swig_opts=['-I' + os.path.join(setupdir, '../libfdt')], ) setup( @@ -44,5 +43,6 @@ setup( author='Simon Glass <sjg@xxxxxxxxxxxx>', description='Python binding for libfdt', ext_modules=[libfdt_module], + package_dir={'': setupdir}, py_modules=['libfdt'], ) -- 2.23.0