python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / lib3mf / default.nix
blobb301ac13c2d80d8868e3f009934e7c74a01dd48b
1 { lib, stdenv, fetchFromGitHub, cmake, ninja, automaticcomponenttoolkit
2 , pkg-config, libzip, gtest, openssl, libuuid, libossp_uuid }:
4 stdenv.mkDerivation rec {
5   pname = "lib3mf";
6   version = "2.2.0";
8   src = fetchFromGitHub {
9     owner = "3MFConsortium";
10     repo = pname;
11     rev = "v${version}";
12     sha256 = "sha256-WMTTYYgpCIM86a6Jw8iah/YVXN9T5youzEieWL/d+Bc=";
13   };
15   nativeBuildInputs = [ cmake ninja pkg-config ];
17   outputs = [ "out" "dev" ];
19   cmakeFlags = [
20     "-DCMAKE_INSTALL_INCLUDEDIR=${placeholder "out"}/include/lib3mf"
21     "-DUSE_INCLUDED_ZLIB=OFF"
22     "-DUSE_INCLUDED_LIBZIP=OFF"
23     "-DUSE_INCLUDED_GTEST=OFF"
24     "-DUSE_INCLUDED_SSL=OFF"
25   ];
27   buildInputs = [
28     libzip gtest openssl
29   ] ++ (if stdenv.isDarwin then [ libossp_uuid ] else [ libuuid ]);
31   postPatch = ''
32     # fix libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
33     sed -i 's,=''${\(exec_\)\?prefix}/,=,' lib3mf.pc.in
35     # replace bundled binaries
36     for i in AutomaticComponentToolkit/bin/act.*; do
37       ln -sf ${automaticcomponenttoolkit}/bin/act $i
38     done
39   '';
41   meta = with lib; {
42     description = "Reference implementation of the 3D Manufacturing Format file standard";
43     homepage = "https://3mf.io/";
44     license = licenses.bsd2;
45     maintainers = with maintainers; [ gebner ];
46     platforms = platforms.all;
47   };