From patchwork Thu Aug 22 20:33:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markos Chandras X-Patchwork-Id: 269189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id D7DB72C0099 for ; Fri, 23 Aug 2013 06:33:53 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D741687DCB; Thu, 22 Aug 2013 20:33:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OLum8-kqVX6k; Thu, 22 Aug 2013 20:33:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A929F87ABA; Thu, 22 Aug 2013 20:33:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 08A6B1BF99B for ; Thu, 22 Aug 2013 20:34:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 427A780570 for ; Thu, 22 Aug 2013 20:33:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gxc+j1W3MU+y for ; Thu, 22 Aug 2013 20:33:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by whitealder.osuosl.org (Postfix) with ESMTPS id 365A887ABA for ; Thu, 22 Aug 2013 20:33:50 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id j17so1202274wiw.1 for ; Thu, 22 Aug 2013 13:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=nm0kAvkGlPpujwPiMBgZeXq2kxUx4jRlNKAUzqkAouw=; b=pVr4sguFAbU1+U9dhP1nL2a8Sc7d/Y5/n9gQNdnAHrs95rRqr9G8kL13PyvHEMlCDS D1eH+9kojVicj0Z38smQzl3kV8EhhXsENS/c8B+Wgcyd06hjMrFpdE6vARCWCjhUV9B+ XvqoycmMnhmssCniWJNO+bKShU2c5Q+iwMuTKnQTXBorEs+HZIedSw9kxOv7Jzms/8yv nDekU9/9jqBICl8BRaeTJlFoHwpY8Ux0Ta/Qg2mQHvrb67I+M5IUs7nn4STD7KpBVgzQ 0sC1gPeI1T78r8CV1TRwg76wvRcvJg+SvEihM9LSbwIZe4jFFy5R2+He1STYwz3tcXRH V24A== X-Received: by 10.180.88.40 with SMTP id bd8mr6040292wib.61.1377203628746; Thu, 22 Aug 2013 13:33:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.162.168 with HTTP; Thu, 22 Aug 2013 13:33:08 -0700 (PDT) In-Reply-To: <5215F4F6.4030701@zacarias.com.ar> References: <1377008739-12484-1-git-send-email-markos.chandras@imgtec.com> <521527EC.8000307@mind.be> <5215D75E.5080301@mind.be> <5215F201.6090308@zacarias.com.ar> <5215F336.8050106@mind.be> <5215F4F6.4030701@zacarias.com.ar> From: Markos Chandras Date: Thu, 22 Aug 2013 21:33:08 +0100 Message-ID: To: Gustavo Zacarias Cc: "buildroot@busybox.net" Subject: Re: [Buildroot] [PATCH] python-setuptools: Add patch to prevent detecting the host installation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net On 22 August 2013 12:24, Gustavo Zacarias 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@busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot Hi, The following patch works for me $(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. --- 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" \