Skip to contentSkip to conversation

package/python3-setuptools: new package

PATCH New james.hilliard1 at gmail.com 3 participants 8 messages Dec 30, 2018 – Jan 1, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/python3-setuptools: new package

From: James Hilliard <[email protected]>

This package is used to build host-python3-setuptools.

---
 package/pkg-python.mk                              |  8 +++++-
 package/python-setuptools/python-setuptools.mk     |  1 +
 .../python3-setuptools/0001-add-executable.patch   |  1 +
 package/python3-setuptools/python3-setuptools.hash |  1 +
 package/python3-setuptools/python3-setuptools.mk   | 31 ++++++++++++++++++++++
 5 files changed, 41 insertions(+), 1 deletion(-)
 create mode 120000 package/python3-setuptools/0001-add-executable.patch
 create mode 120000 package/python3-setuptools/python3-setuptools.hash
 create mode 100644 package/python3-setuptools/python3-setuptools.mk
package/pkg-python.mk +7 -1
index 1ee465b..3f0da61 100644
@@ -187,9 +187,13 @@ endif # ($(4),target)
 # depend on itself!).
 ifeq ($$($(2)_SETUP_TYPE),setuptools)
 ifneq ($(2),HOST_PYTHON_SETUPTOOLS)
+ifeq ($$($(2)_NEEDS_HOST_PYTHON),python3)
+$(2)_DEPENDENCIES += host-python3-setuptools
+else
 $(2)_DEPENDENCIES += host-python-setuptools
 endif
 endif
+endif
 
 # Python interpreter to use for building the package.
 #
@@ -208,7 +212,9 @@ endif
 ifeq ($(4),target)
 $(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/bin/python
 else
-ifeq ($$($(2)_NEEDS_HOST_PYTHON),)
+ifeq ($(2),HOST_PYTHON3_SETUPTOOLS)
+$(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/bin/python3
+else ifeq ($$($(2)_NEEDS_HOST_PYTHON),)
 $(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/bin/python
 else
 $(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/bin/$$($(2)_NEEDS_HOST_PYTHON)
package/python-setuptools/python-setuptools.mk +1 -0
index cc6f991..ae31454 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# When updating this version, please also update it in package/python3-setuptools/
 PYTHON_SETUPTOOLS_VERSION = 40.6.3
 PYTHON_SETUPTOOLS_SOURCE = setuptools-$(PYTHON_SETUPTOOLS_VERSION).zip
 PYTHON_SETUPTOOLS_SITE = https://files.pythonhosted.org/packages/37/1b/b25507861991beeade31473868463dad0e58b1978c209de27384ae541b0b
package/python3-setuptools/0001-add-executable.patch new file +1 -0
new file mode 120000
index 0000000..5bab3d9
@@ -0,0 +1 @@
+../python-setuptools/0001-add-executable.patch
\ No newline at end of file
package/python3-setuptools/python3-setuptools.hash new file +1 -0
new file mode 120000
index 0000000..a3af7f0
@@ -0,0 +1 @@
+../python-setuptools/python-setuptools.hash
\ No newline at end of file
package/python3-setuptools/python3-setuptools.mk new file +31 -0
new file mode 100644
index 0000000..a49e0b1
@@ -0,0 +1,31 @@
+################################################################################
+#
+# python3-setuptools
+#
+################################################################################
+
+# When updating this version, please also update it in package/python-setuptools/
+PYTHON3_SETUPTOOLS_VERSION = 40.6.3
+PYTHON3_SETUPTOOLS_SOURCE = setuptools-$(PYTHON3_SETUPTOOLS_VERSION).zip
+PYTHON3_SETUPTOOLS_DL_SUBDIR = setuptools
+PYTHON3_SETUPTOOLS_SITE = https://files.pythonhosted.org/packages/37/1b/b25507861991beeade31473868463dad0e58b1978c209de27384ae541b0b
+PYTHON3_SETUPTOOLS_LICENSE = MIT
+PYTHON3_SETUPTOOLS_LICENSE_FILES = LICENSE
+PYTHON3_SETUPTOOLS_SETUP_TYPE = setuptools
+
+PYTHON3_SETUPTOOLS_NEEDS_HOST_PYTHON = python3
+
+define PYTHON3_SETUPTOOLS_EXTRACT_CMDS
+	$(UNZIP) -d $(@D) $(PYTHON3_SETUPTOOLS_DL_DIR)/$(PYTHON3_SETUPTOOLS_SOURCE)
+	mv $(@D)/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)/* $(@D)
+	$(RM) -r $(@D)/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)
+endef
+
+define HOST_PYTHON3_SETUPTOOLS_EXTRACT_CMDS
+	$(UNZIP) -d $(@D) $(HOST_PYTHON3_SETUPTOOLS_DL_DIR)/$(PYTHON3_SETUPTOOLS_SOURCE)
+	mv $(@D)/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)/* $(@D)
+	$(RM) -r $(@D)/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)
+endef
+
+$(eval $(python-package))
+$(eval $(host-python-package))
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 package/meson: bump to version 0.49.0

From: James Hilliard <[email protected]>

This version requires host-python3-setuptools.

---
 package/meson/meson.hash | 4 ++--
 package/meson/meson.mk   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
package/meson/meson.hash +2 -2
index a996897..3a5c7dd 100644
@@ -1,4 +1,4 @@
 # Locally calculated after checking pgp signature
-# https://github.com/mesonbuild/meson/releases/download/0.47.2/meson-0.47.2.tar.gz.asc
-sha256 92d8afd921751261e36151643464efd3394162f69efbe8cd53e0a66b1cf395eb meson-0.47.2.tar.gz
+# https://github.com/mesonbuild/meson/releases/download/0.49.0/meson-0.49.0.tar.gz.asc
+sha256 fb0395c4ac208eab381cd1a20571584bdbba176eb562a7efa9cb17cace0e1551 meson-0.49.0.tar.gz
 sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 COPYING
package/meson/meson.mk +1 -1
index 1113bf0..5ac9a1d 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-MESON_VERSION = 0.47.2
+MESON_VERSION = 0.49.0
 MESON_SITE = https://github.com/mesonbuild/meson/releases/download/$(MESON_VERSION)
 MESON_LICENSE = Apache-2.0
 MESON_LICENSE_FILES = COPYING
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 package/meson: bump to version 0.49.0

Hello,

Quoted 9 lines · On Sun, 30 Dec 2018 14:41:35 +0800, james.hilliard1 at gmail.com wrote:

From: James Hilliard <[email protected]>

This version requires host-python3-setuptools.

---
 package/meson/meson.hash | 4 ++--
 package/meson/meson.mk   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 1/2 package/python3-setuptools: new package

In reply to james.hilliard1 at gmail.com

Hello,

Quoted 5 lines · On Sun, 30 Dec 2018 14:41:34 +0800, james.hilliard1 at gmail.com wrote:

From: James Hilliard <[email protected]>

This package is used to build host-python3-setuptools.

I already submitted some similar code just two days ago:

http://patchwork.ozlabs.org/project/buildroot/list/?series=83776

Could you instead test if those patches also work for you ?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/2 package/python3-setuptools: new package

Quoted 8 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · On Sun, 30 Dec 2018 14:41:34 +0800, james.hilliard1 at gmail.com wrote:

From: James Hilliard <[email protected]>

This package is used to build host-python3-setuptools.

Quoted 7 lines
Quoted 1 line

I already submitted some similar code just two days ago:

http://patchwork.ozlabs.org/project/buildroot/list/?series=83776

Could you instead test if those patches also work for you ?

Looks good, I was able to successfully do a clean build with my meson version bump patch on top.

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#5 lore raw

PATCH 1/2 package/python3-setuptools: new package

Hello,

Quoted 3 lines · James Hilliard
Quoted 1 line

Could you instead test if those patches also work for you ?

Looks good, I was able to successfully do a clean build with my meson version bump patch on top.

Thanks for the confirmation. Do you know what changed in Meson that makes it *require* setuptools? As I explained in the cover letter of my Python 3 Setuptools series, meson (at least in the version we currently have in Buildroot) uses setuptools if available, and otherwise falls back to distutils, which is why it has been working well so far without a python3-setuptools package.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

PATCH 1/2 package/python3-setuptools: new package

Hello,

Quoted 9 lines · Thomas Petazzoni

Hello,

Quoted 3 lines · James Hilliard
Quoted 1 line

Could you instead test if those patches also work for you ?

Looks good, I was able to successfully do a clean build with my meson version bump patch on top.

Quoted 6 lines

Thanks for the confirmation. Do you know what changed in Meson that makes it *require* setuptools? As I explained in the cover letter of my Python 3 Setuptools series, meson (at least in the version we currently have in Buildroot) uses setuptools if available, and otherwise falls back to distutils, which is why it has been working well so far without a python3-setuptools package.

I don't heavily use the meson build system, but after looking at the history of setup.py in the official repository,
I found the commit which made the change. At the commit message they stated that:
"This gives us a consistent experience and a simpler setup across all operating systems. Setuptools is available everywhere these days." The change is relevant since 0.48.

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Regards,
Asaf.

#7 lore raw

PATCH 1/2 package/python3-setuptools: new package

Hello,

+Yegor in Cc.

Quoted 7 lines · Asaf Kahlon

I don't heavily use the meson build system, but after looking at the history of setup.py in the official repository,
I found the commit which made the change. At the commit message they stated that:
"This gives us a consistent experience and a simpler setup across all operating systems. Setuptools is available everywhere these days." The change is relevant since 0.48.

Indeed, upstream commit 86298f2109d215ad6b26d3462af7b685d52d0dd7 drops the fallback on distutils, and only setuptools is supported now. This makes my patch series introducing python3-setuptools even more relevant then. I would like to see a review from Yegor on this series first, as he has lots of background in the Python integration in Buildroot.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com