Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions pkgs/by-name/op/opencascade-occt/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
libXext,
libXmu,
libXi,
}:
vtk,
withVtk ? false,

# used in passthru.tests
opencascade-occt,
}:
stdenv.mkDerivation rec {
pname = "opencascade-occt";
version = "7.8.1";
Expand All @@ -33,6 +37,10 @@ stdenv.mkDerivation rec {
url = "https://github.com/Open-Cascade-SAS/OCCT/commit/7236e83dcc1e7284e66dc61e612154617ef715d6.diff";
hash = "sha256-NoC2mE3DG78Y0c9UWonx1vmXoU4g5XxFUT3eVXqLU60=";
})

# patch does not apply against 7.9+, it was submitted upstream for future
# inclusion: https://github.com/Open-Cascade-SAS/OCCT/pull/683
./vtk-draw-conditional-glx.patch
];

nativeBuildInputs = [
Expand All @@ -49,10 +57,25 @@ stdenv.mkDerivation rec {
libXmu
libXi
rapidjson
];
]
++ lib.optional withVtk vtk;

NIX_CFLAGS_COMPILE = [ "-fpermissive" ];
cmakeFlags = [ "-DUSE_RAPIDJSON=ON" ];
cmakeFlags = [
(lib.cmakeBool "USE_RAPIDJSON" true)
# Enable exception handling for release builds.
(lib.cmakeBool "BUILD_RELEASE_DISABLE_EXCEPTIONS" false)
]
++ lib.optionals withVtk [
(lib.cmakeBool "USE_VTK" true)
(lib.cmakeFeature "3RDPARTY_VTK_INCLUDE_DIR" "${lib.getDev vtk}/include/vtk")
];

passthru = {
tests = {
withVtk = opencascade-occt.override ({ withVtk = true; });
};
};

meta = with lib; {
description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
Expand All @@ -63,5 +86,4 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ amiloradovsky ];
platforms = platforms.all;
};

}
14 changes: 14 additions & 0 deletions pkgs/by-name/op/opencascade-occt/vtk-draw-conditional-glx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86905287dc..19214e8f2d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -623,5 +623,9 @@ if (USE_VTK)
add_definitions (-DHAVE_VTK)
set (OCCT_VTK_USED_TARGETS "" CACHE INTERNAL "" FORCE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
+ if (DEFINED VTK_USE_X AND NOT VTK_USE_X)
+ message (STATUS "Info: TKIVtkDraw toolkits excluded due to VTK has no glx support")
+ list (REMOVE_ITEM BUILD_TOOLKITS TKIVtkDraw)
+ endif()
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
Loading