1{ stdenv, fetchFromGitHub, cmake, ninja, libuuid, libossp_uuid, gtest }:
2
3stdenv.mkDerivation rec {
4 pname = "lib3mf";
5 version = "1.8.1";
6
7 src = fetchFromGitHub {
8 owner = "3MFConsortium";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "11wpk6n9ga2p57h1dcrp37w77mii0r7r6mlrgmykf7rvii1rzgqd";
12 };
13
14 nativeBuildInputs = [ cmake ninja ];
15
16 buildInputs = if stdenv.isDarwin then [ libossp_uuid ] else [ libuuid ];
17
18 postPatch = ''
19 rmdir UnitTests/googletest
20 ln -s ${gtest.src} UnitTests/googletest
21
22 # fix libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
23 sed -i 's,=''${\(exec_\)\?prefix}/,=,' lib3MF.pc.in
24 '';
25
26 meta = with stdenv.lib; {
27 description = "Reference implementation of the 3D Manufacturing Format file standard";
28 homepage = "https://3mf.io/";
29 license = licenses.bsd2;
30 maintainers = with maintainers; [ gebner ];
31 platforms = platforms.all;
32 };
33}