nixpkgs/pkgs/development/libraries/lib3mf/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.3 KiB
Nix
Raw Normal View History

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 09:27:15 +00:00
stdenv.mkDerivation rec {
pname = "lib3mf";
2021-08-25 07:32:11 +00:00
version = "2.2.0";
2019-04-07 09:27:15 +00:00
src = fetchFromGitHub {
owner = "3MFConsortium";
repo = pname;
rev = "v${version}";
2021-08-25 07:32:11 +00:00
sha256 = "sha256-WMTTYYgpCIM86a6Jw8iah/YVXN9T5youzEieWL/d+Bc=";
2019-04-07 09:27:15 +00:00
};
2021-03-19 18:29:25 +00:00
nativeBuildInputs = [ cmake ninja pkg-config ];
2019-04-07 09:27:15 +00:00
2021-03-19 18:29:25 +00:00
outputs = [ "out" "dev" ];
2019-04-07 09:27:15 +00: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 15:24:49 +00:00
2021-03-19 18:29:25 +00:00
postPatch = ''
2019-04-21 15:24:49 +00: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 09:27:15 +00:00
'';
meta = with lib; {
2019-04-07 09:27:15 +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;
};
}