From 31c5b9454b5c8be82772c10a5fdf4a1bc1074112 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 21 Mar 2023 15:18:04 -0300 Subject: src/bin/paku: First-ish version of HTML output --- src/bin/paku | 172 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) (limited to 'src/bin/paku') diff --git a/src/bin/paku b/src/bin/paku index 8acb991..6ba6d04 100755 --- a/src/bin/paku +++ b/src/bin/paku @@ -88,6 +88,18 @@ my $json = JSON::decode_json($json_str); my $action = $ARGV[0] or die "Missing ACTION"; +sub pretty_version($pkg) { + if ($pkg->{type} eq 'latest') { + return ('latest', ''); + } else { + my $ver = $pkg->{version}; + $ver =~ s/^v//; + $ver =~ s/\./-/g; + return ($ver, "-$ver"); + } +} + + sub emit_release() { my $f = $ARGV[1]; my $name = File::Basename::basename $f; @@ -434,7 +446,167 @@ sub emit_debian() { } sub emit_html() { + print <<~EOF; + + + + + + + $json->{name} package index + + + + +
+

+ $json->{name} package index +

+ +
+

Guix instructions

+

+ Add this channel to your + ~/.config/guix/channels.scm: +

+
(cons*
+		 (channel
+		  (name 'org-euandre)
+		  (url "git://euandre.org/package-repository")
+		  (branch "main")
+		  (introduction
+		   (make-channel-introduction
+		    "d749e053e6db365069cb9b2ef47a78b06f9e7361"
+		    (openpgp-fingerprint
+		     "5BDA E9B8 B2F6 C6BC BB0D  6CE5 81F9 0EC3 CD35 6060"))))
+		 %default-channels)
+

+ Afterwards, do a guix pull to make the + packages in this channel available to your profile. +

+

+ See also the + Guix manual on channels + for more information. +

+
+
+

Debian instructions

+

+ Include my public key for validating the repository + signatures: + ~/.config/guix/channels.scm: +

+
\$ wget -qO- https://euandre.org/s/package-repository/debian/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/euandre.org.asc
+

+ Afterwards, include this repository to the list of + repositories that apt uses for sources + by adding its URL to + /etc/apt/sources.list: +

+
\$ sudo apt-add-repository 'deb https://euandre.org/s/package-repository/debian ./'
+

+ apt-add-repository will already perform + an apt update, so the packages from the + new repository will already be available. +

+
+
+

Nix instructions

+

+ Add this repository as an overlay to your + /etc/nixos/configuration.nix: +

+
  nixpkgs = {
+		    overlays = [
+		      (import (fetchTarball {
+		        url = "https://euandre.org/git/package-repository/snapshot/package-repository-main.tar.gz";
+		      }) { inherit pkgs; })
+		    ];
+		  };
+

+ All the packages live under the + org-euandre attribute set. +

+
+
+ + + EOF } -- cgit v1.2.3