Commit 9009688b authored by Adkins, Cameron's avatar Adkins, Cameron
Browse files

opencascade-occt: add module configurations

Allows basic selection of modules in opencascade from callPackage parameters.
This also fixes the compilation on darwin since we can selectively not compile
the DRAW module on that platform.
parent bb49bdaa
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -5,14 +5,19 @@
, ninja
, tcl
, tk
, fontconfig
, freetype
, libGL
, libGLU
, libXext
, libXmu
, libXi
, vtk
, mesa
, darwin
, withVtk ? false
, moduleVisualization ? false
, moduleDraw ? false
}:

stdenv.mkDerivation rec {
@@ -32,13 +37,16 @@ stdenv.mkDerivation rec {
  ];

  propagatedBuildInputs = [
    tcl
    tk
    libGL
    libGLU
    libXext
    libXmu
    libXi
    freetype
    fontconfig
  ] ++ lib.optionals moduleDraw [
    tcl
    tk
  ] ++ lib.optionals withVtk [
    vtk
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
@@ -50,11 +58,11 @@ stdenv.mkDerivation rec {
  ];

  cmakeFlags = [
    # NOP
    "-DBUILD_MODULE_Draw=${if (moduleDraw) then "ON" else "OFF"}"
    "-DBUILD_MODULE_Visualization=${if (moduleVisualization || withVtk) then "ON" else "OFF"}"
  ] ++ lib.optionals withVtk [
    "-DUSE_VTK=ON"
    "-D3RDPARTY_VTK_INCLUDE_DIR=${vtk}/include/vtk"
      "-DBUILD_MODULE_VISUALIZATION=ON"
  ];

  meta = with lib; {
@@ -64,6 +72,7 @@ stdenv.mkDerivation rec {
    # The special exception defined in the file OCCT_LGPL_EXCEPTION.txt
    # are basically about making the license a little less share-alike.
    maintainers = with maintainers; [ amiloradovsky gebner ];
    broken = (stdenv.hostPlatform.isDarwin && moduleDraw);
    platforms = platforms.all;
  };
}