10
0

Accepting request 843917 from home:StefanBruens:branches:science

New dependency for next Cura 4.8.0

OBS-URL: https://build.opensuse.org/request/show/843917
OBS-URL: https://build.opensuse.org/package/show/science/python3-pynest2d?expand=0&rev=1
This commit is contained in:
2020-10-28 17:28:22 +00:00
committed by Git OBS Bridge
commit 7fbac57eda
7 changed files with 150 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
-------------------------------------------------------------------
Sun Oct 25 06:22:04 UTC 2020 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- Initial package version 4.8.0
- Add pynest2d-PyQt5.sip.patch
- Add Retrieve-required-flags-from-Libnest2D-target.patch
+56
View File
@@ -0,0 +1,56 @@
#
# spec file for package python3-pynest2d
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: python3-pynest2d
Version: 4.8~beta
Release: 0
%define sversion 4.8-beta
Summary: CPython bindings for libnest2d
License: LGPL-3.0-only
Group: Development/Libraries/C and C++
URL: https://github.com/Ultimaker/%name
Source: https://github.com/Ultimaker/pynest2d/archive/cura-%{sversion}.tar.gz#/pynest2d-%{version}.tar.gz
# PATCH-FIX-OPENSUSE -- add PyQt5 namespace
Patch0: pynest2d-PyQt5.sip.patch
# PATCH-FIX-UPSTREAM -- https://github.com/Ultimaker/pynest2d/pull/3
Patch1: Retrieve-required-flags-from-Libnest2D-target.patch
BuildRequires: cmake >= 3.6
BuildRequires: gcc-c++
BuildRequires: libnest2d-devel
BuildRequires: python3-sip-devel
%description
Binding allowing libnest2d to be called from Python using Numpy.
%prep
%autosetup -n pynest2d-cura-%{sversion} -p1
%build
%cmake
%cmake_build
%install
%cmake_install
%files
%license LICENSE
%doc README.md
%{python3_sitearch}/pynest2d.so
%changelog
+23
View File
@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
+1
View File
@@ -0,0 +1 @@
.osc
@@ -0,0 +1,38 @@
From b5b587ff320fd5bb0155d6803a85804502210cca Mon Sep 17 00:00:00 2001
From: StefanBruens <stefan.bruens@rwth-aachen.de>
Date: Sun, 25 Oct 2020 15:59:56 +0100
Subject: [PATCH] Retrieve required flags from Libnest2D target
Instead of setting include paths and libs manually, just use the imported target.
All required properties are set Libnest2DTargets.cmake.
This also adds the otherwise missing libpthread to the link libraries.
---
CMakeLists.txt | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8cd17da..5ccba47 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,11 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
find_package(PythonInterp 3.5 REQUIRED) # Dependency of SIP.
find_package(PythonLibs 3.5 REQUIRED) # Dependency of SIP.
find_package(SIP REQUIRED) # To create Python bindings.
-find_package(libnest2d REQUIRED) # The library we're creating bindings for.
-find_package(Clipper REQUIRED) # Dependency of libnest2d.
-find_package(NLopt REQUIRED) # Dependency of libnest2d.
-find_package(Boost REQUIRED) # Dependency of libnest2d.
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLIBNEST2D_GEOMETRIES_clipper -DLIBNEST2D_OPTIMIZERS_nlopt -DLIBNEST2D_THREADING_std") # Tell libnest2d to use Clipper and NLopt, and standard threads.
+find_package(Libnest2D REQUIRED) # The library we're creating bindings for.
# Some build options.
set(CMAKE_CXX_STANDARD 11)
@@ -45,5 +41,5 @@ set(SIP_EXTRA_FILES_DEPEND
)
set(SIP_EXTRA_OPTIONS -g -n PyQt5.sip) # -g means always release the GIL before calling C++ methods.
-include_directories(src/ ${SIP_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS} ${CLIPPER_INCLUDE_DIRS} ${NLopt_INCLUDE_DIRS} ${LIBNEST2D_INCLUDE_DIRS})
-add_sip_python_module(pynest2d src/Pynest2D.sip ${CLIPPER_LIBRARIES} ${NLopt_LIBRARIES})
+include_directories(src/ ${SIP_INCLUDE_DIRS})
+add_sip_python_module(pynest2d src/Pynest2D.sip Libnest2D::libnest2d_headeronly)
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:09490151a27dadaac3ad94a7b3813975c5ebbb87e9bdc362dacbffc385ae9b0a
size 18187
+23
View File
@@ -0,0 +1,23 @@
diff -up a/cmake/FindSIP.cmake.sip b/cmake/FindSIP.cmake
--- a/cmake/FindSIP.cmake.sip 2019-04-10 02:00:57.000000000 -0500
+++ b/cmake/FindSIP.cmake 2019-09-16 10:55:35.906667181 -0500
@@ -66,7 +66,7 @@ find_path(SIP_INCLUDE_DIRS sip.h
)
execute_process(
- COMMAND ${Python3_EXECUTABLE} -c "import sip; print(sip.SIP_VERSION_STR)"
+ COMMAND ${Python3_EXECUTABLE} -c "import PyQt5.sip; print(PyQt5.sip.SIP_VERSION_STR)"
RESULT_VARIABLE _process_status
OUTPUT_VARIABLE _process_output
OUTPUT_STRIP_TRAILING_WHITESPACE
diff -up a/CMakeLists.txt.sip b/CMakeLists.txt
--- a/CMakeLists.txt.sip 2019-04-10 02:00:57.000000000 -0500
+++ b/CMakeLists.txt 2019-09-16 10:53:36.334104707 -0500
@@ -44,6 +44,6 @@ endif()
src/String.sip
)
-set(SIP_EXTRA_OPTIONS -g) # Always release the GIL before calling C++ methods.
+set(SIP_EXTRA_OPTIONS -g -n PyQt5.sip) # -g means always release the GIL before calling C++ methods.
include_directories(src/ ${SIP_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS} ${CLIPPER_INCLUDE_DIRS} ${NLopt_INCLUDE_DIRS} ${LIBNEST2D_INCLUDE_DIRS})
add_sip_python_module(pynest2d src/Pynest2D.sip ${CLIPPER_LIBRARIES} ${NLopt_LIBRARIES})