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 { majorVersion, minorVersion, sourceSha256, patchesToFetch ? [] }: 2 { stdenv, lib, fetchurl, cmake, libGLU, libGL, libX11, xorgproto, libXt, libpng, libtiff 3 , fetchpatch 4 - , enableQt ? false, qtbase, qtx11extras, qttools, qtdeclarative, qtEnv 5 , enablePython ? false, python ? throw "vtk: Python support requested, but no python interpreter was given." 6 # Darwin support 7 , AGL, Cocoa, CoreServices, DiskArbitration, IOKit, CFNetwork, Security, GLUT, OpenGL ··· 11 let 12 inherit (lib) optionalString optionals optional; 13 14 pythonMajor = lib.substring 0 1 python.pythonVersion; 15 16 - in stdenv.mkDerivation rec { 17 pname = "vtk${optionalString enableQt "-qvtk"}"; 18 - version = "${majorVersion}.${minorVersion}"; 19 20 src = fetchurl { 21 url = "https://www.vtk.org/files/release/${majorVersion}/VTK-${version}.tar.gz"; ··· 25 nativeBuildInputs = [ cmake ]; 26 27 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 ]) ]) 31 ++ optionals stdenv.isLinux [ 32 libGLU 33 xorgproto ··· 66 cmakeFlags = [ 67 "-DCMAKE_C_FLAGS=-fPIC" 68 "-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" 71 ] ++ lib.optionals (!stdenv.isDarwin) [ 72 "-DOPENGL_INCLUDE_DIR=${libGL}/include" 73 ] ++ [ ··· 76 "-DCMAKE_INSTALL_BINDIR=bin" 77 "-DVTK_VERSIONED_INSTALL=OFF" 78 ] ++ 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" 82 ] 83 ++ optionals stdenv.isDarwin [ "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" ] 84 ++ optionals enablePython [ ··· 105 license = licenses.bsd3; 106 maintainers = with maintainers; [ knedlsepp tfmoraes lheckemann ]; 107 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 }; 111 }
··· 1 { majorVersion, minorVersion, sourceSha256, patchesToFetch ? [] }: 2 { stdenv, lib, fetchurl, cmake, libGLU, libGL, libX11, xorgproto, libXt, libpng, libtiff 3 , fetchpatch 4 + , enableQt ? false, qtx11extras, qttools, qtdeclarative, qtEnv 5 , enablePython ? false, python ? throw "vtk: Python support requested, but no python interpreter was given." 6 # Darwin support 7 , AGL, Cocoa, CoreServices, DiskArbitration, IOKit, CFNetwork, Security, GLUT, OpenGL ··· 11 let 12 inherit (lib) optionalString optionals optional; 13 14 + version = "${majorVersion}.${minorVersion}"; 15 pythonMajor = lib.substring 0 1 python.pythonVersion; 16 17 + in stdenv.mkDerivation { 18 pname = "vtk${optionalString enableQt "-qvtk"}"; 19 + inherit version; 20 21 src = fetchurl { 22 url = "https://www.vtk.org/files/release/${majorVersion}/VTK-${version}.tar.gz"; ··· 26 nativeBuildInputs = [ cmake ]; 27 28 buildInputs = [ libpng libtiff ] 29 + ++ optionals enableQt [ (qtEnv "qvtk-qt-env" [ qtx11extras qttools qtdeclarative ]) ] 30 ++ optionals stdenv.isLinux [ 31 libGLU 32 xorgproto ··· 65 cmakeFlags = [ 66 "-DCMAKE_C_FLAGS=-fPIC" 67 "-DCMAKE_CXX_FLAGS=-fPIC" 68 + "-DVTK_MODULE_USE_EXTERNAL_vtkpng=ON" 69 + "-DVTK_MODULE_USE_EXTERNAL_vtktiff=1" 70 ] ++ lib.optionals (!stdenv.isDarwin) [ 71 "-DOPENGL_INCLUDE_DIR=${libGL}/include" 72 ] ++ [ ··· 75 "-DCMAKE_INSTALL_BINDIR=bin" 76 "-DVTK_VERSIONED_INSTALL=OFF" 77 ] ++ optionals enableQt [ 78 + "-DVTK_GROUP_ENABLE_Qt:STRING=YES" 79 ] 80 ++ optionals stdenv.isDarwin [ "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" ] 81 ++ optionals enablePython [ ··· 102 license = licenses.bsd3; 103 maintainers = with maintainers; [ knedlsepp tfmoraes lheckemann ]; 104 platforms = with platforms; unix; 105 }; 106 }