2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, clipper, nlopt, boost }:
|
2020-12-07 07:45:13 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-12-24 04:21:11 +00:00
|
|
|
version = "4.12.0";
|
2020-12-07 07:45:13 +00:00
|
|
|
pname = "libnest2d";
|
|
|
|
|
|
|
|
# This revision is waiting to be merged upstream
|
|
|
|
# Once it has been merged, this should be switched to it
|
|
|
|
# Upstream PR: https://github.com/tamasmeszaros/libnest2d/pull/18
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Ultimaker";
|
|
|
|
repo = "libnest2d";
|
|
|
|
rev = "31391fd173249ad9b906390058e13b09238fadc8";
|
|
|
|
sha256 = "1hzqi4z55x76rss3xk7hfqhy9hcaq2jaav5jqxa1aqmbvarr2gla";
|
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace {,examples/}CMakeLists.txt \
|
|
|
|
--replace "set(CMAKE_CXX_STANDARD 11)" "set(CMAKE_CXX_STANDARD 14)"
|
|
|
|
'';
|
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
propagatedBuildInputs = [ clipper nlopt boost ];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
CLIPPER_PATH = "${clipper.out}";
|
|
|
|
cmakeFlags = [ "-DLIBNEST2D_HEADER_ONLY=OFF" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-12-07 07:45:13 +00:00
|
|
|
description =
|
|
|
|
"2D irregular bin packaging and nesting library written in modern C++";
|
|
|
|
homepage = "https://github.com/Ultimaker/libnest2d";
|
|
|
|
license = licenses.lgpl3;
|
2021-03-15 08:37:03 +00:00
|
|
|
platforms = platforms.all;
|
2020-12-07 07:45:13 +00:00
|
|
|
};
|
|
|
|
}
|