gnu: compiledb: Switch to pyproject.

* gnu/packages/build-tools.scm (compiledb):
[source]: Switch to git-fetch.
[build-system]: Switch to pyproject-build-system.
[arguments]<#:phases>: Improve style, add substitution to fix tests.
[native-inputs]: Add python-pytest, python-setuptools, python-wheel.

Change-Id: Iaafbd32f7e7622ea95dcff9944cdccee600d80cd
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves 2025-08-14 10:23:12 +02:00 committed by Sharlatan Hellseher
parent bf54c7e264
commit e46a5255ff
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -775,25 +775,33 @@ right compilation options.")
(version "0.10.1") (version "0.10.1")
(source (source
(origin (origin
(method url-fetch) (method git-fetch)
(uri (pypi-uri "compiledb" version)) (uri (git-reference
(url "https://github.com/nickdiego/compiledb")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256 (sha256
(base32 "0vlngsdxfakyl8b7rnvn8h3l216lhbrrydr04yhy6kd03zflgfq6")))) (base32 "0qricdgqzry7j3rmgwyd43av3c2kxpzkh6f9zcqbzrjkn78qbpd4"))))
(build-system python-build-system) (build-system pyproject-build-system)
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'no-compat-shim-dependency (add-after 'unpack 'no-compat-shim-dependency
;; shutilwhich is only needed for python 3.3 and earlier ;; shutilwhich is only needed for python 3.3 and earlier
(lambda _ (lambda* (#:key inputs #:allow-other-keys)
(substitute* "setup.py" (("^ *'shutilwhich'\n") "")) (substitute* "setup.py"
(substitute* "compiledb/compiler.py" (("shutilwhich") "shutil"))))))) (("^ *'shutilwhich'\n")
(propagated-inputs ""))
(list python-bashlex python-click)) (substitute* "compiledb/compiler.py"
(native-inputs (("shutilwhich")
(list python-pytest)) "shutil"))
(home-page (substitute* "tests/data/multiple_commands_oneline.txt"
"https://github.com/nickdiego/compiledb") (("/bin/echo")
(search-input-file inputs "bin/echo"))))))))
(propagated-inputs (list python-bashlex python-click))
(native-inputs (list python-pytest python-setuptools python-wheel))
(home-page "https://github.com/nickdiego/compiledb")
(synopsis (synopsis
"Generate Clang JSON Compilation Database files for make-based build systems") "Generate Clang JSON Compilation Database files for make-based build systems")
(description (description