summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/image-processing.scm83
-rw-r--r--gnu/packages/patches/vtk-8-fix-freetypetools-build-failure.patch36
3 files changed, 116 insertions, 4 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 66687b420c..09a9965c19 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1821,6 +1821,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/vte-CVE-2012-2738-pt1.patch			\
   %D%/packages/patches/vte-CVE-2012-2738-pt2.patch			\
   %D%/packages/patches/vtk-fix-freetypetools-build-failure.patch	\
+  %D%/packages/patches/vtk-8-fix-freetypetools-build-failure.patch	\
   %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch	\
   %D%/packages/patches/webkitgtk-share-store.patch		\
   %D%/packages/patches/webkitgtk-bind-all-fonts.patch		\
diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index d1d890e733..7408457814 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -358,7 +358,8 @@ integrates with various databases on GUI toolkits such as Qt and Tk.")
 
 ;; freecad needs an old version of VTK, because VTK's API changed from 8 to 9
 (define-public vtk-8
-  (package (inherit vtk)
+  (package
+    (name "vtk")
     (version "8.2.0")
     (source (origin
               (method url-fetch)
@@ -367,10 +368,84 @@ integrates with various databases on GUI toolkits such as Qt and Tk.")
                                   "/VTK-" version ".tar.gz"))
               (sha256
                (base32
-                "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl"))))
+                "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl"))
+              (patches
+               (search-patches "vtk-8-fix-freetypetools-build-failure.patch"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (for-each
+                    (lambda (dir)
+                      (delete-file-recursively
+                        (string-append "ThirdParty/" dir "/vtk" dir)))
+                    ;; ogg, pugixml depended upon unconditionally
+                    '("doubleconversion" "eigen" "expat" "freetype" "gl2ps"
+                      "glew" "hdf5" "jpeg" "jsoncpp" "libproj" "libxml2" "lz4"
+                      "netcdf" "png" "sqlite" "theora" "tiff" "zlib"))
+                  #t))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:build-type "Release"           ;Build without '-g' to save space.
+       #:configure-flags '(;"-DBUILD_TESTING:BOOL=TRUE"
+                           ;"-DVTK_MODULE_USE_EXTERNAL_vtkogg:BOOL=TRUE"    ; not honored
+                           "-DVTK_USE_SYSTEM_DOUBLECONVERSION:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_EIGEN:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_EXPAT:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_FREETYPE:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_GL2PS:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_GLEW:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_HDF5:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_JPEG:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_JSONCPP:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_LIBPROJ:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_LIBXML2:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_LZ4:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_NETCDF:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_PNG:BOOL=TRUE"
+                           ;"-DVTK_USE_SYSTEM_PUGIXML:BOOL=TRUE"    ; breaks IO/CityGML
+                           "-DVTK_USE_SYSTEM_SQLITE:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_THEORA:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_TIFF:BOOL=TRUE"
+                           "-DVTK_USE_SYSTEM_ZLIB:BOOL=TRUE")
+       #:tests? #f))        ;XXX: test data not included
     (inputs
-     `(("jsoncpp" ,jsoncpp-for-tensorflow)
-       ,@(alist-delete "jsoncpp" (package-inputs vtk))))))
+     `(("double-conversion" ,double-conversion)
+       ("eigen" ,eigen)
+       ("expat" ,expat)
+       ("freetype" ,freetype)
+       ("gl2ps" ,gl2ps)
+       ("glew" ,glew)
+       ("glu" ,glu)
+       ("hdf5" ,hdf5)
+       ("jpeg" ,libjpeg-turbo)
+       ("jsoncpp" ,jsoncpp)
+       ;("libogg" ,libogg)
+       ("libtheora" ,libtheora)
+       ("libX11" ,libx11)
+       ("libxml2" ,libxml2)
+       ("libXt" ,libxt)
+       ("lz4" ,lz4)
+       ("mesa" ,mesa)
+       ("netcdf" ,netcdf)
+       ("png" ,libpng)
+       ("proj" ,proj.4)
+       ;("pugixml" ,pugixml)
+       ("sqlite" ,sqlite)
+       ("tiff" ,libtiff)
+       ("xorgproto" ,xorgproto)
+       ("zlib" ,zlib)))
+    (home-page "https://vtk.org/")
+    (synopsis "Libraries for 3D computer graphics")
+    (description
+     "The Visualization Toolkit (VTK) is a C++ library for 3D computer graphics,
+image processing and visualization.  It supports a wide variety of
+visualization algorithms including: scalar, vector, tensor, texture, and
+volumetric methods; and advanced modeling techniques such as: implicit
+modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay
+triangulation.  VTK has an extensive information visualization framework, has
+a suite of 3D interaction widgets, supports parallel processing, and
+integrates with various databases on GUI toolkits such as Qt and Tk.")
+    (license license:bsd-3)))
 
 ;; itksnap needs an older variant of VTK.
 (define-public vtk-6
diff --git a/gnu/packages/patches/vtk-8-fix-freetypetools-build-failure.patch b/gnu/packages/patches/vtk-8-fix-freetypetools-build-failure.patch
new file mode 100644
index 0000000000..6988e65872
--- /dev/null
+++ b/gnu/packages/patches/vtk-8-fix-freetypetools-build-failure.patch
@@ -0,0 +1,36 @@
+This fixes a build failure in VTK when building against recent versions
+of freetype.
+
+  https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7432
+
+Patch by Ben Boeckel <ben.boeckel@kitware.com>
+
+Subject: [PATCH] vtkFreeTypeTools: avoid using an internal macro
+
+This macro has been removed upstream as it was always intended to be
+private.
+---
+ Rendering/FreeType/vtkFreeTypeTools.cxx | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/Rendering/FreeType/vtkFreeTypeTools.cxx b/Rendering/FreeType/vtkFreeTypeTools.cxx
+index c54289dc60..03b899c4da 100644
+--- a/Rendering/FreeType/vtkFreeTypeTools.cxx
++++ b/Rendering/FreeType/vtkFreeTypeTools.cxx
+@@ -387,11 +387,8 @@ FTC_CMapCache* vtkFreeTypeTools::GetCMapCache()
+ }
+ 
+ //----------------------------------------------------------------------------
+-FT_CALLBACK_DEF(FT_Error)
+-vtkFreeTypeToolsFaceRequester(FTC_FaceID face_id,
+-                              FT_Library lib,
+-                              FT_Pointer request_data,
+-                              FT_Face* face)
++static FT_Error vtkFreeTypeToolsFaceRequester(
++  FTC_FaceID face_id, FT_Library lib, FT_Pointer request_data, FT_Face* face)
+ {
+ #if VTK_FTFC_DEBUG_CD
+   printf("vtkFreeTypeToolsFaceRequester()\n");
+-- 
+2.30.1
+