aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--paku.lock6
-rwxr-xr-xsrc/bin/paku.in23
2 files changed, 21 insertions, 8 deletions
diff --git a/paku.lock b/paku.lock
index 75537b2..73a8e32 100644
--- a/paku.lock
+++ b/paku.lock
@@ -6,8 +6,10 @@
]
},
"mappings": {
- "guile": {
- "guix": "guile-3.0"
+ "guix": {
+ "guile": [
+ "guile-3.0"
+ ]
}
},
"namespace": "org.euandre",
diff --git a/src/bin/paku.in b/src/bin/paku.in
index a93ea82..a19b3e5 100755
--- a/src/bin/paku.in
+++ b/src/bin/paku.in
@@ -103,6 +103,18 @@ sub license_for($target, $id) {
return $licenses->{$target}->{$id};
}
+sub inputs_for($mappings, @inputs) {
+ my @out = ();
+ for (@inputs) {
+ if (!$mappings->{$_}) {
+ push @out, $_;
+ } else {
+ push @out, @{$mappings->{$_}};
+ }
+ }
+ return @out;
+}
+
sub emit_packages() {
for (@ARGV) {
my $fh;
@@ -267,6 +279,7 @@ sub emit_guix() {
EOF
+ my $mappings = $json->{mappings}{guix};
my @pkgs = ();
for my $pkg (@{$json->{packages}}) {
my $long = $pkg->{'long-description'};
@@ -294,17 +307,15 @@ sub emit_guix() {
EOF
print ' (list';
- for my $input (@{$pkg->{'native-inputs'}}) {
- my $name = $json->{mappings}{$input}{guix} || $input;
- print "\n $name";
+ for (inputs_for $mappings, @{$pkg->{'native-inputs'}}) {
+ print "\n $_";
}
print "))\n";
print " (inputs\n";
print ' (list';
- for my $input (@{$pkg->{inputs}}) {
- my $name = $json->{mappings}{$input}{guix} || $input;
- print "\n $name";
+ for (inputs_for $mappings, @{$pkg->{inputs}}) {
+ print "\n $_";
}
print "))\n";