Skip to content

Commit ffd125e

Browse files
authored
lib3mf: 2.2.0 -> 2.3.2; openscad: unpin cgal_4; fix darwin (NixOS#369588)
2 parents be1bd4b + c34b198 commit ffd125e

File tree

3 files changed

+51
-34
lines changed

3 files changed

+51
-34
lines changed

pkgs/applications/graphics/openscad/default.nix

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
libGL,
1515
glew,
1616
opencsg,
17-
cgal_4,
17+
cgal,
1818
mpfr,
1919
gmp,
2020
glib,
@@ -62,11 +62,32 @@ mkDerivation rec {
6262
url = "https://github.com/openscad/openscad/commit/84addf3c1efbd51d8ff424b7da276400bbfa1a4b.patch";
6363
sha256 = "sha256-KNEVu10E2d4G2x+FJcuHo2tjD8ygMRuhUcW9NbN98bM=";
6464
})
65+
(fetchpatch {
66+
# needed for cgal_5
67+
name = "cgalutils-tess.cc-cgal-5.patch";
68+
url = "https://github.com/openscad/openscad/commit/3a81c1fb9b663ebbedd6eb044e7276357b1f30a1.patch";
69+
hash = "sha256-JdBznXkewx5ybY92Ss0h7UnMZ7d3IQbFRaDCDjb1bRA=";
70+
})
71+
(fetchpatch {
72+
# needed for cgal_5
73+
name = "cgalutils-tess.cc-cgal-5_4.patch";
74+
url = "https://github.com/openscad/openscad/commit/71f2831c0484c3f35cbf44e1d1dc2c857384100b.patch";
75+
hash = "sha256-Fu8dnjNIwZKCI6ukOeHYK8NiJwoA0XtqT8dg8sVevG8=";
76+
})
77+
(fetchpatch {
78+
# needed for cgal_5. Removes dead code
79+
name = "cgalutils-polyhedron.cc-cgal-5_3.patch";
80+
url = "https://github.com/openscad/openscad/commit/cc49ad8dac24309f5452d5dea9abd406615a52d9.patch";
81+
hash = "sha256-B3i+o6lR5osRcVXTimDZUFQmm12JhmbFgG9UwOPebF4=";
82+
})
6583
];
6684

6785
postPatch = ''
6886
substituteInPlace src/FileModule.cc \
6987
--replace-fail 'fs::is_regular' 'fs::is_regular_file'
88+
89+
substituteInPlace src/openscad.cc \
90+
--replace-fail 'boost::join' 'boost::algorithm::join'
7091
'';
7192

7293
nativeBuildInputs = [
@@ -84,7 +105,7 @@ mkDerivation rec {
84105
boost
85106
glew
86107
opencsg
87-
cgal_4
108+
cgal
88109
mpfr
89110
gmp
90111
glib

pkgs/by-name/li/lib3mf/package.nix

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@
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

1617
stdenv.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/";

pkgs/by-name/li/lib3mf/upgrade-to-cpp-14.patch

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)