depot/third_party/nixpkgs/pkgs/applications/misc/mangal/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

39 lines
1.1 KiB
Nix

{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "mangal";
version = "4.0.4";
src = fetchFromGitHub {
owner = "metafates";
repo = pname;
rev = "v${version}";
hash = "sha256-U1NmJsh7OuS0/kktmMcIjEaqc1ABtWG0ilSUw0UL8aU=";
};
proxyVendor = true;
vendorSha256 = 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 MANGAL_CONFIG_PATH=`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 =
"A fancy 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 ];
};
}