diff options
Diffstat (limited to '')
-rwxr-xr-x | src/bin/paku | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/src/bin/paku b/src/bin/paku index 55372b6..94f8d38 100755 --- a/src/bin/paku +++ b/src/bin/paku @@ -172,17 +172,12 @@ sub emit_nix() { $ns = rec { EOF for my $pkg (@{$json->{packages}}) { - if ($pkg->{label} eq 'latest') { - print <<~EOF; - $pkg->{name} = $pkg->{name}-latest; - EOF - } - my $long = $pkg->{'long-description'}; $long =~ s/^(.)/ $1/gm; + my $suffix = $pkg->{label} eq 'latest' ? '' : "-$pkg->{label}"; print <<~EOF; - $pkg->{name}-$pkg->{label} = pkgs.stdenv.mkDerivation rec { + $pkg->{name}$suffix = pkgs.stdenv.mkDerivation rec { name = "$pkg->{name}"; version = "$pkg->{version}"; @@ -261,18 +256,17 @@ sub emit_guix() { my @pkgs = (); for my $pkg (@{$json->{packages}}) { - if ($pkg->{label} eq 'latest') { - push @pkgs, "$pkg->{name}"; - } - my $long = $pkg->{'long-description'}; $long =~ s/^(.)/ $1/gm; - push @pkgs, "$pkg->{name}-$pkg->{label}"; + my $name = $pkg->{name} . ( + $pkg->{label} eq 'latest' ? '' : "-$pkg->{label}" + ); + push @pkgs, $name; print <<~EOF; - (define-public $pkg->{name}-$pkg->{label} + (define-public $name (package - (name "$pkg->{name}-$pkg->{label}") + (name "$name") (version "$pkg->{version}") (source (origin @@ -313,16 +307,6 @@ sub emit_guix() { (license licenses:agpl3+))) EOF - if ($pkg->{type} eq 'latest') { - print <<~EOF; - (define-public $pkg->{name} - (package - (inherit $pkg->{name}-latest) - (name "$pkg->{name}"))) - - - EOF - } } print '(list'; for (@pkgs) { |