1 { lib, stdenv, fetchFromGitHub, cmake, ninja, automaticcomponenttoolkit
2 , pkg-config, libzip, gtest, openssl, libuuid, libossp_uuid }:
4 stdenv.mkDerivation rec {
8 src = fetchFromGitHub {
9 owner = "3MFConsortium";
12 sha256 = "sha256-WMTTYYgpCIM86a6Jw8iah/YVXN9T5youzEieWL/d+Bc=";
15 nativeBuildInputs = [ cmake ninja pkg-config ];
17 outputs = [ "out" "dev" ];
20 "-DCMAKE_INSTALL_INCLUDEDIR=${placeholder "out"}/include/lib3mf"
21 "-DUSE_INCLUDED_ZLIB=OFF"
22 "-DUSE_INCLUDED_LIBZIP=OFF"
23 "-DUSE_INCLUDED_GTEST=OFF"
24 "-DUSE_INCLUDED_SSL=OFF"
29 ] ++ (if stdenv.isDarwin then [ libossp_uuid ] else [ libuuid ]);
32 # fix libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
33 sed -i 's,=''${\(exec_\)\?prefix}/,=,' lib3mf.pc.in
35 # replace bundled binaries
36 for i in AutomaticComponentToolkit/bin/act.*; do
37 ln -sf ${automaticcomponenttoolkit}/bin/act $i
42 description = "Reference implementation of the 3D Manufacturing Format file standard";
43 homepage = "https://3mf.io/";
44 license = licenses.bsd2;
45 maintainers = with maintainers; [ gebner ];
46 platforms = platforms.all;