I agree with Ludo and Andreas that we better shouldn’t make the
name field optional.
That said, I just pushed a series of patches that happens to address
this wishlist item in a very roundabout way. It is now possible to
build packages from JSON files like this:
Toggle snippet (33 lines)
[
{
"name": "myhello",
"version": "2.10",
"source": "mirror://gnu/hello/hello-2.10.tar.gz",
"build-system": "gnu",
"arguments": {
"tests?": false
}
"home-page": "https://www.gnu.org/software/hello/",
"synopsis": "Hello, GNU world: An example GNU package",
"description": "GNU Hello prints a greeting.",
"license": "GPL-3.0+",
"native-inputs": ["gettext"]
},
{
"name": "greeter",
"version": "1.0",
"source": "https://example.com/greeter-1.0.tar.gz",
"build-system": "gnu",
"arguments": {
"test-target": "foo",
"parallel-build?": false,
},
"home-page": "https://example.com/",
"synopsis": "Greeter using GNU Hello",
"description": "This is a wrapper around GNU Hello.",
"license": "GPL-3.0+",
"inputs": ["myhello", "hello"]
}
]
As you can see, there is no variable assignment, because this is JSON.
The “name” field is the only identifier, and its value can be used as an
input in other packages (see the reference to “myhello” in the “greeter”
package definition).
It’s really only tangentially related to what this issue is about, but
it’s as close as we can get to duplication-free syntax — even though
it’s JSON and not Scheme. Look, there are also no labels for inputs!
Because there are no custom phases either…
--
Ricardo