lib3mf: 2.2.0 -> 2.3.2

https://github.com/3MFConsortium/lib3mf/releases/tag/v2.3.2
This commit is contained in:
Reno Dakota
2024-12-30 22:35:01 -08:00
parent 7771f9dac3
commit 9f579229fc
2 changed files with 28 additions and 32 deletions
+28 -14
View File
@@ -6,26 +6,25 @@
ninja,
automaticcomponenttoolkit,
pkg-config,
fast-float,
libzip,
gtest,
openssl,
libuuid,
libossp_uuid,
zlib,
}:
stdenv.mkDerivation rec {
pname = "lib3mf";
version = "2.2.0";
version = "2.3.2";
src = fetchFromGitHub {
owner = "3MFConsortium";
repo = pname;
rev = "v${version}";
sha256 = "sha256-WMTTYYgpCIM86a6Jw8iah/YVXN9T5youzEieWL/d+Bc=";
tag = "v${version}";
hash = "sha256-XEwrJINiNpI2+1wXxczirci8VJsUVs5iDUAMS6jWuNk=";
};
patches = [ ./upgrade-to-cpp-14.patch ];
nativeBuildInputs = [
cmake
ninja
@@ -49,22 +48,37 @@ stdenv.mkDerivation rec {
libzip
gtest
openssl
] ++ (if stdenv.hostPlatform.isDarwin then [ libossp_uuid ] else [ libuuid ]);
zlib
] ++ lib.optional (!stdenv.hostPlatform.isDarwin) libuuid;
postPatch = ''
# This lets us build the tests properly on aarch64-darwin.
substituteInPlace CMakeLists.txt \
--replace 'SET(CMAKE_OSX_ARCHITECTURES "x86_64")' ""
# fix libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
sed -i 's,libdir=''${\(exec_\)\?prefix}/,libdir=,' lib3mf.pc.in
# replace bundled binaries
for i in AutomaticComponentToolkit/bin/act.*; do
ln -sf ${automaticcomponenttoolkit}/bin/act $i
done
rm -r AutomaticComponentToolkit
ln -s ${automaticcomponenttoolkit}/bin AutomaticComponentToolkit
# unvendor Libraries
rm -r Libraries/{fast_float,googletest,libressl,libzip,zlib}
cat <<"EOF" >> Tests/CPP_Bindings/CMakeLists.txt
find_package(GTest REQUIRED)
target_link_libraries(''${TESTNAME} PRIVATE GTest::gtest)
EOF
mkdir Libraries/fast_float
ln -s ${lib.getInclude fast-float}/include/fast_float Libraries/fast_float/Include
# functions are no longer in openssl, remove them from test cleanup function
substituteInPlace Tests/CPP_Bindings/Source/UnitTest_EncryptionUtils.cpp \
--replace-warn "RAND_cleanup();" "" \
--replace-warn "EVP_cleanup();" "" \
--replace-warn "CRYPTO_cleanup_all_ex_data();" ""
'';
doCheck = true;
meta = with lib; {
description = "Reference implementation of the 3D Manufacturing Format file standard";
homepage = "https://3mf.io/";
@@ -1,18 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f719beb7..a20f84eb8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,12 +34,12 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
add_definitions(-DBUILD_DLL)
add_compile_options(-Wall)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -O2")
elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
# using GCC
add_definitions(-DBUILD_DLL)
add_compile_options(-Wall)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -O2")
set(CMAKE_MACOSX_RPATH ON)
endif()