2021-03-19 18:29:25 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, ninja, automaticcomponenttoolkit
|
|
|
|
, pkg-config, libzip, gtest, openssl, libuuid, libossp_uuid }:
|
2019-04-07 10:27:15 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "lib3mf";
|
2021-08-25 08:32:11 +01:00
|
|
|
version = "2.2.0";
|
2019-04-07 10:27:15 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "3MFConsortium";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-08-25 08:32:11 +01:00
|
|
|
sha256 = "sha256-WMTTYYgpCIM86a6Jw8iah/YVXN9T5youzEieWL/d+Bc=";
|
2019-04-07 10:27:15 +01:00
|
|
|
};
|
|
|
|
|
2021-03-19 18:29:25 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja pkg-config ];
|
2019-04-07 10:27:15 +01:00
|
|
|
|
2021-03-19 18:29:25 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2019-04-07 10:27:15 +01:00
|
|
|
|
2021-03-19 18:29:25 +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 ]);
|
2019-04-21 16:24:49 +01:00
|
|
|
|
2021-03-19 18:29:25 +00:00
|
|
|
postPatch = ''
|
2019-04-21 16:24:49 +01:00
|
|
|
# fix libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
2021-03-19 18:29:25 +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
|
2019-04-07 10:27:15 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-04-07 10:27:15 +01: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;
|
|
|
|
};
|
|
|
|
}
|