Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #266884 from bcdarwin/vtk-cleanup

vtk: cleanup

authored by Mario Rodas and committed by GitHub a45da83a 6f314053

+8 -13
+8 -13
pkgs/development/libraries/vtk/generic.nix
··· 1 1 { majorVersion, minorVersion, sourceSha256, patchesToFetch ? [] }: 2 2 { stdenv, lib, fetchurl, cmake, libGLU, libGL, libX11, xorgproto, libXt, libpng, libtiff 3 3 , fetchpatch 4 - , enableQt ? false, qtbase, qtx11extras, qttools, qtdeclarative, qtEnv 4 + , enableQt ? false, qtx11extras, qttools, qtdeclarative, qtEnv 5 5 , enablePython ? false, python ? throw "vtk: Python support requested, but no python interpreter was given." 6 6 # Darwin support 7 7 , AGL, Cocoa, CoreServices, DiskArbitration, IOKit, CFNetwork, Security, GLUT, OpenGL ··· 11 11 let 12 12 inherit (lib) optionalString optionals optional; 13 13 14 + version = "${majorVersion}.${minorVersion}"; 14 15 pythonMajor = lib.substring 0 1 python.pythonVersion; 15 16 16 - in stdenv.mkDerivation rec { 17 + in stdenv.mkDerivation { 17 18 pname = "vtk${optionalString enableQt "-qvtk"}"; 18 - version = "${majorVersion}.${minorVersion}"; 19 + inherit version; 19 20 20 21 src = fetchurl { 21 22 url = "https://www.vtk.org/files/release/${majorVersion}/VTK-${version}.tar.gz"; ··· 25 26 nativeBuildInputs = [ cmake ]; 26 27 27 28 buildInputs = [ libpng libtiff ] 28 - ++ optionals enableQt (if lib.versionOlder majorVersion "9" 29 - then [ qtbase qtx11extras qttools ] 30 - else [ (qtEnv "qvtk-qt-env" [ qtx11extras qttools qtdeclarative ]) ]) 29 + ++ optionals enableQt [ (qtEnv "qvtk-qt-env" [ qtx11extras qttools qtdeclarative ]) ] 31 30 ++ optionals stdenv.isLinux [ 32 31 libGLU 33 32 xorgproto ··· 66 65 cmakeFlags = [ 67 66 "-DCMAKE_C_FLAGS=-fPIC" 68 67 "-DCMAKE_CXX_FLAGS=-fPIC" 69 - "-D${if lib.versionOlder version "9.0" then "VTK_USE_SYSTEM_PNG" else "VTK_MODULE_USE_EXTERNAL_vtkpng"}=ON" 70 - "-D${if lib.versionOlder version "9.0" then "VTK_USE_SYSTEM_TIFF" else "VTK_MODULE_USE_EXTERNAL_vtktiff"}=1" 68 + "-DVTK_MODULE_USE_EXTERNAL_vtkpng=ON" 69 + "-DVTK_MODULE_USE_EXTERNAL_vtktiff=1" 71 70 ] ++ lib.optionals (!stdenv.isDarwin) [ 72 71 "-DOPENGL_INCLUDE_DIR=${libGL}/include" 73 72 ] ++ [ ··· 76 75 "-DCMAKE_INSTALL_BINDIR=bin" 77 76 "-DVTK_VERSIONED_INSTALL=OFF" 78 77 ] ++ optionals enableQt [ 79 - "-D${if lib.versionOlder version "9.0" then "VTK_Group_Qt:BOOL=ON" else "VTK_GROUP_ENABLE_Qt:STRING=YES"}" 80 - ] ++ optionals (enableQt && lib.versionOlder version "8.0") [ 81 - "-DVTK_QT_VERSION=5" 78 + "-DVTK_GROUP_ENABLE_Qt:STRING=YES" 82 79 ] 83 80 ++ optionals stdenv.isDarwin [ "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" ] 84 81 ++ optionals enablePython [ ··· 105 102 license = licenses.bsd3; 106 103 maintainers = with maintainers; [ knedlsepp tfmoraes lheckemann ]; 107 104 platforms = with platforms; unix; 108 - # /nix/store/xxxxxxx-apple-framework-Security/Library/Frameworks/Security.framework/Headers/Authorization.h:192:7: error: variably modified 'bytes' at file scope 109 - broken = stdenv.isDarwin && (lib.versions.major majorVersion == "8"); 110 105 }; 111 106 }