diff options
author | EuAndreh <eu@euandre.org> | 2023-03-29 11:33:35 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-03-29 11:33:35 -0300 |
commit | 805a954f40e943e74123def29897be53bce318ea (patch) | |
tree | 7e39bd8e16eb5189e516d5a57696e74f2b207c79 /src | |
parent | src/bin/paku.in: Generate build.nix (diff) | |
download | package-repository-805a954f40e943e74123def29897be53bce318ea.tar.gz package-repository-805a954f40e943e74123def29897be53bce318ea.tar.xz |
paku.lock: Separate "version" and "vversion"
Diffstat (limited to 'src')
-rwxr-xr-x | src/bin/paku.in | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/bin/paku.in b/src/bin/paku.in index 8dc30c9..72f901d 100755 --- a/src/bin/paku.in +++ b/src/bin/paku.in @@ -245,7 +245,7 @@ sub emit_nix() { print <<~EOF; $pkg->{name}$suffix = pkgs.stdenv.mkDerivation rec { name = "$pkg->{name}"; - version = "$pkg->{version}"; + version = "$pkg->{vversion}"; src = fetchTarball { url = @@ -326,7 +326,6 @@ sub emit_guix() { for my $pkg (@{$json->{packages}}) { my $long = $pkg->{'long-description'}; $long =~ s/^(.)/ $1/gm; - my $ver = $pkg->{version} =~ s/^v//r; my $license = license_for 'guix', $license_mapping, $pkg->{license}; my $name = $pkg->{name} . ( @@ -337,7 +336,7 @@ sub emit_guix() { (define-public $name (package (name "$pkg->{name}") - (version "$ver") + (version "$pkg->{version}") (source (origin (method url-fetch) @@ -407,7 +406,7 @@ sub emit_debian() { wget -O \$\@ \\ '$pkg->{url}' - \$(DIR)/debian/builddirs/$pkg->{name}-$pkg->{version}: \$(DIR)/debian/tarballs/$pkg->{fname} + \$(DIR)/debian/builddirs/$pkg->{name}-$pkg->{vversion}: \$(DIR)/debian/tarballs/$pkg->{fname} mkdir -p \$(\@D) tar -C \$(\@D) -xf \$(DIR)/debian/tarballs/$pkg->{fname} touch \$\@ @@ -419,26 +418,26 @@ sub emit_debian() { my $deb_name = "$pkg->{name}_" . ( - $pkg->{label} eq 'latest' ? 'latest' : $pkg->{version} + $pkg->{label} eq 'latest' ? 'latest' : $pkg->{vversion} ) . "_all.deb"; my $deb_path = "\$(DIR)/debian/public/$deb_name"; push @debs, "\t$deb_path \\\n"; - my $ver = $pkg->{label} eq 'latest' ? '0.' . $pkg->{version} . '.latest' : $pkg->{version}; + my $ver = $pkg->{label} eq 'latest' ? '0.' . $pkg->{vversion} . '.latest' : $pkg->{vversion}; $ver =~ s/^v//; push @targets, <<~EOF; - \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{version}/DEBIAN: \$(DIR)/debian/builddirs/$pkg->{name}-$pkg->{version} + \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}/DEBIAN: \$(DIR)/debian/builddirs/$pkg->{name}-$pkg->{vversion} \$(MAKE) \\ - -C \$(DIR)/debian/builddirs/$pkg->{name}-$pkg->{version} \\ + -C \$(DIR)/debian/builddirs/$pkg->{name}-$pkg->{vversion} \\ install \\ PREFIX=/usr \\ DESTDIR="\$\$PWD"/\$(\@D) mkdir -p \$\@ touch \$\@ - \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{version}/DEBIAN/control: \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{version}/DEBIAN + \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}/DEBIAN/control: \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}/DEBIAN printf '' > \$\@ printf 'Package: $pkg->{name}\\n' >> \$\@ printf 'Version: $ver\\n' >> \$\@ @@ -462,12 +461,12 @@ sub emit_debian() { sed 's|^| |' >> \$\@ printf '\\n' >> \$\@ - \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{version}.deb: \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{version}/DEBIAN/control - dpkg-deb --build \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{version} + \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}.deb: \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}/DEBIAN/control + dpkg-deb --build \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion} - $deb_path: \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{version}.deb + $deb_path: \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}.deb mkdir -p \$(\@D) - cp \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{version}.deb \$\@ + cp \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}.deb \$\@ EOF @@ -527,7 +526,7 @@ sub emit_alpine() { } my $date = $pkg->{date} =~ s/-//gr; - my $ver = $pkg->{label} eq 'latest' ? "0.0.1_git$date" : $pkg->{version}; + my $ver = $pkg->{label} eq 'latest' ? "0.0.1_git$date" : $pkg->{vversion}; my $dir = "$d/$pkg->{name}" . ( $pkg->{label} eq 'latest' ? '' : "-$pkg->{label}" ); @@ -550,7 +549,7 @@ sub emit_alpine() { source='$pkg->{url}' pkgbasedir="\$startdir/.abuild/pkg" srcdir="\$startdir/.abuild/src" - builddir="\$srcdir/$pkg->{name}-$pkg->{version}" + builddir="\$srcdir/$pkg->{name}-$pkg->{vversion}" build() { make PREFIX=/usr @@ -581,7 +580,7 @@ sub emit_alpine() { next if $pkg->{architectures} ne 'any'; my $date = $pkg->{date} =~ s/-//gr; - my $ver = $pkg->{label} eq 'latest' ? "0.0.1_git$date" : $pkg->{version}; + my $ver = $pkg->{label} eq 'latest' ? "0.0.1_git$date" : $pkg->{vversion}; my $recipe_dir = "src/alpine/$pkg->{name}" . ( $pkg->{label} eq 'latest' ? '' : "-$pkg->{label}" @@ -740,9 +739,9 @@ sub emit_html() { my $suffix = $pkg->{label} eq 'latest' ? '' : "-$pkg->{label}"; my $apt_suffix = $suffix =~ s/-/=/r; my $id = $pkg->{name} . ( - $pkg->{label} eq 'latest' ? '' : "-$pkg->{version}" + $pkg->{label} eq 'latest' ? '' : "-$pkg->{vversion}" ); - my $label = $pkg->{label} eq 'latest' ? 'latest' : $pkg->{version}; + my $label = $pkg->{label} eq 'latest' ? 'latest' : $pkg->{vversion}; print <<~EOF; <li id="$id"> <details> |