depot/third_party/nixpkgs/pkgs/by-name/ma/mangal/package.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

47 lines
1.1 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "mangal";
version = "4.0.6";
src = fetchFromGitHub {
owner = "metafates";
repo = pname;
rev = "v${version}";
hash = "sha256-nbJdePlzZFM2ihbvFIMKyYZ9C0uKjU3TE5VLduLvtKE=";
};
proxyVendor = true;
vendorHash = null;
ldflags = [
"-s"
"-w"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
# Mangal creates a config file in the folder ~/.config/mangal and fails if not possible
export HOME=$(mktemp -d)
installShellCompletion --cmd mangal \
--bash <($out/bin/mangal completion bash) \
--zsh <($out/bin/mangal completion zsh) \
--fish <($out/bin/mangal completion fish)
'';
doCheck = false; # test fail because of sandbox
meta = with lib; {
description = "CLI app written in Go which scrapes, downloads and packs manga into different formats";
homepage = "https://github.com/metafates/mangal";
license = licenses.mit;
maintainers = [ maintainers.bertof ];
mainProgram = "mangal";
};
}