gnu: criu: Fix PYTHONPATH & switch to Python 3 to build criu-ns.

* gnu/packages/virtualization.scm (criu)[arguments]: Set PYTHON
in #:make-flags instead of ‘hard-coding’ it later.  Replace the
forever-broken 'wrap phase with one that doesn't attempt to support
‘--with-input’ for now.
[inputs]: Substitute python and python-protobuf for python-2 and
python2-protobuf, respectively, and remove python2-ipaddr.
This commit is contained in:
Tobias Geerinckx-Rice 2021-10-21 15:38:46 +02:00
parent b16b9f85be
commit 04542d5a6f
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79

View File

@ -1564,6 +1564,7 @@ domains, their live performance and resource utilization statistics.")
"/lib") "/lib")
(string-append "ASCIIDOC=" (assoc-ref %build-inputs "asciidoc") (string-append "ASCIIDOC=" (assoc-ref %build-inputs "asciidoc")
"/bin/asciidoc") "/bin/asciidoc")
(string-append "PYTHON=python3")
(string-append "XMLTO=" (assoc-ref %build-inputs "xmlto") (string-append "XMLTO=" (assoc-ref %build-inputs "xmlto")
"/bin/xmlto")) "/bin/xmlto"))
#:phases #:phases
@ -1583,14 +1584,7 @@ domains, their live performance and resource utilization statistics.")
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
;; Hardcode arm version detection ;; Hardcode arm version detection
(substitute* "Makefile" (substitute* "Makefile"
(("ARMV.*:=.*") "ARMV := 7\n")) (("ARMV.*:=.*") "ARMV := 7\n"))))
;; We are currently using python-2
(substitute* "crit/Makefile"
(("\\$\\(PYTHON\\)") "python2"))
(substitute* "lib/Makefile"
(("\\$\\(PYTHON\\)")
(string-append (assoc-ref inputs "python")
"/bin/python")))))
(add-before 'build 'fix-symlink (add-before 'build 'fix-symlink
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
;; The file 'images/google/protobuf/descriptor.proto' points to ;; The file 'images/google/protobuf/descriptor.proto' points to
@ -1604,15 +1598,14 @@ domains, their live performance and resource utilization statistics.")
(add-after 'install 'wrap (add-after 'install 'wrap
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
;; Make sure 'crit' runs with the correct PYTHONPATH. ;; Make sure 'crit' runs with the correct PYTHONPATH.
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(path (string-append out (site (string-append out "/lib/python"
"/lib/python" ,(version-major+minor
(string-take (string-take-right (package-version python))
(assoc-ref inputs "python") 5) 3) "/site-packages"))
"/site-packages:" (path (getenv "PYTHONPATH")))
(getenv "PYTHONPATH"))))
(wrap-program (string-append out "/bin/crit") (wrap-program (string-append out "/bin/crit")
`("PYTHONPATH" ":" prefix (,path)))))) `("PYTHONPATH" ":" prefix (,site ,path))))))
(add-after 'install 'delete-static-libraries (add-after 'install 'delete-static-libraries
;; Not building/installing these at all doesn't seem to be supported. ;; Not building/installing these at all doesn't seem to be supported.
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
@ -1620,9 +1613,8 @@ domains, their live performance and resource utilization statistics.")
(for-each delete-file (find-files out "\\.a$")))))))) (for-each delete-file (find-files out "\\.a$"))))))))
(inputs (inputs
`(("protobuf" ,protobuf) `(("protobuf" ,protobuf)
("python" ,python-2) ("python" ,python)
("python2-protobuf" ,python2-protobuf) ("python-protobuf" ,python-protobuf)
("python2-ipaddr" ,python2-ipaddr)
("iproute" ,iproute) ("iproute" ,iproute)
("libaio" ,libaio) ("libaio" ,libaio)
("libcap" ,libcap) ("libcap" ,libcap)