[PATCH] pylibfdt: Fix install location of libfdt.py

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Currently 'make install' produces a directory tree like this
for the Python module:

$PREFIX
`-- lib
    `-- python2.7
        `-- site-packages
            |-- _libfdt.so
            |-- libfdt-1.4.5-py2.7.egg-info
            `-- pylibfdt
                |-- libfdt.py
                `-- libfdt.pyc

That is, libfdt.py is installed in an unexpected subdirectory pylibfdt
so 'import libfdt' fails. Fix this by properly pointing package_dir to
the root of the Python sources, producing the correct directory tree:

$PREFIX
`-- lib
    `-- python2.7
        `-- site-packages
            |-- _libfdt.so
            |-- libfdt-1.4.5-py2.7.egg-info
            |-- libfdt.py
            `-- libfdt.pyc

Signed-off-by: Tuomas Tynkkynen <tuomas@xxxxxxxxxx>
---
 pylibfdt/Makefile.pylibfdt | 1 -
 pylibfdt/setup.py          | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/pylibfdt/Makefile.pylibfdt b/pylibfdt/Makefile.pylibfdt
index 9507d3d..2843ef5 100644
--- a/pylibfdt/Makefile.pylibfdt
+++ b/pylibfdt/Makefile.pylibfdt
@@ -14,7 +14,6 @@ endef
 $(PYMODULE): $(PYLIBFDT_srcs)
 	@$(VECHO) PYMOD $@
 	$(call run_setup, $^, build_ext --inplace)
-	mv _libfdt.so $@
 
 install_pylibfdt: $(PYMODULE)
 	$(VECHO) INSTALL-PYLIB; \
diff --git a/pylibfdt/setup.py b/pylibfdt/setup.py
index 1a1e832..49ab3cc 100755
--- a/pylibfdt/setup.py
+++ b/pylibfdt/setup.py
@@ -116,6 +116,6 @@ setup(
     author='Simon Glass <sjg@xxxxxxxxxxxx>',
     description='Python binding for libfdt',
     ext_modules=[libfdt_module],
-    package_dir={'': objdir},
-    py_modules=['pylibfdt/libfdt'],
+    package_dir={'': 'pylibfdt'},
+    py_modules=['libfdt'],
 )
-- 
2.15.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux