[3/6] package/python-pycairo: new package
diff mbox series

Message ID 20190531171654.17906-3-matthew.weber@rockwellcollins.com
State Superseded
Headers show
Series
  • [1/6] package/python-colorama: new package
Related show

Commit Message

Matt Weber May 31, 2019, 5:16 p.m. UTC
A Python module providing bindings for the cairo graphics library.

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
 DEVELOPERS                                 |  1 +
 package/Config.in                          |  1 +
 package/python-pycairo/Config.in           |  7 +++++++
 package/python-pycairo/python-pycairo.hash |  5 +++++
 package/python-pycairo/python-pycairo.mk   | 14 ++++++++++++++
 5 files changed, 28 insertions(+)
 create mode 100644 package/python-pycairo/Config.in
 create mode 100644 package/python-pycairo/python-pycairo.hash
 create mode 100644 package/python-pycairo/python-pycairo.mk

Comments

Thomas Petazzoni June 20, 2019, 8:17 p.m. UTC | #1
Hello,

On Fri, 31 May 2019 12:16:51 -0500
Matt Weber <matthew.weber@rockwellcollins.com> wrote:

> diff --git a/package/python-pycairo/Config.in b/package/python-pycairo/Config.in
> new file mode 100644
> index 0000000000..2d44dec85e
> --- /dev/null
> +++ b/package/python-pycairo/Config.in
> @@ -0,0 +1,7 @@
> +config BR2_PACKAGE_PYTHON_PYCAIRO
> +	bool "python-pycairo"
> +	select on BR2_PACKAGE_CAIRO # runtime dependency

"select on" is not correct, it even prevents menuconfig from starting.

Also cairo is not a runtime dependency, but a build time dependency.
With your patch applied, if you do "make python-pycairo" to just build
python-pycairo and its build dependencies, the build fails with:

>>> python-pycairo 1.18.1 Building
(cd /home/thomas/projets/buildroot/output/build/python-pycairo-1.18.1//; _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata_m_linux_arm-linux-gnueabi" PATH="/home/thomas/projets/buildroot/output/host/bin:/home/thomas/projets/buildroot/output/host/sbin:/usr/libexec/python3-sphinx:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/thomas/.rvm/bin:/home/thomas/sys/bin:/home/thomas/.gem/ruby/2.1.0/bin:/home/thomas/.rvm/bin:/home/thomas/.local/bin" PYTHONPATH="/home/thomas/projets/buildroot/output/target/usr/lib/python3.7/" PYTHONNOUSERSITE=1 _python_sysroot=/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot _python_prefix=/usr _python_exec_prefix=/usr  /home/thomas/projets/buildroot/output/host/bin/python setup.py build  )
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/cairo
copying cairo/__init__.py -> build/lib.linux-x86_64-3.7/cairo
copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.7/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-3.7/cairo
running build_ext
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
Package 'cairo', required by 'virtual:world', not found
Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']' returned non-zero exit status 1.

> +PYTHON_PYCAIRO_LICENSE = LGPL-2.0, MPL-1.1

The license is LGPL-2.1 or MPL-1.1

> +PYTHON_PYCAIRO_LICENSE_FILES = COPYING

Please add COPYING-LGPL-2.1 and COPYING-MPL-1.1 to the license files.

Thanks!

Thomas

Patch
diff mbox series

diff --git a/DEVELOPERS b/DEVELOPERS
index 0aa5b1754d..e4c25e1877 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1523,6 +1523,7 @@  F:	package/python-flask-cors/
 F:	package/python-iptables/
 F:	package/python-ipy/
 F:	package/python-posix-ipc/
+F:	package/python-pycairo/
 F:	package/python-pypcap/
 F:	package/python-pyrex/
 F:	package/raptor/
diff --git a/package/Config.in b/package/Config.in
index 13b43ec0dd..d89bbbb4bc 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -980,6 +980,7 @@  menu "External python modules"
 	source "package/python-pyasn-modules/Config.in"
 	source "package/python-pyasn1/Config.in"
 	source "package/python-pyasn1-modules/Config.in"
+	source "package/python-pycairo/Config.in"
 	source "package/python-pycares/Config.in"
 	source "package/python-pycli/Config.in"
 	source "package/python-pycparser/Config.in"
diff --git a/package/python-pycairo/Config.in b/package/python-pycairo/Config.in
new file mode 100644
index 0000000000..2d44dec85e
--- /dev/null
+++ b/package/python-pycairo/Config.in
@@ -0,0 +1,7 @@ 
+config BR2_PACKAGE_PYTHON_PYCAIRO
+	bool "python-pycairo"
+	select on BR2_PACKAGE_CAIRO # runtime dependency
+	help
+	  Python interface for cairo.
+
+	  https://pycairo.readthedocs.io
diff --git a/package/python-pycairo/python-pycairo.hash b/package/python-pycairo/python-pycairo.hash
new file mode 100644
index 0000000000..6da73c04d3
--- /dev/null
+++ b/package/python-pycairo/python-pycairo.hash
@@ -0,0 +1,5 @@ 
+# md5, sha256 from https://pypi.org/pypi/pycairo/json
+md5	7610da8a40a7bed548991aa3416431d1  pycairo-1.18.1.tar.gz
+sha256	70172e58b6bad7572a3518c26729b074acdde15e6fee6cbab6d3528ad552b786  pycairo-1.18.1.tar.gz
+# Locally computed sha256 checksums
+sha256	22c7747e2decb1b26e395b45dbaeb627784ef7fdbf2b80ac09a26a560277e58a  COPYING
diff --git a/package/python-pycairo/python-pycairo.mk b/package/python-pycairo/python-pycairo.mk
new file mode 100644
index 0000000000..be03d58e82
--- /dev/null
+++ b/package/python-pycairo/python-pycairo.mk
@@ -0,0 +1,14 @@ 
+################################################################################
+#
+# python-pycairo
+#
+################################################################################
+
+PYTHON_PYCAIRO_VERSION = 1.18.1
+PYTHON_PYCAIRO_SOURCE = pycairo-$(PYTHON_PYCAIRO_VERSION).tar.gz
+PYTHON_PYCAIRO_SITE = https://files.pythonhosted.org/packages/48/20/5e83af98eb897935bf7dc39455e892ba866feebb9b7c3b392982866f9958
+PYTHON_PYCAIRO_SETUP_TYPE = setuptools
+PYTHON_PYCAIRO_LICENSE = LGPL-2.0, MPL-1.1
+PYTHON_PYCAIRO_LICENSE_FILES = COPYING
+
+$(eval $(python-package))