14 rustPlatform.buildRustPackage rec {
18 src = fetchFromGitHub {
21 rev = "mdcat-${version}";
22 hash = "sha256-iZenHdlYoHyX4CC2/qeNWBYxoeE35kx6xnYWfxcRZYg=";
25 nativeBuildInputs = [ pkg-config asciidoctor installShellFiles ];
26 buildInputs = [ openssl ]
27 ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security SystemConfiguration ];
29 cargoHash = "sha256-NnsChyW7lwnlv2MWSJTlFIBVVpvUsYIiilDnmfIBE+8=";
31 nativeCheckInputs = [ ansi2html ];
32 # Skip tests that use the network and that include files.
34 "--skip magic::tests::detect_mimetype_of_larger_than_magic_param_bytes_max_length"
35 "--skip magic::tests::detect_mimetype_of_magic_param_bytes_max_length"
36 "--skip magic::tests::detect_mimetype_of_png_image"
37 "--skip magic::tests::detect_mimetype_of_svg_image"
38 "--skip resources::tests::read_url_with_http_url_fails_when_size_limit_is_exceeded"
39 "--skip resources::tests::read_url_with_http_url_fails_when_status_404"
40 "--skip resources::tests::read_url_with_http_url_returns_content_when_status_200"
41 "--skip iterm2_tests_render_md_samples_images_md"
45 installManPage $releaseDir/build/mdcat-*/out/mdcat.1
46 ln -sr $out/bin/{mdcat,mdless}
47 '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
48 for bin in mdcat mdless; do
49 installShellCompletion --cmd $bin \
50 --bash <($out/bin/$bin --completions bash) \
51 --fish <($out/bin/$bin --completions fish) \
52 --zsh <($out/bin/$bin --completions zsh)
57 description = "cat for markdown";
58 homepage = "https://github.com/swsnr/mdcat";
59 changelog = "https://github.com/swsnr/mdcat/releases/tag/mdcat-${version}";
60 license = with licenses; [ mpl20 ];
61 maintainers = with maintainers; [ SuperSandro2000 ];