2022-09-30 11:47:45 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "mangal";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "4.0.4";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "metafates";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-U1NmJsh7OuS0/kktmMcIjEaqc1ABtWG0ilSUw0UL8aU=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
proxyVendor = true;
|
2022-10-30 15:09:59 +00:00
|
|
|
vendorSha256 = null;
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|