linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / tools / text / mdcat / default.nix
blobf6752938d464e67f84b9e227c79166ceba3b7c6c
1 { lib, stdenv
2 , fetchFromGitHub
3 , rustPlatform
4 , pkg-config
5 , asciidoctor
6 , openssl
7 , Security
8 , ansi2html
9 , installShellFiles
12 rustPlatform.buildRustPackage rec {
13   pname = "mdcat";
14   version = "0.22.2";
16   src = fetchFromGitHub {
17     owner = "lunaryorn";
18     repo = pname;
19     rev = "mdcat-${version}";
20     hash = "sha256-i36MYTMkbSuWxxlWUDsyYMay/4Mg7M5jEFhHM60UrkM=";
21   };
23   nativeBuildInputs = [ pkg-config asciidoctor installShellFiles ];
24   buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin Security;
26   cargoSha256 = "sha256-mnDUIJhEGNoh3eq2Vhww1T/tpZh9RP+RxbRsBNrpOzw=";
28   checkInputs = [ ansi2html ];
29   # Skip tests that use the network and that include files.
30   checkFlags = [
31     "--skip magic::tests::detect_mimetype_of_larger_than_magic_param_bytes_max_length"
32     "--skip magic::tests::detect_mimetype_of_magic_param_bytes_max_length"
33     "--skip magic::tests::detect_mimetype_of_png_image"
34     "--skip magic::tests::detect_mimetype_of_svg_image"
35     "--skip resources::tests::read_url_with_http_url_fails_when_status_404"
36     "--skip resources::tests::read_url_with_http_url_returns_content_when_status_200"
37     "--skip iterm2_tests_render_md_samples_images_md"
38   ];
40   postInstall = ''
41     installManPage $releaseDir/build/mdcat-*/out/mdcat.1
42     installShellCompletion --bash $releaseDir/build/mdcat-*/out/completions/mdcat.bash
43     installShellCompletion --fish $releaseDir/build/mdcat-*/out/completions/mdcat.fish
44     installShellCompletion --zsh $releaseDir/build/mdcat-*/out/completions/_mdcat
45   '';
47   meta = with lib; {
48     description = "cat for markdown";
49     homepage = "https://github.com/lunaryorn/mdcat";
50     license = with licenses; [ asl20 ];
51     maintainers = with maintainers; [ davidtwco ];
52   };