diff options
Diffstat (limited to '')
-rw-r--r-- | default.nix | 10 | ||||
-rw-r--r-- | paku.lock | 11 | ||||
-rwxr-xr-x | src/bin/paku | 35 |
3 files changed, 42 insertions, 14 deletions
diff --git a/default.nix b/default.nix index c406b44..3f9db4d 100644 --- a/default.nix +++ b/default.nix @@ -32,7 +32,7 @@ self: super: { homepage = "https://euandre.org/s/git-permalink/"; changelog = "https://euandre.org/s/git-permalink/CHANGELOG.html"; downloadPage = "https://euandre.org/s/git-permalink/#releases"; - license = licenses.agpl3; + license = licenses.agpl3Plus; platforms = platforms.unix; }; }; @@ -67,7 +67,7 @@ self: super: { homepage = "https://euandre.org/s/git-permalink/"; changelog = "https://euandre.org/s/git-permalink/CHANGELOG.html"; downloadPage = "https://euandre.org/s/git-permalink/#releases"; - license = licenses.agpl3; + license = licenses.agpl3Plus; platforms = platforms.unix; }; }; @@ -101,7 +101,7 @@ self: super: { homepage = "https://euandre.org/s/remembering/"; changelog = "https://euandre.org/s/remembering/CHANGELOG.html"; downloadPage = "https://euandre.org/s/remembering/#releases"; - license = licenses.agpl3; + license = licenses.agpl3Plus; platforms = platforms.unix; }; }; @@ -137,7 +137,7 @@ self: super: { homepage = "https://euandre.org/s/td/"; changelog = "https://euandre.org/s/td/CHANGELOG.html"; downloadPage = "https://euandre.org/s/td/#releases"; - license = licenses.agpl3; + license = licenses.agpl3Plus; platforms = platforms.unix; }; }; @@ -172,7 +172,7 @@ self: super: { homepage = "https://euandre.org/s/guile-heredoc/"; changelog = "https://euandre.org/s/guile-heredoc/CHANGELOG.html"; downloadPage = "https://euandre.org/s/guile-heredoc/#releases"; - license = licenses.agpl3; + license = licenses.agpl3Plus; platforms = platforms.unix; }; }; @@ -13,9 +13,16 @@ "namespace": "org.euandre", "maintainer": "EuAndreh <eu@euandre.org>", "name": "EuAndreh", + "base-url": "https://euandre.org/s/package-repository", + "vcs": { + "git": "git://euandre.org/package-repository", + "http": "https://euandre.org/git/package-repository/", + "tarball": "https://euandre.org/git/package-repository/snapshot/package-repository-main.tar.xz" + }, "packages": [ { "name": "git-permalink", + "license": "AGPL-3.0-or-later", "native-inputs": [], "inputs": [], "version": "v0.1.0", @@ -40,6 +47,7 @@ }, { "name": "git-permalink", + "license": "AGPL-3.0-or-later", "native-inputs": [], "inputs": [], "version": "v0.2.0", @@ -64,6 +72,7 @@ }, { "name": "remembering", + "license": "AGPL-3.0-or-later", "native-inputs": [], "inputs": [], "version": "v0.1.2", @@ -88,6 +97,7 @@ }, { "name": "td", + "license": "AGPL-3.0-or-later", "native-inputs": [], "inputs": [], "version": "4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8", @@ -112,6 +122,7 @@ }, { "name": "guile-heredoc", + "license": "AGPL-3.0-or-later", "architectures": [ "i386", "x86_64", diff --git a/src/bin/paku b/src/bin/paku index 16967a3..1d97f3a 100755 --- a/src/bin/paku +++ b/src/bin/paku @@ -91,6 +91,18 @@ sub load_json() { return JSON::decode_json($json_str); } +my $licenses = { + guix => { + 'AGPL-3.0-or-later' => 'agpl3+', + }, + nix => { + 'AGPL-3.0-or-later' => 'agpl3Plus', + }, +}; +sub license_for($target, $id) { + return $licenses->{$target}->{$id}; +} + sub emit_packages() { for (@ARGV) { my $fh; @@ -174,6 +186,7 @@ sub emit_nix() { for my $pkg (@{$json->{packages}}) { my $long = $pkg->{'long-description'}; $long =~ s/^(.)/ $1/gm; + my $license = license_for 'nix', $pkg->{license}; my $suffix = $pkg->{label} eq 'latest' ? '' : "-$pkg->{label}"; print <<~EOF; @@ -221,7 +234,7 @@ sub emit_nix() { homepage = "$pkg->{homepage}"; changelog = "$pkg->{changelog}"; downloadPage = "$pkg->{'downloads-page'}"; - license = licenses.agpl3; + license = licenses.$license; platforms = platforms.unix; }; }; @@ -259,6 +272,7 @@ sub emit_guix() { my $long = $pkg->{'long-description'}; $long =~ s/^(.)/ $1/gm; my $ver = $pkg->{version} =~ s/^v//r; + my $license = license_for 'guix', $pkg->{license}; my $name = $pkg->{name} . ( $pkg->{label} eq 'latest' ? '' : "-$pkg->{label}" @@ -305,7 +319,7 @@ sub emit_guix() { (description "$pkg->{'long-description'}") (home-page "$pkg->{homepage}") - (license licenses:agpl3+))) + (license licenses:$license))) EOF } @@ -582,6 +596,9 @@ sub emit_html() { EOF } + my $channel_name = $json->{namespace} =~ s/\./-/gr; + my $overlay_name = $json->{namespace} =~ s/\./-/gr; + my $tap_name = $json->{namespace} =~ s/\./\//gr; print <<~EOF; </ul> <article id="guix-instructions"> @@ -592,8 +609,8 @@ sub emit_html() { </p> <pre><code>(cons* (channel - (name 'org-euandre) - (url "git://euandre.org/package-repository") + (name '$channel_name) + (url "$json->{vcs}->{git}") (branch "main") (introduction (make-channel-introduction @@ -617,14 +634,14 @@ sub emit_html() { Include my public key for validating the repository signatures: </p> - <pre><code>\$ wget -qO- https://euandre.org/s/package-repository/debian/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/euandre.org.asc</code></pre> + <pre><code>\$ wget -qO- $json->{'base-url'}/debian/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/$json->{namespace}.asc</code></pre> <p> Afterwards, include this repository to the list of repositories that <code>apt</code> uses for sources by adding its URL to <code>/etc/apt/sources.list</code>: </p> - <pre><code>\$ sudo apt-add-repository 'deb https://euandre.org/s/package-repository/debian ./'</code></pre> + <pre><code>\$ sudo apt-add-repository 'deb $json->{'base-url'}/debian ./'</code></pre> <p> <code>apt-add-repository</code> will already perform an <code>apt update</code>, so the packages from the @@ -640,13 +657,13 @@ sub emit_html() { <pre><code> nixpkgs = { overlays = [ (import (fetchTarball { - url = "https://euandre.org/git/package-repository/snapshot/package-repository-main.tar.xz"; + url = "$json->{vcs}->{tarball}"; }) { inherit pkgs; }) ]; };</code></pre> <p> All the packages live under the - <code>org-euandre</code> attribute set. + <code>$overlay_name</code> attribute set. </p> </article> <article id="homebrew-instructions"> @@ -654,7 +671,7 @@ sub emit_html() { <p> Add this repository as a tap: </p> - <pre><code>\$ brew tap --force-auto-update org/euandre https://euandre.org/git/package-repository/</code></pre> + <pre><code>\$ brew tap --force-auto-update $tap_name $json->{vcs}->{http}</code></pre> <p> The explicit <code>--force-auto-update</code> option is required, because <code>homebrew(1)</code> will only |