summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/storage.scm45
1 files changed, 39 insertions, 6 deletions
diff --git a/gnu/packages/storage.scm b/gnu/packages/storage.scm
index 38175ff118..092f8af6c7 100644
--- a/gnu/packages/storage.scm
+++ b/gnu/packages/storage.scm
@@ -404,6 +404,14 @@ clients. The key features are:
(lambda _
(rmdir "isa-l")
(symlink #$(package-source (this-package-input "isa-l")) "isa-l")))
+ (add-after 'substitute-git-submodules 'skip-python-make-subdir
+ ;; SPDK's Makefile calls 'pip install' for the python subdir, but
+ ;; pip 25+ crashes in the sandbox (SSL cert path not found at
+ ;; import time). Remove python from DIRS-y and install the package
+ ;; ourselves in install-python-package below.
+ (lambda _
+ (substitute* "Makefile"
+ (("DIRS-y \\+= python") ""))))
(replace 'configure
(lambda* (#:key configure-flags #:allow-other-keys)
(substitute* "configure"
@@ -443,7 +451,8 @@ clients. The key features are:
(string-append #$(this-package-input "dpdk") "/lib")
(string-append #$(this-package-input "fuse") "/lib")
(string-append #$(this-package-input "gcc") "/lib")
- (string-append #$(this-package-input "glibc") "/lib")))
+ (string-append #$(this-package-input "glibc") "/lib")
+ (string-append #$(this-package-input "ncurses") "/lib")))
(rpath* (apply string-append (map (lambda (l) (string-append l ":")) libs))))
(for-each
(lambda (b)
@@ -459,9 +468,30 @@ clients. The key features are:
binaries))))
(add-after 'patchelf 'python:wrap
(assoc-ref py:%standard-phases 'wrap))
+ (add-before 'python:wrap 'install-python-package
+ ;; Install the SPDK Python package using hatchling + installer,
+ ;; bypassing pip (which crashes in the sandbox due to SSL).
+ ;; spdk/version.py is normally generated by python/Makefile, so
+ ;; we recreate it here from the top-level VERSION file.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (invoke "python" "-c"
+ (string-append
+ "v=open('VERSION').read().strip();"
+ "p=v.split('.');"
+ "ver=p[0]+'.'+p[1]+(('.'+p[2]) if len(p)>2 and p[2]!='0' else '');"
+ "open('python/spdk/version.py','w')"
+ ".write(\"__version__ = '\"+ver+\"'\\n\")"))
+ ;; ZIP format requires timestamps >= 1980; Guix normalizes
+ ;; source timestamps to epoch 0, so clamp SOURCE_DATE_EPOCH.
+ (setenv "SOURCE_DATE_EPOCH" "315532800")
+ (with-directory-excursion "python"
+ (invoke "python" "-m" "hatchling" "build" "-t" "wheel")
+ (let ((wheel (car (find-files "dist" "\\.whl$"))))
+ (invoke "python" "-m" "installer"
+ "--prefix" #$output wheel)))))
(add-after 'python:wrap 'wrap-python-scripts
(lambda* (#:key inputs #:allow-other-keys)
- (let* ((scripts '("bin/spdk_cli" "bin/spdk_rpc" ))
+ (let* ((scripts '("bin/spdk-cli" "bin/spdk-rpc"))
(dependencies (map (lambda (input)
(assoc-ref inputs input))
'("python-configshell-fb")))
@@ -479,6 +509,7 @@ clients. The key features are:
automake
patchelf
pkg-config
+ python-installer
python-wrapper))
(inputs
(list cunit
@@ -499,9 +530,7 @@ clients. The key features are:
openlibm
openssl
python-configshell-fb
- python-pip ; XXX: expected by install, check why
- python-setuptools ;
- python-wheel ;
+ python-hatchling ;build backend for python/pyproject.toml
(list util-linux "lib") ;; <uuid.h>
zlib
zstd))
@@ -510,7 +539,11 @@ clients. The key features are:
(description
"@acronym{Storage Performance Development Kit, SPDK} provides a set of
tools and libraries for writing high performance,scalable, user-mode storage
-applications.")
+applications.
+
+Note: the @command{spdk-mcp} binary requires the optional @code{mcp[cli]}
+Python dependency, and @command{spdk-sma} requires @code{grpcio} and
+@code{protobuf}. These are not currently packaged in Guix.")
(license license:bsd-3)))
(define-public swapspace