about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/vtk
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-06-04 10:19:13 +0000
committerAlyssa Ross <hi@alyssa.is>2020-06-04 22:45:31 +0000
commitda8562f302a145605a3270114ea7063daa82a173 (patch)
treeb27c6d509bad0ee5449f1fcf261a7ec3210df495 /nixpkgs/pkgs/development/libraries/vtk
parent17df60ef482ef52b2088e1913de9cd436320612a (diff)
parent467ce5a9f45aaf96110b41eb863a56866e1c2c3c (diff)
downloadnixlib-da8562f302a145605a3270114ea7063daa82a173.tar
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.gz
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.bz2
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.lz
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.xz
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.zst
nixlib-da8562f302a145605a3270114ea7063daa82a173.zip
Merge commit '467ce5a9f45aaf96110b41eb863a56866e1c2c3c'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/vtk')
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/7.x.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/default.nix17
2 files changed, 79 insertions, 12 deletions
diff --git a/nixpkgs/pkgs/development/libraries/vtk/7.x.nix b/nixpkgs/pkgs/development/libraries/vtk/7.x.nix
new file mode 100644
index 000000000000..f3ec383fddfb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vtk/7.x.nix
@@ -0,0 +1,74 @@
+{ stdenv, fetchurl, cmake, libGLU, libGL, libX11, xorgproto, libXt, libtiff
+, fetchpatch
+, qtLib ? null
+, enablePython ? false, python ? null
+# Darwin support
+, Cocoa, CoreServices, DiskArbitration, IOKit, CFNetwork, Security, GLUT, OpenGL
+, ApplicationServices, CoreText, IOSurface, ImageIO, xpc, libobjc }:
+
+with stdenv.lib;
+
+let
+  os = stdenv.lib.optionalString;
+  majorVersion = "7.1";
+  minorVersion = "1";
+  version = "${majorVersion}.${minorVersion}";
+in
+
+stdenv.mkDerivation rec {
+  name = "vtk-${os (qtLib != null) "qvtk-"}${version}";
+  src = fetchurl {
+    url = "${meta.homepage}files/release/${majorVersion}/VTK-${version}.tar.gz";
+    sha256 = "0nm7xwwj7rnsxjdv2ssviys8nhci4n9iiiqm2y14s520hl2dsp1d";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://gitlab.kitware.com/vtk/vtk/-/commit/706f1b397df09a27ab8981ab9464547028d0c322.diff";
+      sha256 = "1q3pi5h40g05pzpbqp75xlgzvbfvyw8raza51svmi7d8dlslqybx";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ libtiff ]
+    ++ optional (qtLib != null) qtLib
+    ++ optionals stdenv.isLinux [ libGLU libGL libX11 xorgproto libXt ]
+    ++ optionals stdenv.isDarwin [ xpc Cocoa CoreServices DiskArbitration IOKit
+                                   CFNetwork Security ApplicationServices CoreText
+                                   IOSurface ImageIO OpenGL GLUT ]
+    ++ optional enablePython [
+      python
+    ];
+  propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ libobjc ];
+
+  preBuild = ''
+    export LD_LIBRARY_PATH="$(pwd)/lib";
+  '';
+
+  # Shared libraries don't work, because of rpath troubles with the current
+  # nixpkgs cmake approach. It wants to call a binary at build time, just
+  # built and requiring one of the shared objects.
+  # At least, we use -fPIC for other packages to be able to use this in shared
+  # objects.
+  cmakeFlags = [ "-DCMAKE_C_FLAGS=-fPIC" "-DCMAKE_CXX_FLAGS=-fPIC" "-DVTK_USE_SYSTEM_TIFF=1" "-DOPENGL_INCLUDE_DIR=${libGL}/include" ]
+    ++ optional (qtLib != null) [ "-DVTK_Group_Qt:BOOL=ON" ]
+    ++ optional stdenv.isDarwin [ "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" ]
+    ++ optional enablePython [ "-DVTK_WRAP_PYTHON:BOOL=ON" ];
+
+  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+    sed -i 's|COMMAND vtkHashSource|COMMAND "DYLD_LIBRARY_PATH=''${VTK_BINARY_DIR}/lib" ''${VTK_BINARY_DIR}/bin/vtkHashSource-${majorVersion}|' ./Parallel/Core/CMakeLists.txt
+    sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/' ./ThirdParty/libxml2/vtklibxml2/xmlschemas.c
+    sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/g' ./ThirdParty/libxml2/vtklibxml2/xpath.c
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Open source libraries for 3D computer graphics, image processing and visualization";
+    homepage = "https://www.vtk.org/";
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = with stdenv.lib.maintainers; [ knedlsepp ];
+    platforms = with stdenv.lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vtk/default.nix b/nixpkgs/pkgs/development/libraries/vtk/default.nix
index 1cc706f4eb73..4ef140a09996 100644
--- a/nixpkgs/pkgs/development/libraries/vtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vtk/default.nix
@@ -10,8 +10,8 @@ with stdenv.lib;
 
 let
   os = stdenv.lib.optionalString;
-  majorVersion = "7.1";
-  minorVersion = "1";
+  majorVersion = "8.2";
+  minorVersion = "0";
   version = "${majorVersion}.${minorVersion}";
 in
 
@@ -19,20 +19,13 @@ stdenv.mkDerivation rec {
   name = "vtk-${os (qtLib != null) "qvtk-"}${version}";
   src = fetchurl {
     url = "${meta.homepage}files/release/${majorVersion}/VTK-${version}.tar.gz";
-    sha256 = "0nm7xwwj7rnsxjdv2ssviys8nhci4n9iiiqm2y14s520hl2dsp1d";
+    sha256 = "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl";
   };
 
-  patches = [
-    (fetchpatch {
-      url = "https://gitlab.kitware.com/vtk/vtk/-/commit/706f1b397df09a27ab8981ab9464547028d0c322.diff";
-      sha256 = "1q3pi5h40g05pzpbqp75xlgzvbfvyw8raza51svmi7d8dlslqybx";
-    })
-  ];
-
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ libtiff ]
-    ++ optional (qtLib != null) qtLib
+    ++ optionals (qtLib != null) (with qtLib; [ qtbase qtx11extras qttools ])
     ++ optionals stdenv.isLinux [ libGLU libGL libX11 xorgproto libXt ]
     ++ optionals stdenv.isDarwin [ xpc Cocoa CoreServices DiskArbitration IOKit
                                    CFNetwork Security ApplicationServices CoreText
@@ -47,7 +40,7 @@ stdenv.mkDerivation rec {
   '';
 
   # Shared libraries don't work, because of rpath troubles with the current
-  # nixpkgs camke approach. It wants to call a binary at build time, just
+  # nixpkgs cmake approach. It wants to call a binary at build time, just
   # built and requiring one of the shared objects.
   # At least, we use -fPIC for other packages to be able to use this in shared
   # objects.