Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH.
@ 2013-08-22 20:52 Markos Chandras
  2013-08-22 23:24 ` Arnout Vandecappelle
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Markos Chandras @ 2013-08-22 20:52 UTC (permalink / raw)
  To: buildroot

The $(TARGET_DIR) variable is required when building
python-setuptools for the target otherwise the build system detects
the host installation which leads to permission error problems
like these:

Setuptools installation detected at /usr/lib64/python2.7/site-packages
Renaming /usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info to
/usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info.OLD.1377005697.88
OSError: [Errno 13] Permission denied

Moreover, remove the PYTHONPATH variable for host variant since it's
not needed.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 package/python-setuptools/python-setuptools.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/package/python-setuptools/python-setuptools.mk b/package/python-setuptools/python-setuptools.mk
index cd5ee4d..3044b4d 100644
--- a/package/python-setuptools/python-setuptools.mk
+++ b/package/python-setuptools/python-setuptools.mk
@@ -20,19 +20,18 @@ endef
 
 define PYTHON_SETUPTOOLS_BUILD_CMDS
 	(cd $(@D); \
-	PYTHONPATH="/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
+	PYTHONPATH="$(TARGET_DIR))/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
 	$(HOST_DIR)/usr/bin/python setup.py build)
 endef
 
 define HOST_PYTHON_SETUPTOOLS_INSTALL_CMDS
 	(cd $(@D); \
-	PYTHONPATH="$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
 	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
 endef
 
 define PYTHON_SETUPTOOLS_INSTALL_TARGET_CMDS
 	(cd $(@D); \
-	PYTHONPATH="/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
+	PYTHONPATH="$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
 	$(HOST_DIR)/usr/bin/python setup.py install --executable=/usr/bin/python \
 	--single-version-externally-managed --root=/ --prefix=$(TARGET_DIR)/usr)
 endef
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH.
  2013-08-22 20:52 [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH Markos Chandras
@ 2013-08-22 23:24 ` Arnout Vandecappelle
  2013-08-22 23:33   ` Markos Chandras
  2013-08-23  5:01 ` Thomas Petazzoni
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2013-08-22 23:24 UTC (permalink / raw)
  To: buildroot

On 22/08/13 22:52, Markos Chandras wrote:
> The $(TARGET_DIR) variable is required when building
> python-setuptools for the target otherwise the build system detects
> the host installation which leads to permission error problems
> like these:
>
> Setuptools installation detected at /usr/lib64/python2.7/site-packages
> Renaming /usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info to
> /usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info.OLD.1377005697.88
> OSError: [Errno 13] Permission denied
>
> Moreover, remove the PYTHONPATH variable for host variant since it's
> not needed.
>
> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
> ---
>   package/python-setuptools/python-setuptools.mk | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/package/python-setuptools/python-setuptools.mk b/package/python-setuptools/python-setuptools.mk
> index cd5ee4d..3044b4d 100644
> --- a/package/python-setuptools/python-setuptools.mk
> +++ b/package/python-setuptools/python-setuptools.mk
> @@ -20,19 +20,18 @@ endef
>
>   define PYTHON_SETUPTOOLS_BUILD_CMDS
>   	(cd $(@D); \
> -	PYTHONPATH="/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
> +	PYTHONPATH="$(TARGET_DIR))/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \

  Double ) there...


  Regards,
  Arnout

>   	$(HOST_DIR)/usr/bin/python setup.py build)
>   endef
>
>   define HOST_PYTHON_SETUPTOOLS_INSTALL_CMDS
>   	(cd $(@D); \
> -	PYTHONPATH="$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
>   	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
>   endef
>
>   define PYTHON_SETUPTOOLS_INSTALL_TARGET_CMDS
>   	(cd $(@D); \
> -	PYTHONPATH="/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
> +	PYTHONPATH="$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
>   	$(HOST_DIR)/usr/bin/python setup.py install --executable=/usr/bin/python \
>   	--single-version-externally-managed --root=/ --prefix=$(TARGET_DIR)/usr)
>   endef
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH.
  2013-08-22 23:24 ` Arnout Vandecappelle
@ 2013-08-22 23:33   ` Markos Chandras
  0 siblings, 0 replies; 9+ messages in thread
From: Markos Chandras @ 2013-08-22 23:33 UTC (permalink / raw)
  To: buildroot

On 23 August 2013 00:24, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 22/08/13 22:52, Markos Chandras wrote:
>>
>> The $(TARGET_DIR) variable is required when building
>> python-setuptools for the target otherwise the build system detects
>> the host installation which leads to permission error problems
>> like these:
>>
>> Setuptools installation detected at /usr/lib64/python2.7/site-packages
>> Renaming
>> /usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info to
>>
>> /usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info.OLD.1377005697.88
>> OSError: [Errno 13] Permission denied
>>
>> Moreover, remove the PYTHONPATH variable for host variant since it's
>> not needed.
>>
>> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
>> ---
>>   package/python-setuptools/python-setuptools.mk | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/package/python-setuptools/python-setuptools.mk
>> b/package/python-setuptools/python-setuptools.mk
>> index cd5ee4d..3044b4d 100644
>> --- a/package/python-setuptools/python-setuptools.mk
>> +++ b/package/python-setuptools/python-setuptools.mk
>> @@ -20,19 +20,18 @@ endef
>>
>>   define PYTHON_SETUPTOOLS_BUILD_CMDS
>>         (cd $(@D); \
>> -       PYTHONPATH="/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages"
>> \
>> +
>> PYTHONPATH="$(TARGET_DIR))/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages"
>> \
>
>
>  Double ) there...
>

Sorry about that. I guess whoever commit this can fix it on the fly :)

-- 
Regards,
Markos Chandras

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH.
  2013-08-22 20:52 [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH Markos Chandras
  2013-08-22 23:24 ` Arnout Vandecappelle
@ 2013-08-23  5:01 ` Thomas Petazzoni
  2013-08-23 12:50   ` Gustavo Zacarias
  2013-08-23 12:50 ` Gustavo Zacarias
  2013-08-27 20:33 ` Peter Korsgaard
  3 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2013-08-23  5:01 UTC (permalink / raw)
  To: buildroot

Gustavo,

On Thu, 22 Aug 2013 21:52:57 +0100, Markos Chandras wrote:
> The $(TARGET_DIR) variable is required when building
> python-setuptools for the target otherwise the build system detects
> the host installation which leads to permission error problems
> like these:
> 
> Setuptools installation detected at /usr/lib64/python2.7/site-packages
> Renaming /usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info to
> /usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info.OLD.1377005697.88
> OSError: [Errno 13] Permission denied
> 
> Moreover, remove the PYTHONPATH variable for host variant since it's
> not needed.
> 
> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>

Would you mind testing/acking this patch? You've been doing quite some
Python stuff, so I'd appreciate to have your input on this.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH.
  2013-08-23  5:01 ` Thomas Petazzoni
@ 2013-08-23 12:50   ` Gustavo Zacarias
  2013-08-23 13:06     ` Markos Chandras
  0 siblings, 1 reply; 9+ messages in thread
From: Gustavo Zacarias @ 2013-08-23 12:50 UTC (permalink / raw)
  To: buildroot

On 08/23/2013 02:01 AM, Thomas Petazzoni wrote:

> Would you mind testing/acking this patch? You've been doing quite some
> Python stuff, so I'd appreciate to have your input on this.

Looks good in principle.
I'd like another thing fixed since for the target setuptools... purge
the damn windows executables :)
In the host that might not matter much, but for the target we're talking
~ 400 KiB extra nonsense (those cli*.exe and gui*.exe files that are
shipped).
The tests might be another candidate for removal at ~ 200 KiB.
Regards.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH.
  2013-08-22 20:52 [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH Markos Chandras
  2013-08-22 23:24 ` Arnout Vandecappelle
  2013-08-23  5:01 ` Thomas Petazzoni
@ 2013-08-23 12:50 ` Gustavo Zacarias
  2013-08-27 20:33 ` Peter Korsgaard
  3 siblings, 0 replies; 9+ messages in thread
From: Gustavo Zacarias @ 2013-08-23 12:50 UTC (permalink / raw)
  To: buildroot

On 08/22/2013 05:52 PM, Markos Chandras wrote:

> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>

Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

(After fixing the double parenthesis of course).

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH.
  2013-08-23 12:50   ` Gustavo Zacarias
@ 2013-08-23 13:06     ` Markos Chandras
  2013-08-23 13:08       ` Gustavo Zacarias
  0 siblings, 1 reply; 9+ messages in thread
From: Markos Chandras @ 2013-08-23 13:06 UTC (permalink / raw)
  To: buildroot

Hi Gustavo,

On 23 August 2013 13:50, Gustavo Zacarias <gustavo@zacarias.com.ar> wrote:
> Looks good in principle.
> I'd like another thing fixed since for the target setuptools... purge
> the damn windows executables :)
> In the host that might not matter much, but for the target we're talking
> ~ 400 KiB extra nonsense (those cli*.exe and gui*.exe files that are
> shipped).
> The tests might be another candidate for removal at ~ 200 KiB.
> Regards.
>

In Gentoo we have the following patch:

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-python/setuptools/files/setuptools-0.6.45-no-exes.patch?revision=1.2&view=markup

I will test it against buildroot and submit it as a new patch soon.

Thanks for the review.

-- 
Regards,
Markos Chandras

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH.
  2013-08-23 13:06     ` Markos Chandras
@ 2013-08-23 13:08       ` Gustavo Zacarias
  0 siblings, 0 replies; 9+ messages in thread
From: Gustavo Zacarias @ 2013-08-23 13:08 UTC (permalink / raw)
  To: buildroot

On 08/23/2013 10:06 AM, Markos Chandras wrote:
> In Gentoo we have the following patch:
> 
> http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-python/setuptools/files/setuptools-0.6.45-no-exes.patch?revision=1.2&view=markup
> 
> I will test it against buildroot and submit it as a new patch soon.
> 
> Thanks for the review.

That or just add a post install target hook to remove them.
We usually prefer the later since we're poor and few and prefer to avoid
patches that might not apply for version bumps ;)
Regards.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH.
  2013-08-22 20:52 [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH Markos Chandras
                   ` (2 preceding siblings ...)
  2013-08-23 12:50 ` Gustavo Zacarias
@ 2013-08-27 20:33 ` Peter Korsgaard
  3 siblings, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2013-08-27 20:33 UTC (permalink / raw)
  To: buildroot

>>>>> "Markos" == Markos Chandras <markos.chandras@imgtec.com> writes:

 Markos> The $(TARGET_DIR) variable is required when building
 Markos> python-setuptools for the target otherwise the build system detects
 Markos> the host installation which leads to permission error problems
 Markos> like these:

 Markos> Setuptools installation detected at /usr/lib64/python2.7/site-packages
 Markos> Renaming /usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info to
 Markos> /usr/lib64/python2.7/site-packages/setuptools-0.9.8-py2.7.egg-info.OLD.1377005697.88
 Markos> OSError: [Errno 13] Permission denied

 Markos> Moreover, remove the PYTHONPATH variable for host variant since it's
 Markos> not needed.

Committed, thanks (with the double '))' fixed).

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-08-27 20:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 20:52 [Buildroot] [PATCH] python-setuptools: Add missing $(TARGET_DIR) to PYTHONPATH Markos Chandras
2013-08-22 23:24 ` Arnout Vandecappelle
2013-08-22 23:33   ` Markos Chandras
2013-08-23  5:01 ` Thomas Petazzoni
2013-08-23 12:50   ` Gustavo Zacarias
2013-08-23 13:06     ` Markos Chandras
2013-08-23 13:08       ` Gustavo Zacarias
2013-08-23 12:50 ` Gustavo Zacarias
2013-08-27 20:33 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox