From 00700e312b290e516d1a98ad4e2f84cc8b6a4fa8 Mon Sep 17 00:00:00 2001 From: ttyyls Date: Fri, 17 Jan 2025 23:16:28 +0100 Subject: [PATCH] user/berg: new package --- user/berg/template.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 user/berg/template.py diff --git a/user/berg/template.py b/user/berg/template.py new file mode 100644 index 0000000000..db397ecbda --- /dev/null +++ b/user/berg/template.py @@ -0,0 +1,40 @@ +pkgname = "berg" +pkgver = "0.4.7" +pkgrel = 0 +build_style = "cargo" +hostmakedepends = [ + "cargo-auditable", + "pkgconf", +] +makedepends = [ + "rust-std", + "openssl-devel", + "libgit2-devel", +] +pkgdesc = "CLI Tool for forgejo" +maintainer = "ttyyls " +license = "AGPL-3.0-or-later" +url = "https://codeberg.org/Aviac/codeberg-cli" +source = f"{url}/archive/v{pkgver}.tar.gz" +sha256 = "a8d1356faab84076f14977652dabbfcad4411f49beb4d11a1bc0ee8936bd1d6c" +# check: only one defined test (skipped) +# cross: generates completions with host binary +options = ["!check", "!cross"] + + +def post_build(self): + for shell in ["bash", "fish", "zsh"]: + with open(self.cwd / f"berg.{shell}", "w") as outf: + self.do( + f"target/{self.profile().triplet}/release/berg", + "completion", + shell, + stdout=outf, + ) + + +def install(self): + self.install_bin(f"target/{self.profile().triplet}/release/berg") + self.install_license("LICENSE") + for shell in ["bash", "fish", "zsh"]: + self.install_completion(f"berg.{shell}", shell)