about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2022-09-25 23:06:34 -0500
committerGitHub <noreply@github.com>2022-09-25 23:06:34 -0500
commit9770013845753c8952ee24f96cd3d49b12bf8da1 (patch)
tree06c711cc5dd8e8ccd68f1fac7a9538ae90edc0ad /pkgs
parent9e212b05b9c9f2525011d5be51aea4347626bea5 (diff)
parentb0c9efc83620660122f54c370ace2bacc38c1732 (diff)
Merge pull request #178002 from bertof/mangal
mangal: init at version 3.10.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/misc/mangal/default.nix39
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/applications/misc/mangal/default.nix b/pkgs/applications/misc/mangal/default.nix
new file mode 100644
index 0000000000000..e97008ab36cf9
--- /dev/null
+++ b/pkgs/applications/misc/mangal/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
+
+buildGoModule rec {
+  pname = "mangal";
+  version = "3.10.0";
+
+  src = fetchFromGitHub {
+    owner = "metafates";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-rWj9CknWNI6SSh0AwaPpj5TxHQzkAmaAhWW7kze3xiY=";
+  };
+
+  proxyVendor = true;
+  vendorSha256 = "sha256-ZgeG8S78/yS9KfEK1bZ3VlQGmZPBo9TXLQLz8rXOEGo=";
+
+  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 ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 80bb0e8489f3e..cf230a899d61d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -723,6 +723,8 @@ with pkgs;
 
   graph-easy = callPackage ../tools/graphics/graph-easy { };
 
+  mangal = callPackage ../applications/misc/mangal { };
+
   graphw00f = callPackage ../tools/security/graphw00f { };
 
   opendrop = python3Packages.callPackage ../tools/networking/opendrop { };