2021-07-14 22:03:04 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-10-19 23:25:03 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-10-19 23:25:03 +00:00
|
|
|
, asciidoctor
|
|
|
|
, openssl
|
|
|
|
, Security
|
|
|
|
, ansi2html
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "mdcat";
|
2022-01-19 23:45:15 +00:00
|
|
|
version = "0.25.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lunaryorn";
|
|
|
|
repo = pname;
|
|
|
|
rev = "mdcat-${version}";
|
2022-01-19 23:45:15 +00:00
|
|
|
sha256 = "sha256-deG2VjyjFs0LFeTXfPYy3zzjj0rpVjxE0DhkpD5PzSQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config asciidoctor installShellFiles ];
|
2021-07-14 22:03:04 +00:00
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optional stdenv.isDarwin Security;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
cargoSha256 = "sha256-bPGSdXooBZMye3yj00f3rWIiW4wfg2B4meH44hpkXTY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = [ ansi2html ];
|
2020-10-19 23:25:03 +00:00
|
|
|
# Skip tests that use the network and that include files.
|
|
|
|
checkFlags = [
|
|
|
|
"--skip magic::tests::detect_mimetype_of_larger_than_magic_param_bytes_max_length"
|
|
|
|
"--skip magic::tests::detect_mimetype_of_magic_param_bytes_max_length"
|
|
|
|
"--skip magic::tests::detect_mimetype_of_png_image"
|
|
|
|
"--skip magic::tests::detect_mimetype_of_svg_image"
|
2021-07-14 22:03:04 +00:00
|
|
|
"--skip resources::tests::read_url_with_http_url_fails_when_size_limit_is_exceeded"
|
2020-10-19 23:25:03 +00:00
|
|
|
"--skip resources::tests::read_url_with_http_url_fails_when_status_404"
|
|
|
|
"--skip resources::tests::read_url_with_http_url_returns_content_when_status_200"
|
|
|
|
"--skip iterm2_tests_render_md_samples_images_md"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installManPage $releaseDir/build/mdcat-*/out/mdcat.1
|
|
|
|
installShellCompletion --bash $releaseDir/build/mdcat-*/out/completions/mdcat.bash
|
|
|
|
installShellCompletion --fish $releaseDir/build/mdcat-*/out/completions/mdcat.fish
|
|
|
|
installShellCompletion --zsh $releaseDir/build/mdcat-*/out/completions/_mdcat
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "cat for markdown";
|
|
|
|
homepage = "https://github.com/lunaryorn/mdcat";
|
|
|
|
license = with licenses; [ asl20 ];
|
2021-07-14 22:03:04 +00:00
|
|
|
maintainers = with maintainers; [ davidtwco SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|