From 968f615046bb01d8615885fd11e7fcf72ece0afc Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Fri, 11 Feb 2022 00:34:54 +0100 Subject: [PATCH v5 27/32] 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 00c8db7f34..6c02eb8cce 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -279,7 +279,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 @@ -313,7 +313,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 `(("double-conversion" ,double-conversion) @@ -345,6 +370,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.34.0