python-setuptools,python-pip: Change prefix to /usr
authorJeffery To <jeffery.to@gmail.com>
Wed, 29 May 2019 14:38:30 +0000 (22:38 +0800)
committerJeffery To <jeffery.to@gmail.com>
Wed, 29 May 2019 14:38:30 +0000 (22:38 +0800)
This changes the --prefix option, passed to host pip when "installing"
target setuptools and pip, to /usr, in case the prefix is recorded in
the packages.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
lang/python/python/Makefile
lang/python/python/files/python-package-pip.mk
lang/python/python/files/python-package-setuptools.mk
lang/python/python3/Makefile
lang/python/python3/files/python3-package-pip.mk
lang/python/python3/files/python3-package-setuptools.mk

index 0654b3f8e09bd2edce96bc2d343846a771736621..9350f490cd270d690cb59e348e8c52ccff28129c 100644 (file)
@@ -175,9 +175,10 @@ define Build/Compile/python-setuptools
                --cache-dir "$(DL_DIR)/pip-cache" \
                install \
                --ignore-installed \
-               --root=$(PKG_BUILD_DIR)/install-setuptools --prefix=. \
+               --root=$(PKG_BUILD_DIR)/install-setuptools \
+               --prefix=/usr \
                $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-$(PYTHON_SETUPTOOLS_VERSION)-py2.py3-none-any.whl
-       $(call PatchDir,$(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages,./patches-setuptools,)
+       $(call PatchDir,$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON_VERSION)/site-packages,./patches-setuptools,)
 endef
 endif # CONFIG_PACKAGE_python-setuptools
 
@@ -188,9 +189,10 @@ define Build/Compile/python-pip
                --cache-dir "$(DL_DIR)/pip-cache" \
                install \
                --ignore-installed \
-               --root=$(PKG_BUILD_DIR)/install-pip --prefix=. \
+               --root=$(PKG_BUILD_DIR)/install-pip \
+               --prefix=/usr \
                $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON_PIP_VERSION)-py2.py3-none-any.whl
-       $(call PatchDir,$(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON_VERSION)/site-packages,./patches-pip,)
+       $(call PatchDir,$(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON_VERSION)/site-packages,./patches-pip,)
 endef
 endif # CONFIG_PACKAGE_python-pip
 
index fecc5d901d8fcd6bc59c7a3029f17e75e59c0c18..0a8b69a6ade03318ffa09873c6ad087478ad1209 100644 (file)
@@ -17,10 +17,10 @@ endef
 
 define PyPackage/python-pip/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
-       $(CP) $(PKG_BUILD_DIR)/install-pip/bin/* $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/install-pip/usr/bin/* $(1)/usr/bin
        $(CP) \
-               $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON_VERSION)/site-packages/pip \
-               $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON_VERSION)/site-packages/pip-$(PYTHON_PIP_VERSION).dist-info \
+               $(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON_VERSION)/site-packages/pip \
+               $(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON_VERSION)/site-packages/pip-$(PYTHON_PIP_VERSION).dist-info \
                $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/
 endef
 
index c6d951a551577116eab72b5a32207164aaee9e40..95951ececbb0effdb0c4df2ccd9fab2ce131c78a 100644 (file)
@@ -17,12 +17,12 @@ endef
 
 define PyPackage/python-setuptools/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
-       $(CP) $(PKG_BUILD_DIR)/install-setuptools/bin/* $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/install-setuptools/usr/bin/* $(1)/usr/bin
        $(CP) \
-               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/pkg_resources \
-               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/setuptools \
-               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/setuptools-$(PYTHON_SETUPTOOLS_VERSION).dist-info \
-               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/easy_install.py \
+               $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON_VERSION)/site-packages/pkg_resources \
+               $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON_VERSION)/site-packages/setuptools \
+               $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON_VERSION)/site-packages/setuptools-$(PYTHON_SETUPTOOLS_VERSION).dist-info \
+               $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON_VERSION)/site-packages/easy_install.py \
                $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
 endef
 
index 6ae2add1b192bcfbac2b9925f625b192d929185e..0743ebdf2f0e8b8ed28980b7dd94a4a8a80c007e 100644 (file)
@@ -179,9 +179,10 @@ define Build/Compile/python3-setuptools
                --cache-dir "$(DL_DIR)/pip-cache" \
                install \
                --ignore-installed \
-               --root=$(PKG_BUILD_DIR)/install-setuptools --prefix=. \
+               --root=$(PKG_BUILD_DIR)/install-setuptools \
+               --prefix=/usr \
                $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)-py2.py3-none-any.whl
-       $(call PatchDir,$(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages,./patches-setuptools,)
+       $(call PatchDir,$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages,./patches-setuptools,)
 endef
 endif # CONFIG_PACKAGE_python3-setuptools
 
@@ -192,9 +193,10 @@ define Build/Compile/python3-pip
                --cache-dir "$(DL_DIR)/pip-cache" \
                install \
                --ignore-installed \
-               --root=$(PKG_BUILD_DIR)/install-pip --prefix=. \
+               --root=$(PKG_BUILD_DIR)/install-pip \
+               --prefix=/usr \
                $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON3_PIP_VERSION)-py2.py3-none-any.whl
-       $(call PatchDir,$(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON3_VERSION)/site-packages,./patches-pip,)
+       $(call PatchDir,$(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages,./patches-pip,)
 endef
 endif # CONFIG_PACKAGE_python3-pip
 
index 9f942c660054247a89a8aed4ebf47bf1482de21f..33f30abfa660a9564c6457d21c78f6695d19bfcf 100644 (file)
@@ -17,10 +17,10 @@ endef
 
 define Py3Package/python3-pip/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
-       $(CP) $(PKG_BUILD_DIR)/install-pip/bin/pip3* $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/install-pip/usr/bin/pip3* $(1)/usr/bin
        $(CP) \
-               $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON3_VERSION)/site-packages/pip \
-               $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON3_VERSION)/site-packages/pip-$(PYTHON3_PIP_VERSION).dist-info \
+               $(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages/pip \
+               $(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages/pip-$(PYTHON3_PIP_VERSION).dist-info \
                $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/
        for _ in \$(seq 1 10) ; do \
                find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -name __pycache__ -exec rm -rf {} \; || continue ; \
index ce1fb5c1168e38005902c98d22401b93b287b646..ead95100681a35829e2bd7ed84eb28de992b8441 100644 (file)
@@ -17,13 +17,13 @@ endef
 
 define Py3Package/python3-setuptools/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
-       $(CP) $(PKG_BUILD_DIR)/install-setuptools/bin/easy_install-* $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/install-setuptools/usr/bin/easy_install-* $(1)/usr/bin
        $(LN) easy_install-$(PYTHON3_VERSION) $(1)/usr/bin/easy_install-3
        $(CP) \
-               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/pkg_resources \
-               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/setuptools \
-               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/setuptools-$(PYTHON3_SETUPTOOLS_VERSION).dist-info \
-               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/easy_install.py \
+               $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/pkg_resources \
+               $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools \
+               $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools-$(PYTHON3_SETUPTOOLS_VERSION).dist-info \
+               $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/easy_install.py \
                $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
        for _ in \$(seq 1 10) ; do \
                find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -name __pycache__ -exec rm -rf {} \; || continue ; \