2024-08-17 09:16:46 -07:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
clipper2,
|
|
|
|
gtest,
|
|
|
|
glm,
|
2025-06-18 17:09:39 +03:00
|
|
|
tbb_2021,
|
2025-07-15 23:57:31 +02:00
|
|
|
python3Packages,
|
2024-08-17 09:16:46 -07:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "manifold";
|
2025-08-13 09:00:49 +00:00
|
|
|
version = "3.2.1";
|
2024-08-17 09:16:46 -07:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "elalish";
|
|
|
|
repo = "manifold";
|
2025-07-15 22:20:57 +02:00
|
|
|
tag = "v${finalAttrs.version}";
|
2025-08-13 09:00:49 +00:00
|
|
|
hash = "sha256-d/e4SKwfKqvLZgQu/Gfwsym9/XqEqQr7fWNSyLtCxzs=";
|
2024-08-17 09:16:46 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gtest
|
|
|
|
glm
|
2025-06-18 17:09:39 +03:00
|
|
|
tbb_2021
|
2024-08-17 09:16:46 -07:00
|
|
|
];
|
|
|
|
|
2025-07-17 16:19:39 +12:00
|
|
|
propagatedBuildInputs = [ clipper2 ];
|
|
|
|
|
2024-08-17 09:16:46 -07:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
"-DMANIFOLD_TEST=ON"
|
2024-09-05 07:58:24 -07:00
|
|
|
"-DMANIFOLD_CROSS_SECTION=ON"
|
2024-08-17 09:16:46 -07:00
|
|
|
"-DMANIFOLD_PAR=TBB"
|
|
|
|
];
|
|
|
|
|
2025-07-29 14:57:08 -04:00
|
|
|
excludedTestPatterns = lib.optionals stdenv.isDarwin [
|
|
|
|
# https://github.com/elalish/manifold/issues/1306
|
|
|
|
"Manifold.Simplify"
|
|
|
|
];
|
2024-08-17 09:16:46 -07:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
2025-07-29 14:57:08 -04:00
|
|
|
test/manifold_test --gtest_filter=-${builtins.concatStringsSep ":" finalAttrs.excludedTestPatterns}
|
2024-08-17 09:16:46 -07:00
|
|
|
'';
|
|
|
|
|
2025-07-15 22:21:31 +02:00
|
|
|
passthru = {
|
|
|
|
tbb = tbb_2021;
|
2025-07-15 23:57:31 +02:00
|
|
|
tests = {
|
|
|
|
python = python3Packages.manifold3d;
|
|
|
|
};
|
2025-07-15 22:21:31 +02:00
|
|
|
};
|
|
|
|
|
2024-08-17 09:16:46 -07:00
|
|
|
meta = {
|
|
|
|
description = "Geometry library for topological robustness";
|
|
|
|
homepage = "https://github.com/elalish/manifold";
|
2025-07-15 22:20:57 +02:00
|
|
|
changelog = "https://github.com/elalish/manifold/releases/tag/${finalAttrs.src.tag}";
|
2024-08-17 09:16:46 -07:00
|
|
|
license = lib.licenses.asl20;
|
2025-07-15 23:57:31 +02:00
|
|
|
maintainers =
|
|
|
|
with lib.maintainers;
|
|
|
|
[
|
|
|
|
hzeller
|
|
|
|
pca006132
|
|
|
|
]
|
|
|
|
++ python3Packages.manifold3d.meta.maintainers;
|
2024-12-30 23:39:20 -08:00
|
|
|
platforms = lib.platforms.unix;
|
2024-08-17 09:16:46 -07:00
|
|
|
};
|
|
|
|
})
|