Hello,
I am trying to package cbindgen-0.29.2 for certain Guix channel, but it
is first time trying to use the new approach to the rust-based
application, so I am unsure is this supposed to be done "correctly".
I did manage to get a working version:
--8<---------------cut here---------------start------------->8---
(package
(inherit rust-cbindgen-0.28)
(name "rust-cbindgen")
(version "0.29.2")
(inputs
(modify-inputs (package-inputs rust-cbindgen-0.28)
(append (@@ (gnu packages rust-crates) rust-heck-0.5.0))
(append (@@ (gnu packages rust-crates) rust-indexmap-2.11.4))
(append (@@ (gnu packages rust-crates) rust-serde-1.0.228))
(append (@@ (gnu packages rust-crates) rust-serde-core-1.0.228))
(append (@@ (gnu packages rust-crates) rust-serde-derive-1.0.228))
(append (@@ (gnu packages rust-crates) rust-serde-spanned-1.0.3))
(append (@@ (gnu packages rust-crates) rust-toml-0.9.8))
(append (@@ (gnu packages rust-crates) rust-toml-datetime-0.7.3))
(append (@@ (gnu packages rust-crates) rust-toml-parser-1.0.4))
(append (@@ (gnu packages rust-crates) rust-toml-writer-1.0.4))
(append (@@ (gnu packages rust-crates) rust-winnow-0.7.13))))
(source
(origin
(method url-fetch)
(uri (crate-uri "cbindgen" version))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
"168pl7jrz6zw7yi4hggqa78fgr8z8g7fyyjhihpw10cf583zvyxy")))))
--8<---------------cut here---------------end--------------->8---
However I see two problems.
1. The @@ looks pretty ugly, however I did not figure out other way.
So, how is one supposed to access the crates so that I can used them?
Technically if I find packages using the crates I need, I can get the
crates using package-inputs. But that, while keeping only to public,
documented interfaces, seems more hackish than what I already have.
2. How to replace the crates? My approach just appends to the inputs
list, but I would like to replace the ones already there. However
(replace "rust-toml" ...) did not seem to work.
Would anyone be able to provide some guidance here?
Thank you,
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.