[Buildroot] [PATCH] python-setuptools: Add patch to prevent detecting the host installation

Markos Chandras markos.chandras at gmail.com
Thu Aug 22 20:33:08 UTC 2013


On 22 August 2013 12:24, Gustavo Zacarias <gustavo at zacarias.com.ar> wrote:
> On 08/22/2013 08:17 AM, Arnout Vandecappelle wrote:
>
>>  Markos's patch, or a yet-to-be-created patch that adds $(TARGET_DIR) to
>> the PYTHONPATH instead of passing the system's pythonpath?
>
> That's possible too, testing required :)
>
>>  Actually I didn't realize the PYTHONPATH setting for the host variant
>> was redundant :-)  I was only talking about the target.
>
> PYTHONPATH for the target is required because it's sometimes hardcoded
> in installed packages unfortunately - i don't recall the exact
> combination that triggered it at the moment, or it may have been some
> additional python package that i used for testing and never sent
> (useless, not interesting) when fixing the shebang and other details.
>
>>  But I guess that is a separate patch.
>>
>>  Anyway I'm not sure if the target variant is that relevant, because it
>> will not be able to install anything that requires compilation...
>
> Yes, something for someone to up their buildroot cred :)
> I'm unsure if we want to encourage the target setuptools, there are
> packages that'll install fine, and as you say the compiler ones will
> fail miserably.
> I'd keep it to avoid unnecessary noise and complaints with a big fat
> warning that it's not the buildroot way and it's just for convenience
> (and to forget about the target toolchain!).
> Regards.
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

Hi,

The following patch works for me

--- 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)


Host variant is installed in
output/host/usr/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg
and target variant in output/target/usr/lib/python2.7/site-packages/setuptools

What do you think? I think the 'target variant' of setuptools can be
removed in a subsequent patch if necessary.

-- 
Regards,
Markos Chandras



More information about the buildroot mailing list