pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-pynest2d: Import py-pynest2d-4.11.0 as wip/py-pynest2d



Module Name:	pkgsrc-wip
Committed By:	Atsushi Toyokura <asteria.at%gmail.com@localhost>
Pushed By:	steleto
Date:		Sat Nov 6 18:29:18 2021 +0900
Changeset:	32edaf18a830b8ffd735ae9e04fa231025f993d9

Modified Files:
	Makefile
Added Files:
	py-pynest2d/DESCR
	py-pynest2d/Makefile
	py-pynest2d/PLIST
	py-pynest2d/buildlink3.mk
	py-pynest2d/distinfo
	py-pynest2d/patches/patch-cmake_FindClipper.cmake
	py-pynest2d/patches/patch-cmake_FindNLopt.cmake

Log Message:
py-pynest2d: Import py-pynest2d-4.11.0 as wip/py-pynest2d

This repository contains CPython bindings for libnest2d
(https://github.com/tamasmeszaros/libnest2d), a library to pack 2D
polygons into a small space. Libnest2d implements the 2D bin packing
problem.

The objective of this repository is to allow libnest2d to be called
from Python using Numpy. There is a competing solution
(https://github.com/markfink/nest2D) to provide Python bindings to
this end. However this solution is licensed under AGPL. Since Cura
(https://github.com/Ultimaker/Cura) uses an LGPL license, it could not
use that solution. This implementation is also too limited for Cura's
purposes, so a new bindings project was set up that allows more
configuration of the nesting algorithm.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=32edaf18a830b8ffd735ae9e04fa231025f993d9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                          |  1 +
 py-pynest2d/DESCR                                 | 13 ++++++++
 py-pynest2d/Makefile                              | 36 +++++++++++++++++++++++
 py-pynest2d/PLIST                                 |  2 ++
 py-pynest2d/buildlink3.mk                         | 15 ++++++++++
 py-pynest2d/distinfo                              |  7 +++++
 py-pynest2d/patches/patch-cmake_FindClipper.cmake | 24 +++++++++++++++
 py-pynest2d/patches/patch-cmake_FindNLopt.cmake   | 24 +++++++++++++++
 8 files changed, 122 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index e55a423d4d..e9f1428dd1 100644
--- a/Makefile
+++ b/Makefile
@@ -4373,6 +4373,7 @@ SUBDIR+=	py-pymbolic
 SUBDIR+=	py-pymdown-extensions
 SUBDIR+=	py-pymigemo
 SUBDIR+=	py-pymvpa
+SUBDIR+=	py-pynest2d
 SUBDIR+=	py-pynfo
 SUBDIR+=	py-pynn
 SUBDIR+=	py-pyon
diff --git a/py-pynest2d/DESCR b/py-pynest2d/DESCR
new file mode 100644
index 0000000000..0a4623876f
--- /dev/null
+++ b/py-pynest2d/DESCR
@@ -0,0 +1,13 @@
+This repository contains CPython bindings for libnest2d
+(https://github.com/tamasmeszaros/libnest2d), a library to pack 2D
+polygons into a small space. Libnest2d implements the 2D bin packing
+problem.
+
+The objective of this repository is to allow libnest2d to be called
+from Python using Numpy. There is a competing solution
+(https://github.com/markfink/nest2D) to provide Python bindings to
+this end. However this solution is licensed under AGPL. Since Cura
+(https://github.com/Ultimaker/Cura) uses an LGPL license, it could not
+use that solution. This implementation is also too limited for Cura's
+purposes, so a new bindings project was set up that allows more
+configuration of the nesting algorithm.
diff --git a/py-pynest2d/Makefile b/py-pynest2d/Makefile
new file mode 100644
index 0000000000..5282eb006a
--- /dev/null
+++ b/py-pynest2d/Makefile
@@ -0,0 +1,36 @@
+# $NetBSD$
+
+GITHUB_PROJECT=	pynest2d
+GITHUB_TAG=	4.11.0
+DISTNAME=	${GITHUB_TAG}
+PKGNAME=	${PYPKGPREFIX}-${GITHUB_PROJECT}-${DISTNAME}
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_GITHUB:=Ultimaker/}
+DIST_SUBDIR=	${GITHUB_PROJECT}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/Ultimaker/pynest2d/
+COMMENT=	Python bindings for libnest2d
+LICENSE=	gnu-lgpl-v3
+
+USE_CMAKE=	yes
+USE_LANGUAGES=	c c++
+
+SUBST_CLASSES+=		sip
+SUBST_STAGE.sip=	pre-configure
+SUBST_MESSAGE.sip=	Rename py-sip name.
+SUBST_FILES.sip=	cmake/FindSIP.cmake
+SUBST_SED.sip=		-e 's|\(SIP_EXECUTABLE sip\)|\1${PYVERSSUFFIX}|'
+
+SUBST_CLASSES+=			fix-paths
+SUBST_STAGE.fix-paths=		pre-configure
+SUBST_MESSAGE.fix-paths=	Fixing absolute paths.
+SUBST_FILES.fix-paths=		cmake/FindClipper.cmake
+SUBST_FILES.fix-paths+=		cmake/FindNLopt.cmake
+SUBST_SED.fix-paths=		-e "s,@prefix@,${PREFIX},g"
+
+PY_PATCHPLIST=YES
+.include "../../lang/python/extension.mk"
+.include "../../wip/libnest2d-ultimaker/buildlink3.mk"
+.include "../../x11/py-sip/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/py-pynest2d/PLIST b/py-pynest2d/PLIST
new file mode 100644
index 0000000000..5f946d140d
--- /dev/null
+++ b/py-pynest2d/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD$
+${PYSITELIB}/pynest2d.so
diff --git a/py-pynest2d/buildlink3.mk b/py-pynest2d/buildlink3.mk
new file mode 100644
index 0000000000..5e8b5a76c2
--- /dev/null
+++ b/py-pynest2d/buildlink3.mk
@@ -0,0 +1,15 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	py-pynest2d
+
+.if !defined(PY_PYNEST2D_BUILDLINK3_MK)
+PY_PYNEST2D_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.py-pynest2d+=	${PYPKGPREFIX}-pynest2d>=4.11.0
+BUILDLINK_PKGSRCDIR.py-pynest2d?=	../../wip/py-pynest2d
+
+.include "../../wip/libnest2d-ultimaker/buildlink3.mk"
+.include "../../x11/py-sip/buildlink3.mk"
+.endif	# PY_PYNEST2D_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-py-pynest2d
diff --git a/py-pynest2d/distinfo b/py-pynest2d/distinfo
new file mode 100644
index 0000000000..9ec68e6359
--- /dev/null
+++ b/py-pynest2d/distinfo
@@ -0,0 +1,7 @@
+$NetBSD$
+
+BLAKE2s (pynest2d/4.11.0.tar.gz) = 0832e7f52d0b026f55367a0346ad3f9de1727e990c9752e4f011a8086e554af0
+SHA512 (pynest2d/4.11.0.tar.gz) = 29d924a43109d78f969ae27d2c04ea283c729700504e7c198e05a4e3501366991fa77eab94787452c6d836e59744a85012f93cd7934b5a29347a4fff26650f0d
+Size (pynest2d/4.11.0.tar.gz) = 18452 bytes
+SHA1 (patch-cmake_FindClipper.cmake) = a047f7365a95a6a5ce3a8d12723d2e450c7b113d
+SHA1 (patch-cmake_FindNLopt.cmake) = 05debe7fc437c85a0cde2f9f4e558b07a350baba
diff --git a/py-pynest2d/patches/patch-cmake_FindClipper.cmake b/py-pynest2d/patches/patch-cmake_FindClipper.cmake
new file mode 100644
index 0000000000..4980789813
--- /dev/null
+++ b/py-pynest2d/patches/patch-cmake_FindClipper.cmake
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Add ${PREFIX} path
+
+--- cmake/FindClipper.cmake.orig	2021-01-12 15:41:07.008690358 +0000
++++ cmake/FindClipper.cmake
+@@ -32,6 +32,8 @@ find_path(CLIPPER_INCLUDE_DIRS clipper.h
+     /opt/local/include/polyclipping/
+     /usr/local/include/
+     /usr/local/include/polyclipping/
++    @prefix@/include/
++    @prefix@/include/polyclipping/
+     /usr/include
+     /usr/include/polyclipping/
+ )
+@@ -50,6 +52,8 @@ set(LIB_SEARCHDIRS 
+     /opt/local/lib/polyclipping/
+     /usr/local/lib/
+     /usr/local/lib/polyclipping/
++    @prefix@/lib/
++    @prefix@/lib/polyclipping/
+     /usr/lib/polyclipping
+ )
+ 
diff --git a/py-pynest2d/patches/patch-cmake_FindNLopt.cmake b/py-pynest2d/patches/patch-cmake_FindNLopt.cmake
new file mode 100644
index 0000000000..0a0ccfdaea
--- /dev/null
+++ b/py-pynest2d/patches/patch-cmake_FindNLopt.cmake
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Add ${PREFIX} path
+
+--- cmake/FindNLopt.cmake.orig	2021-01-12 15:41:30.390958582 +0000
++++ cmake/FindNLopt.cmake
+@@ -29,6 +29,8 @@ find_path(NLopt_INCLUDE_DIRS nlopt.hpp
+     /opt/local/include/nlopt/
+     /usr/local/include/
+     /usr/local/include/nlopt/
++    @prefix@/include/
++    @prefix@/include/nlopt/
+     /usr/include
+     /usr/include/nlopt/
+ )
+@@ -45,6 +47,8 @@ set(LIB_SEARCHDIRS 
+     /opt/local/lib/nlopt/
+     /usr/local/lib/
+     /usr/local/lib/nlopt/
++    @prefix@/lib/
++    @prefix@/lib/nlopt/
+     /usr/lib/nlopt
+ )
+ 


Home | Main Index | Thread Index | Old Index