From patchwork Sat Jan 2 20:22:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 562103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id A3D1714029E for ; Sun, 3 Jan 2016 07:23:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=SSfxptZq; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id F3620321BB; Sat, 2 Jan 2016 20:23:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J0aG3EbXzt7N; Sat, 2 Jan 2016 20:23:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 57C483204B; Sat, 2 Jan 2016 20:23:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 7481C1C1100 for ; Sat, 2 Jan 2016 20:23:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6E3D286E36 for ; Sat, 2 Jan 2016 20:23:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qvwiihTPvwYJ for ; Sat, 2 Jan 2016 20:23:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 8531886E2E for ; Sat, 2 Jan 2016 20:23:10 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id l65so126510775wmf.1 for ; Sat, 02 Jan 2016 12:23:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=7HOJJjve8MvWGZZDShwublVfuhpvJcdyDPSyc54cYpw=; b=SSfxptZqe7oLD6YgIda0RvLYrQ9uSWDMsacio0bYz3iJNFXPzu97j81lid0T1g8pS7 P+10VMEwyjs/4/XaUQt/b6ggm3oUa2T6UgNo02Gvo+RYiLs1hHFOnFa4YtcoxStX3ip2 8K7DLzCWnuikMgnVpQGMMI2ymC1gHuztNSP5AaU7JhsvzKDE1EQXl8rnZsM9ocM+JbDH qUOEitF67hpdufd1gSPkfatygi2Lfvva2Lt3jfMsE7ij0CJ7kogQnjxNGrbfYohstrfg 23aIpiWiobcYJx/2JazNF57EhaJrb+2IMLfU0wP6E3L1qTF1sr6EhU4UcKFHAYG9y3xf td1w== X-Received: by 10.194.235.137 with SMTP id um9mr22599372wjc.146.1451766189006; Sat, 02 Jan 2016 12:23:09 -0800 (PST) Received: from user-SATELLITE-L50-B.localdomain (x2f0de80.dyn.telefonica.de. [2.240.222.128]) by smtp.gmail.com with ESMTPSA id 193sm31899939wmg.16.2016.01.02.12.23.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 02 Jan 2016 12:23:07 -0800 (PST) From: Yegor Yefremov To: buildroot@buildroot.org Date: Sat, 2 Jan 2016 21:22:54 +0100 Message-Id: <1451766174-7072-1-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 2.1.4 Subject: [Buildroot] [PATCH] Add download helper for PyPi X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" PyPi has following URL structure: https://pypi.python.org/packages/source/{first pkg name char}/{pkg name} User only needs to pass package name to the helper. The helper itself extracts the first package name character and inserts it into download URL together with package name. Usage example: PYTHON_SIX_SITE = $(call pypi,six) Signed-off-by: Yegor Yefremov --- package/pkg-download.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/pkg-download.mk b/package/pkg-download.mk index 1332e66..caaeba5 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -55,6 +55,9 @@ domainseparator = $(if $(1),$(1),/) # github(user,package,version): returns site of GitHub repository github = https://github.com/$(1)/$(2)/archive/$(3) +# pypi(package): returns site of PyPi download location +pypi = https://pypi.python.org/packages/source/$(shell echo $(1) | cut -c1)/$(1) + # Expressly do not check hashes for those files # Exported variables default to immediately expanded in some versions of # make, but we need it to be recursively-epxanded, so explicitly assign it.