From 589ef5b21020c833926591902fd7c0f6be6c8741 Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Wed, 11 Nov 2020 12:05:31 -0500 Subject: [PATCH 1/6] Uranium: update to 4.8.0. --- srcpkgs/Uranium/template | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/srcpkgs/Uranium/template b/srcpkgs/Uranium/template index 35a15a395aa..b42cf2513bf 100644 --- a/srcpkgs/Uranium/template +++ b/srcpkgs/Uranium/template @@ -1,19 +1,21 @@ # Template file for 'Uranium' pkgname=Uranium -version=4.7.1 -revision=2 +version=4.8.0 +revision=1 build_style=cmake pycompile_dirs="usr/lib/uranium/plugins" hostmakedepends="python3" depends="libArcus-python3 python3-PyQt5-opengl python3-PyQt5-quick python3-PyQt5-svg python3-numpy-stl python3-scipy qt5-quickcontrols qt5-quickcontrols2 python3-shapely python3-cryptography" +checkdepends="python3-pytest python3-mypy python3-certifi + python3-Twisted $depends" short_desc="Python framework for building Desktop applications" maintainer="Karl Nilsson " license="LGPL-3.0-or-later" homepage="https://github.com/Ultimaker/Uranium" distfiles="https://github.com/Ultimaker/Uranium/archive/${version}.tar.gz" -checksum=16a72ef9e73df86016ceff37a068e3d70a111223669bfa4f86608c29fdaacc0c +checksum=17e292361b7bbd89838599e78e4df2a8e69f247209b38e5098b25f5c83affcf2 post_install() { vmkdir usr/share/uranium/cmake From 3191ecccfe3fb41139f1172c3cb35e2b1e97f8ab Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Wed, 11 Nov 2020 12:40:59 -0500 Subject: [PATCH 2/6] cura-fdm-materials: update to 4.8.0. --- srcpkgs/cura-fdm-materials/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/cura-fdm-materials/template b/srcpkgs/cura-fdm-materials/template index 90011988e0d..58102afbbe7 100644 --- a/srcpkgs/cura-fdm-materials/template +++ b/srcpkgs/cura-fdm-materials/template @@ -1,7 +1,7 @@ # Template file for 'cura-fdm-materials' pkgname=cura-fdm-materials reverts="2019.08.21_1" -version=4.7.1 +version=4.8.0 revision=1 wrksrc="fdm_materials-${version}" build_style=cmake @@ -10,7 +10,7 @@ maintainer="Karl Nilsson " license="CC0-1.0" homepage="https://github.com/Ultimaker/fdm_materials" distfiles="https://github.com/Ultimaker/fdm_materials/archive/${version}.tar.gz" -checksum=f828baf9248ffcb05685980d079db906f2363958aa637255e36719d29d9922c5 +checksum=1fe1462f60700e08314e24e636eebf3218eb0174db8763cd955ad080c6568f1a post_install() { vlicense LICENSE From c8a6b8cdf6ed1db5fc75de98c40e160bfd128185 Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Wed, 11 Nov 2020 12:41:05 -0500 Subject: [PATCH 3/6] libSavitar: update to 4.8.0. --- srcpkgs/libSavitar/template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srcpkgs/libSavitar/template b/srcpkgs/libSavitar/template index b033f1bbe33..647ed166f63 100644 --- a/srcpkgs/libSavitar/template +++ b/srcpkgs/libSavitar/template @@ -1,7 +1,7 @@ # Template file for 'libSavitar' pkgname=libSavitar -version=4.7.1 -revision=2 +version=4.8.0 +revision=1 build_style=cmake hostmakedepends="python3" makedepends="python3-sip-devel python3-devel pugixml-devel" @@ -10,7 +10,7 @@ maintainer="Karl Nilsson " license="LGPL-3.0-or-later" homepage="https://github.com/Ultimaker/libSavitar" distfiles="https://github.com/Ultimaker/libSavitar/archive/${version}.tar.gz" -checksum=3287d155e20744bf09cfddb4dede72adb579c9dcc0a74e6f12ddde57f4d417b0 +checksum=9eb1a0277d64f7d95cc3f81f0e5e35f16cb06b9190d9fc15c18ad7d1da7aeaf2 if [ "$CROSS_BUILD" ]; then hostmakedepends+=" python3-sip-devel" From a499e4350ad852410df46ef98b6653b994a1fea5 Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Wed, 11 Nov 2020 22:27:26 -0500 Subject: [PATCH 4/6] New package: libnest2d-0.4 --- common/shlibs | 1 + srcpkgs/libnest2d-devel | 1 + .../patches/allow-disallowed-areas.patch | 122 ++++++++++++++++++ srcpkgs/libnest2d/patches/fix-cmake.patch | 65 ++++++++++ srcpkgs/libnest2d/patches/soversion.patch | 21 +++ srcpkgs/libnest2d/template | 24 ++++ 6 files changed, 234 insertions(+) create mode 120000 srcpkgs/libnest2d-devel create mode 100644 srcpkgs/libnest2d/patches/allow-disallowed-areas.patch create mode 100644 srcpkgs/libnest2d/patches/fix-cmake.patch create mode 100644 srcpkgs/libnest2d/patches/soversion.patch create mode 100644 srcpkgs/libnest2d/template diff --git a/common/shlibs b/common/shlibs index d86b7eddef0..ee3298e4d43 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3913,6 +3913,7 @@ libndr-samba-samba4.so samba-libs-4.13.2_1 libndr-samba4.so samba-libs-4.13.2_1 libprinter-driver-samba4.so samba-libs-4.13.3_1 libsmb-transport-samba4.so samba-libs-4.13.2_1 +libnest2d_clipper_nlopt.so.1.0 libnest2d-0.4_1 libtdb-wrap-samba4.so samba-libs-4.13.3_1 libutil-cmdline-samba4.so samba-libs-4.13.2_1 libwinbind-client-samba4.so samba-libs-4.13.2_1 diff --git a/srcpkgs/libnest2d-devel b/srcpkgs/libnest2d-devel new file mode 120000 index 00000000000..9b14d88294b --- /dev/null +++ b/srcpkgs/libnest2d-devel @@ -0,0 +1 @@ +libnest2d/ \ No newline at end of file diff --git a/srcpkgs/libnest2d/patches/allow-disallowed-areas.patch b/srcpkgs/libnest2d/patches/allow-disallowed-areas.patch new file mode 100644 index 00000000000..615bad97b0b --- /dev/null +++ b/srcpkgs/libnest2d/patches/allow-disallowed-areas.patch @@ -0,0 +1,122 @@ +From 2e91be2679b5efa0773292d9d0a2ae72255bb271 Mon Sep 17 00:00:00 2001 +From: Ghostkeeper +Date: Tue, 6 Oct 2020 16:13:15 +0200 +Subject: [PATCH 1/3] Allow for an item to be a disallowed area + +Disallowed areas have slightly different behaviour from fixed items: Other items won't get packed closely around them. Implementation of that pending. + +Contributes to issue CURA-7754. +--- + include/libnest2d/nester.hpp | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git include/libnest2d/nester.hpp include/libnest2d/nester.hpp +index 2f207d5..932a060 100644 +--- include/libnest2d/nester.hpp ++++ include/libnest2d/nester.hpp +@@ -71,6 +71,15 @@ class _Item { + int binid_{BIN_ID_UNSET}, priority_{0}; + bool fixed_{false}; + ++ /** ++ * \brief If this is a fixed area, indicates whether it is a disallowed area ++ * or a previously placed item. ++ * ++ * If this is a disallowed area, other objects will not get packed close ++ * together with this item. It only blocks other items in its area. ++ */ ++ bool disallowed_{false}; ++ + public: + + /// The type of the shape which was handed over as the template argument. +@@ -129,11 +138,18 @@ class _Item { + sh_(sl::create(std::move(contour), std::move(holes))) {} + + inline bool isFixed() const noexcept { return fixed_; } ++ inline bool isDisallowedArea() const noexcept { return disallowed_; } + inline void markAsFixedInBin(int binid) + { + fixed_ = binid >= 0; + binid_ = binid; + } ++ inline void markAsDisallowedAreaInBin(int binid) ++ { ++ fixed_ = binid >= 0; ++ binid_ = binid; ++ disallowed_ = true; ++ } + + inline void binId(int idx) { binid_ = idx; } + inline int binId() const noexcept { return binid_; } + +From ff61049e59d3151462bca7ff2e2268c2b32731e7 Mon Sep 17 00:00:00 2001 +From: Ghostkeeper +Date: Tue, 6 Oct 2020 16:14:36 +0200 +Subject: [PATCH 2/3] Allow unsetting of being a disallowed area + +If you set the bin to -1 or set the item to be a simple fixed item afterwards, it'll no longer be a disallowed area. + +Contributes to issue CURA-7754. +--- + include/libnest2d/nester.hpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git include/libnest2d/nester.hpp include/libnest2d/nester.hpp +index 932a060..54761a6 100644 +--- include/libnest2d/nester.hpp ++++ include/libnest2d/nester.hpp +@@ -143,12 +143,13 @@ class _Item { + { + fixed_ = binid >= 0; + binid_ = binid; ++ disallowed_ = false; + } + inline void markAsDisallowedAreaInBin(int binid) + { + fixed_ = binid >= 0; + binid_ = binid; +- disallowed_ = true; ++ disallowed_ = fixed_; + } + + inline void binId(int idx) { binid_ = idx; } + +From 31391fd173249ad9b906390058e13b09238fadc8 Mon Sep 17 00:00:00 2001 +From: Ghostkeeper +Date: Thu, 8 Oct 2020 11:06:58 +0200 +Subject: [PATCH 3/3] Align items to their starting position if all placed + items are disallowed + +We shouldn't align items to disallowed areas. So place them in the starting position according to the alignment property. + +Lot of work to investigate. But very little code changes! + +Contributes to issue CURA-7754. +--- + include/libnest2d/placers/nfpplacer.hpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git include/libnest2d/placers/nfpplacer.hpp include/libnest2d/placers/nfpplacer.hpp +index 96a8cff..b0ebb15 100644 +--- include/libnest2d/placers/nfpplacer.hpp ++++ include/libnest2d/placers/nfpplacer.hpp +@@ -101,7 +101,7 @@ struct NfpPConfig { + * alignment with the candidate item or do anything else. + * + * \param remaining A container with the remaining items waiting to be +- * placed. You can use some features about the remaining items to alter to ++ * placed. You can use some features about the remaining items to alter the + * score of the current placement. If you know that you have to leave place + * for other items as well, that might influence your decision about where + * the current candidate should be placed. E.g. imagine three big circles +@@ -735,7 +735,8 @@ class _NofitPolyPlacer: public PlacerBoilerplate<_NofitPolyPlacer +Date: Sun, 14 Feb 2021 11:29:18 +0330 +Subject: [PATCH 1/2] Fix CMake Error at CMakeLists.txt:125 (install) + +When using such command: + +cmake .. -DLIBNEST2D_HEADER_ONLY=OFF -DCMAKE_INSTALL_PREFIX=./installdir -DRP_ENABLE_DOWNLOADING=ON + +This error is thrown: + +CMake Error at CMakeLists.txt:125 (install): + install TARGETS given no ARCHIVE DESTINATION for static library target + "libnest2d_clipper_nlopt". + +This commit fixes the error as far as tested. +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c2f2bec..ab71296 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -124,6 +124,7 @@ export(EXPORT ${PROJECT_NAME}Targets + + install(TARGETS libnest2d libnest2d_headeronly ${LIBNAME} + EXPORT ${PROJECT_NAME}Targets ++ ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) + + +From 6be371cad6ecaaf0d11b541400c3c8d77e605cd7 Mon Sep 17 00:00:00 2001 +From: Megidd +Date: Sun, 14 Feb 2021 13:14:31 +0330 +Subject: [PATCH 2/2] Also consider another error: + +When running this command: + +cmake .. -DLIBNEST2D_HEADER_ONLY=OFF -DCMAKE_INSTALL_PREFIX=./installdir -DRP_ENABLE_DOWNLOADING=ON -DBUILD_SHARED_LIBS=ON + +This error is thrown: + +CMake Error at CMakeLists.txt:125 (install): + install TARGETS given no LIBRARY DESTINATION for shared library target + "libnest2d_clipper_nlopt". + +This commits resolves the error, as far as tested. +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ab71296..1b9d4ed 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -125,6 +125,7 @@ export(EXPORT ${PROJECT_NAME}Targets + install(TARGETS libnest2d libnest2d_headeronly ${LIBNAME} + EXPORT ${PROJECT_NAME}Targets + ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) + diff --git a/srcpkgs/libnest2d/patches/soversion.patch b/srcpkgs/libnest2d/patches/soversion.patch new file mode 100644 index 00000000000..1a1c53495de --- /dev/null +++ b/srcpkgs/libnest2d/patches/soversion.patch @@ -0,0 +1,21 @@ +From 12b64796aee24d5af41df3a10c4313dc713c3e74 Mon Sep 17 00:00:00 2001 +From: Karl Nilsson +Date: Wed, 13 Jan 2021 21:51:34 -0500 +Subject: [PATCH] CMake: add SOVERSION to shared library + +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 374e90f..c2f2bec 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -95,6 +95,7 @@ if(NOT LIBNEST2D_HEADER_ONLY) + add_library(${LIBNAME} ${PROJECT_SOURCE_DIR}/src/libnest2d.cpp) + set_target_properties(${LIBNAME} PROPERTIES PREFIX "") + set_target_properties(${LIBNAME} PROPERTIES DEBUG_POSTFIX "d") ++ set_target_properties(${LIBNAME} PROPERTIES SOVERSION "1.0") + target_link_libraries(${LIBNAME} PUBLIC libnest2d_headeronly) + target_compile_definitions(${LIBNAME} PUBLIC LIBNEST2D_STATIC) + target_sources(${LIBNAME} PRIVATE ${LIBNEST2D_SRCFILES}) diff --git a/srcpkgs/libnest2d/template b/srcpkgs/libnest2d/template new file mode 100644 index 00000000000..beaa8354e3a --- /dev/null +++ b/srcpkgs/libnest2d/template @@ -0,0 +1,24 @@ +# Template file for 'libnest2d' +pkgname=libnest2d +version=0.4 +revision=1 +build_style=cmake +configure_args="-DBUILD_SHARED_LIBS=ON -DLIBNEST2D_HEADER_ONLY=OFF -DLIBNEST2D_BUILD_UNITTESTS=ON -DCMAKE_CXX_STANDARD_14" +makedepends="clipper-devel nlopt-devel boost-devel catch2" +checkdepends="catch2" +short_desc="2D irregular bin packing and nesting library" +maintainer="Karl Nilsson " +license="LGPL-3.0-or-later" +homepage="https://github.com/tamasmeszaros/libnest2d" +distfiles="https://github.com/tamasmeszaros/libnest2d/archive/${version}.tar.gz" +checksum=00c909aa5690bead2be36cc57653c54c7c69d260a3c74924e9dfd79994729a2a + +libnest2d-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/cmake + vmove "usr/lib/*.so" + } +} From 736323ab25f93658bae26b14246ec46c72352574 Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Thu, 12 Nov 2020 11:43:25 -0500 Subject: [PATCH 5/6] New package: python3-pynest2d-4.8.0 --- srcpkgs/python3-pynest2d/template | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 srcpkgs/python3-pynest2d/template diff --git a/srcpkgs/python3-pynest2d/template b/srcpkgs/python3-pynest2d/template new file mode 100644 index 00000000000..26beac64e65 --- /dev/null +++ b/srcpkgs/python3-pynest2d/template @@ -0,0 +1,15 @@ +# Template file for 'python3-pynest2d' +pkgname=python3-pynest2d +version=4.8.0 +revision=1 +wrksrc="pynest2d-${version}" +build_style=cmake +configure_args="-DCMAKE_CXX_STANDARD 14" +makedepends="python3-devel libnest2d-devel python3-sip-devel pkg-config clipper-devel nlopt-devel boost-devel" +depends="libnest2d" +short_desc="Python3 bindings for libnest2d" +maintainer="Karl Nilsson " +license="LGPL-3.0-or-later" +homepage="https://github.com/Ultimaker/pynest2d" +distfiles="https://github.com/Ultimaker/pynest2d/archive/${version}.tar.gz" +checksum=7ebc1cf881a8686dcbf7a382e47caecd70fbd6e1eb975ce8a4d41b53ef485ab7 From 5ca0f2aab5de0c4694e96f2368eadd8f78ab7dab Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Wed, 11 Nov 2020 12:41:08 -0500 Subject: [PATCH 6/6] cura: update to 4.8.0. --- srcpkgs/cura/template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/srcpkgs/cura/template b/srcpkgs/cura/template index de6e6cf20e1..d43b4f763f4 100644 --- a/srcpkgs/cura/template +++ b/srcpkgs/cura/template @@ -1,8 +1,7 @@ # Template file for 'cura' pkgname=cura -reverts=4.8.0_1 -version=4.7.1 -revision=3 +version=4.8.0 +revision=2 wrksrc="Cura-${version}" build_style=cmake configure_args="-DCURA_VERSION=${version} @@ -11,10 +10,11 @@ pycompile_dirs="usr/lib/cura/plugins" hostmakedepends="python3" makedepends="Uranium libArcus-devel python3-devel" depends="Uranium cura-engine cura-fdm-materials python3-pyserial python3-zeroconf - python3-certifi python3-trimesh libSavitar-python3 python3-requests qt5-graphicaleffects" + python3-certifi python3-trimesh libSavitar-python3 python3-requests qt5-graphicaleffects + python3-pynest2d" short_desc="3D printer / slicing GUI" maintainer="Karl Nilsson " license="LGPL-3.0-or-later" homepage="https://github.com/Ultimaker/Cura" distfiles="https://github.com/Ultimaker/Cura/archive/${version}.tar.gz" -checksum=1c09552de062ffbe0b2715e983e82c1ac9582aaaa649abfd27c7f82ff59fcf94 +checksum=3f59a53f9d5ba820153401f5f2e9921be843df7677ef4d2b3316bfd08a402cc2