forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / ma / mangal / package.nix
blob332c1d33ec2503217345ffbf45af324bceac541f
2   lib,
3   stdenv,
4   buildGoModule,
5   fetchFromGitHub,
6   installShellFiles,
7 }:
8 buildGoModule rec {
9   pname = "mangal";
10   version = "4.0.6";
12   src = fetchFromGitHub {
13     owner = "metafates";
14     repo = pname;
15     rev = "v${version}";
16     hash = "sha256-nbJdePlzZFM2ihbvFIMKyYZ9C0uKjU3TE5VLduLvtKE=";
17   };
19   proxyVendor = true;
20   vendorHash = null;
22   ldflags = [
23     "-s"
24     "-w"
25   ];
27   nativeBuildInputs = [ installShellFiles ];
29   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
30     # Mangal creates a config file in the folder ~/.config/mangal and fails if not possible
31     export HOME=$(mktemp -d)
32     installShellCompletion --cmd mangal \
33       --bash <($out/bin/mangal completion bash) \
34       --zsh <($out/bin/mangal completion zsh) \
35       --fish <($out/bin/mangal completion fish)
36   '';
38   doCheck = false; # test fail because of sandbox
40   meta = with lib; {
41     description = "CLI app written in Go which scrapes, downloads and packs manga into different formats";
42     homepage = "https://github.com/metafates/mangal";
43     license = licenses.mit;
44     maintainers = [ maintainers.bertof ];
45     mainProgram = "mangal";
46   };