nixpkgs/pkgs/by-name/ma/mangal/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.1 KiB
Nix
Raw Normal View History

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "mangal";
2023-01-16 11:15:33 +00:00
version = "4.0.6";
src = fetchFromGitHub {
owner = "metafates";
repo = pname;
rev = "v${version}";
2023-01-16 11:15:33 +00:00
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
2024-07-19 19:39:27 +00:00
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 ];
2024-02-11 02:19:15 +00:00
mainProgram = "mangal";
};
}