aboutsummaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-22 16:56:10 -0300
committerEuAndreh <eu@euandre.org>2023-03-22 16:56:10 -0300
commit673226a47f5ebe6f3083c449dd005589f2769a0b (patch)
tree7c600ce1f9abb71c368edcbc1804a4a58b26f6b7 /src/bin
parentSupport Homebrew (diff)
downloadpackage-repository-673226a47f5ebe6f3083c449dd005589f2769a0b.tar.gz
package-repository-673226a47f5ebe6f3083c449dd005589f2769a0b.tar.xz
Remove redundant "-latest" variants of packages in Guix and Nix
Diffstat (limited to 'src/bin')
-rwxr-xr-xsrc/bin/paku32
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) {