lol
1{ lib, stdenv, fetchFromGitHub, cmake, clipper, nlopt, boost }:
2
3stdenv.mkDerivation {
4 version = "4.12.0";
5 pname = "libnest2d";
6
7 # This revision is waiting to be merged upstream
8 # Once it has been merged, this should be switched to it
9 # Upstream PR: https://github.com/tamasmeszaros/libnest2d/pull/18
10 src = fetchFromGitHub {
11 owner = "Ultimaker";
12 repo = "libnest2d";
13 rev = "31391fd173249ad9b906390058e13b09238fadc8";
14 sha256 = "1hzqi4z55x76rss3xk7hfqhy9hcaq2jaav5jqxa1aqmbvarr2gla";
15 };
16
17 postPatch = ''
18 substituteInPlace {,examples/}CMakeLists.txt \
19 --replace "set(CMAKE_CXX_STANDARD 11)" "set(CMAKE_CXX_STANDARD 14)"
20 '';
21
22 propagatedBuildInputs = [ clipper nlopt boost ];
23 nativeBuildInputs = [ cmake ];
24
25 CLIPPER_PATH = "${clipper.out}";
26 cmakeFlags = [ "-DLIBNEST2D_HEADER_ONLY=OFF" ];
27
28 meta = with lib; {
29 description =
30 "2D irregular bin packaging and nesting library written in modern C++";
31 homepage = "https://github.com/Ultimaker/libnest2d";
32 license = licenses.lgpl3;
33 platforms = platforms.all;
34 };
35}