lib3mf: 2.2.0 -> 2.3.2; openscad: unpin cgal_4; fix darwin (#369588)
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
libGL,
|
libGL,
|
||||||
glew,
|
glew,
|
||||||
opencsg,
|
opencsg,
|
||||||
cgal_4,
|
cgal,
|
||||||
mpfr,
|
mpfr,
|
||||||
gmp,
|
gmp,
|
||||||
glib,
|
glib,
|
||||||
@@ -62,11 +62,32 @@ mkDerivation rec {
|
|||||||
url = "https://github.com/openscad/openscad/commit/84addf3c1efbd51d8ff424b7da276400bbfa1a4b.patch";
|
url = "https://github.com/openscad/openscad/commit/84addf3c1efbd51d8ff424b7da276400bbfa1a4b.patch";
|
||||||
sha256 = "sha256-KNEVu10E2d4G2x+FJcuHo2tjD8ygMRuhUcW9NbN98bM=";
|
sha256 = "sha256-KNEVu10E2d4G2x+FJcuHo2tjD8ygMRuhUcW9NbN98bM=";
|
||||||
})
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
# needed for cgal_5
|
||||||
|
name = "cgalutils-tess.cc-cgal-5.patch";
|
||||||
|
url = "https://github.com/openscad/openscad/commit/3a81c1fb9b663ebbedd6eb044e7276357b1f30a1.patch";
|
||||||
|
hash = "sha256-JdBznXkewx5ybY92Ss0h7UnMZ7d3IQbFRaDCDjb1bRA=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
# needed for cgal_5
|
||||||
|
name = "cgalutils-tess.cc-cgal-5_4.patch";
|
||||||
|
url = "https://github.com/openscad/openscad/commit/71f2831c0484c3f35cbf44e1d1dc2c857384100b.patch";
|
||||||
|
hash = "sha256-Fu8dnjNIwZKCI6ukOeHYK8NiJwoA0XtqT8dg8sVevG8=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
# needed for cgal_5. Removes dead code
|
||||||
|
name = "cgalutils-polyhedron.cc-cgal-5_3.patch";
|
||||||
|
url = "https://github.com/openscad/openscad/commit/cc49ad8dac24309f5452d5dea9abd406615a52d9.patch";
|
||||||
|
hash = "sha256-B3i+o6lR5osRcVXTimDZUFQmm12JhmbFgG9UwOPebF4=";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace src/FileModule.cc \
|
substituteInPlace src/FileModule.cc \
|
||||||
--replace-fail 'fs::is_regular' 'fs::is_regular_file'
|
--replace-fail 'fs::is_regular' 'fs::is_regular_file'
|
||||||
|
|
||||||
|
substituteInPlace src/openscad.cc \
|
||||||
|
--replace-fail 'boost::join' 'boost::algorithm::join'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
@@ -84,7 +105,7 @@ mkDerivation rec {
|
|||||||
boost
|
boost
|
||||||
glew
|
glew
|
||||||
opencsg
|
opencsg
|
||||||
cgal_4
|
cgal
|
||||||
mpfr
|
mpfr
|
||||||
gmp
|
gmp
|
||||||
glib
|
glib
|
||||||
|
|||||||
@@ -6,26 +6,25 @@
|
|||||||
ninja,
|
ninja,
|
||||||
automaticcomponenttoolkit,
|
automaticcomponenttoolkit,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
|
fast-float,
|
||||||
libzip,
|
libzip,
|
||||||
gtest,
|
gtest,
|
||||||
openssl,
|
openssl,
|
||||||
libuuid,
|
libuuid,
|
||||||
libossp_uuid,
|
zlib,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "lib3mf";
|
pname = "lib3mf";
|
||||||
version = "2.2.0";
|
version = "2.3.2";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "3MFConsortium";
|
owner = "3MFConsortium";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
tag = "v${version}";
|
||||||
sha256 = "sha256-WMTTYYgpCIM86a6Jw8iah/YVXN9T5youzEieWL/d+Bc=";
|
hash = "sha256-XEwrJINiNpI2+1wXxczirci8VJsUVs5iDUAMS6jWuNk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./upgrade-to-cpp-14.patch ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cmake
|
cmake
|
||||||
ninja
|
ninja
|
||||||
@@ -49,22 +48,37 @@ stdenv.mkDerivation rec {
|
|||||||
libzip
|
libzip
|
||||||
gtest
|
gtest
|
||||||
openssl
|
openssl
|
||||||
] ++ (if stdenv.hostPlatform.isDarwin then [ libossp_uuid ] else [ libuuid ]);
|
zlib
|
||||||
|
] ++ lib.optional (!stdenv.hostPlatform.isDarwin) libuuid;
|
||||||
|
|
||||||
postPatch = ''
|
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@
|
# fix libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||||
sed -i 's,libdir=''${\(exec_\)\?prefix}/,libdir=,' lib3mf.pc.in
|
sed -i 's,libdir=''${\(exec_\)\?prefix}/,libdir=,' lib3mf.pc.in
|
||||||
|
|
||||||
# replace bundled binaries
|
# replace bundled binaries
|
||||||
for i in AutomaticComponentToolkit/bin/act.*; do
|
rm -r AutomaticComponentToolkit
|
||||||
ln -sf ${automaticcomponenttoolkit}/bin/act $i
|
ln -s ${automaticcomponenttoolkit}/bin AutomaticComponentToolkit
|
||||||
done
|
|
||||||
|
# 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; {
|
meta = with lib; {
|
||||||
description = "Reference implementation of the 3D Manufacturing Format file standard";
|
description = "Reference implementation of the 3D Manufacturing Format file standard";
|
||||||
homepage = "https://3mf.io/";
|
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()
|
|
||||||
Reference in New Issue
Block a user