devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tuomas Tynkkynen <tuomas-yrGDUoBaLx3QT0dZR+AlfA@public.gmane.org>
To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: David Gibson
	<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>,
	Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Tuomas Tynkkynen <tuomas-yrGDUoBaLx3QT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] pylibfdt: Fix install location of libfdt.py
Date: Tue, 7 Nov 2017 16:17:41 +0200	[thread overview]
Message-ID: <20171107141741.1733-1-tuomas@tuxera.com> (raw)

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-yrGDUoBaLx3QT0dZR+AlfA@public.gmane.org>
---
 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-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>',
     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

             reply	other threads:[~2017-11-07 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07 14:17 Tuomas Tynkkynen [this message]
     [not found] ` <20171107141741.1733-1-tuomas-yrGDUoBaLx3QT0dZR+AlfA@public.gmane.org>
2017-11-08  2:59   ` [PATCH] pylibfdt: Fix install location of libfdt.py David Gibson
     [not found]     ` <20171108025946.GA7732-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2017-11-08  9:42       ` Tuomas Tynkkynen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171107141741.1733-1-tuomas@tuxera.com \
    --to=tuomas-yrgduobalx3qt0dzr+alfa@public.gmane.org \
    --cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).