66 ninja ,
77 automaticcomponenttoolkit ,
88 pkg-config ,
9+ fast-float ,
910 libzip ,
1011 gtest ,
1112 openssl ,
1213 libuuid ,
13- libossp_uuid ,
14+ zlib ,
1415} :
1516
1617stdenv . mkDerivation rec {
1718 pname = "lib3mf" ;
18- version = "2.2.0 " ;
19+ version = "2.3.2 " ;
1920
2021 src = fetchFromGitHub {
2122 owner = "3MFConsortium" ;
2223 repo = pname ;
23- rev = "v${ version } " ;
24- sha256 = "sha256-WMTTYYgpCIM86a6Jw8iah/YVXN9T5youzEieWL/d+Bc =" ;
24+ tag = "v${ version } " ;
25+ hash = "sha256-XEwrJINiNpI2+1wXxczirci8VJsUVs5iDUAMS6jWuNk =" ;
2526 } ;
2627
27- patches = [ ./upgrade-to-cpp-14.patch ] ;
28-
2928 nativeBuildInputs = [
3029 cmake
3130 ninja
@@ -49,22 +48,37 @@ stdenv.mkDerivation rec {
4948 libzip
5049 gtest
5150 openssl
52- ] ++ ( if stdenv . hostPlatform . isDarwin then [ libossp_uuid ] else [ libuuid ] ) ;
51+ zlib
52+ ] ++ lib . optional ( ! stdenv . hostPlatform . isDarwin ) libuuid ;
5353
5454 postPatch = ''
55- # This lets us build the tests properly on aarch64-darwin.
56- substituteInPlace CMakeLists.txt \
57- --replace 'SET(CMAKE_OSX_ARCHITECTURES "x86_64")' ""
58-
5955 # fix libdir='' ${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
6056 sed -i 's,libdir='' ${\(exec_\)\?prefix}/,libdir=,' lib3mf.pc.in
6157
6258 # replace bundled binaries
63- for i in AutomaticComponentToolkit/bin/act.*; do
64- ln -sf ${ automaticcomponenttoolkit } /bin/act $i
65- done
59+ rm -r AutomaticComponentToolkit
60+ ln -s ${ automaticcomponenttoolkit } /bin AutomaticComponentToolkit
61+
62+ # unvendor Libraries
63+ rm -r Libraries/{fast_float,googletest,libressl,libzip,zlib}
64+
65+ cat <<"EOF" >> Tests/CPP_Bindings/CMakeLists.txt
66+ find_package(GTest REQUIRED)
67+ target_link_libraries('' ${TESTNAME} PRIVATE GTest::gtest)
68+ EOF
69+
70+ mkdir Libraries/fast_float
71+ ln -s ${ lib . getInclude fast-float } /include/fast_float Libraries/fast_float/Include
72+
73+ # functions are no longer in openssl, remove them from test cleanup function
74+ substituteInPlace Tests/CPP_Bindings/Source/UnitTest_EncryptionUtils.cpp \
75+ --replace-warn "RAND_cleanup();" "" \
76+ --replace-warn "EVP_cleanup();" "" \
77+ --replace-warn "CRYPTO_cleanup_all_ex_data();" ""
6678 '' ;
6779
80+ doCheck = true ;
81+
6882 meta = with lib ; {
6983 description = "Reference implementation of the 3D Manufacturing Format file standard" ;
7084 homepage = "https://3mf.io/" ;
0 commit comments