2021-03-23 19:22:30 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, ninja, automaticcomponenttoolkit
|
|
|
|
, pkg-config, libzip, gtest, openssl, libuuid, libossp_uuid }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "lib3mf";
|
2021-03-23 19:22:30 +00:00
|
|
|
version = "2.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "3MFConsortium";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-03-23 19:22:30 +00:00
|
|
|
sha256 = "1417xlxc1y5jnipixhbjfrrjgkrprbbraj8647sff9051m3hpxc3";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=${placeholder "out"}/include/lib3mf"
|
|
|
|
"-DUSE_INCLUDED_ZLIB=OFF"
|
|
|
|
"-DUSE_INCLUDED_LIBZIP=OFF"
|
|
|
|
"-DUSE_INCLUDED_GTEST=OFF"
|
|
|
|
"-DUSE_INCLUDED_SSL=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libzip gtest openssl
|
|
|
|
] ++ (if stdenv.isDarwin then [ libossp_uuid ] else [ libuuid ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# fix libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
2021-03-23 19:22:30 +00:00
|
|
|
sed -i 's,=''${\(exec_\)\?prefix}/,=,' lib3mf.pc.in
|
|
|
|
|
|
|
|
# replace bundled binaries
|
|
|
|
for i in AutomaticComponentToolkit/bin/act.*; do
|
|
|
|
ln -sf ${automaticcomponenttoolkit}/bin/act $i
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Reference implementation of the 3D Manufacturing Format file standard";
|
|
|
|
homepage = "https://3mf.io/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ gebner ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|