2022-07-18 16:21:45 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, nix, rustPlatform, CoreServices }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "mdbook";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "0.4.21";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-08-08 23:34:03 +00:00
|
|
|
owner = "rust-lang";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "mdBook";
|
|
|
|
rev = "v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-ggcyOsA4cyo5l87cZmOMI0w1gCzmWy9NRJiWxjBdB1E=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
cargoSha256 = "sha256-KVoMC8ypikABVkIj5dCSHzYZ9CV8UMuAFxSEYLaQTSk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
# Tests rely on unset 'RUST_LOG' value to emit INFO messages.
|
|
|
|
# 'RUST_LOG=' nixpkgs default enables warnings only and breaks tests.
|
|
|
|
# Can be removed when https://github.com/rust-lang/mdBook/pull/1777
|
|
|
|
# is released.
|
|
|
|
logLevel = "info";
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
inherit nix;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Create books from MarkDown";
|
2021-08-08 23:34:03 +00:00
|
|
|
homepage = "https://github.com/rust-lang/mdBook";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = [ licenses.mpl20 ];
|
|
|
|
maintainers = [ maintainers.havvy ];
|
|
|
|
};
|
|
|
|
}
|