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

49 lines
1.3 KiB
Nix
Raw Permalink 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-03-19 18:29:25 +00:00
version = "2.1.1";
2019-04-07 09:27:15 +00:00
src = fetchFromGitHub {
owner = "3MFConsortium";
repo = pname;
rev = "v${version}";
2021-03-19 18:29:25 +00:00
sha256 = "1417xlxc1y5jnipixhbjfrrjgkrprbbraj8647sff9051m3hpxc3";
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;
};
}