From 4f20eb002758f868cafdedd3bf1e9c947026bf75 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Fri, 11 Feb 2022 00:34:54 +0100 Subject: [PATCH v6 24/28] gnu: vtk: Also install a .egg-info. * gnu/packages/image-processing.scm (vtk) [phase install-egg-info]: New phase. --- gnu/packages/image-processing.scm | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index 1995f71cc2..7bab07c58c 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -328,7 +328,7 @@ (define-public vtk (properties `((release-monitoring-url . "https://vtk.org/download/"))) (build-system cmake-build-system) (arguments - '(#:build-type "Release" ;Build without '-g' to save space. + `(#:build-type "Release" ;Build without '-g' to save space. #:configure-flags '(;"-DBUILD_TESTING:BOOL=TRUE" ; ; not honored "-DVTK_USE_EXTERNAL=OFF" ;; default @@ -362,7 +362,32 @@ (define-public vtk (substitute* "Common/Core/vtkFloatingPointExceptions.cxx" (("") "")) (substitute* "Common/Core/CMakeLists.txt" - (("fenv.h") "cfenv"))))) + (("fenv.h") "cfenv")))) + (add-after 'install 'install-egg-info + (lambda* (#:key outputs #:allow-other-keys) + (use-modules (ice-9 rdelim) (guix build utils)) + (call-with-output-file "get-python-version.py" + (lambda (port) + (format port "import sys +v = sys.version_info +with open('path', 'w') as f: + f.write('{0}.{1}'.format(v.major, v.minor)) +" port))) + (invoke "python3" "get-python-version.py") + (let* ((python-version + (call-with-input-file "path" read-line)) + (egg-info + (format #f "~a/lib/python~a/site-packages/vtk-~a-py~a.egg-info" + (assoc-ref outputs "out") + python-version ,version python-version))) + (mkdir-p egg-info) + (call-with-output-file (string-append egg-info "/PKG-INFO") + (lambda (port) + (format port "Metadata-Version: 2.1 +Name: vtk +Version: ~a +" + ,version))))))) #:tests? #f)) ;XXX: test data not included (inputs (list double-conversion @@ -394,6 +419,7 @@ (define-public vtk ;; VTK's 'VTK-vtk-module-find-packages.cmake' calls ;; 'find_package(THEORA)', which in turns looks for libogg. (list libogg)) + (native-inputs (list python)) (home-page "https://vtk.org/") (synopsis "Libraries for 3D computer graphics") (description -- 2.36.1