summaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2019-10-21 20:31:34 +0800
committerJosef Schlehofer <pepe.schlehofer@gmail.com>2019-10-21 15:27:04 +0200
commit1bacdd52f727c1417b45e4d9d58e3436a9ca06fa (patch)
treee30ae3a526c63a6aa9f91f3af11253dbdb89384d /lang/python
parenta8bf6a8bd64ab0f1896000bc64909b96abbf1e99 (diff)
python,python3: Add PYPI_SOURCE_NAME to pypi.mk
This adds a new (optional) variable, PYPI_SOURCE_NAME, to pypi.mk. For some PyPi packages (e.g. aiohttp_cors, click, django-compressor), the name of the package and the source tarball name are slightly different (usually by capitalisation or hyphen/underscore change). This new variable is to make this difference explicit. PYPI_NAME is meant for the "official" package name, whereas PYPI_SOURCE_NAME is meant for the source tarball name. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/pypi.mk7
1 files changed, 4 insertions, 3 deletions
diff --git a/lang/python/pypi.mk b/lang/python/pypi.mk
index 9a3da5d72..cc0cb7603 100644
--- a/lang/python/pypi.mk
+++ b/lang/python/pypi.mk
@@ -12,12 +12,13 @@ ifndef DUMP
endif
ifneq ($(strip $(PYPI_NAME)),)
+ PYPI_SOURCE_NAME?=$(PYPI_NAME)
PYPI_SOURCE_EXT?=tar.gz
PYPI_NAME_FIRST_LETTER?=$(strip $(foreach a,$(chars_lower) $(chars_upper) 0 1 2 3 4 5 6 7 8 9 _ -,$(if $(PYPI_NAME:$a%=),,$a)))
- PKG_SOURCE?=$(PYPI_NAME)-$(PKG_VERSION).$(PYPI_SOURCE_EXT)
+ PKG_SOURCE?=$(PYPI_SOURCE_NAME)-$(PKG_VERSION).$(PYPI_SOURCE_EXT)
PKG_SOURCE_URL?=https://files.pythonhosted.org/packages/source/$(PYPI_NAME_FIRST_LETTER)/$(PYPI_NAME)
- PKG_BUILD_DIR:=$(BUILD_DIR)/pypi/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PYPI_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
- HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/pypi/$(PYPI_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
+ PKG_BUILD_DIR:=$(BUILD_DIR)/pypi/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PYPI_SOURCE_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
+ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/pypi/$(PYPI_SOURCE_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
endif