about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/mdbook/default.nix
blob: ea7602a60020493d6793ac1790d710daa58f3bc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ stdenv, fetchFromGitHub, rustPlatform, CoreServices, darwin }:

rustPlatform.buildRustPackage rec {
  name = "mdbook-${version}";
  version = "0.1.8";

  src = fetchFromGitHub {
    owner = "rust-lang-nursery";
    repo = "mdBook";
    rev = "v${version}";
    sha256 = "1xmw4v19ff6mvimwk5l437wslzw5npy60zdb8r4319bjf32pw9pn";
  };

  cargoSha256 = "0kcc0b2644qbalz7dnqwxsjdmw1h57k0rjrvwqh8apj2sgl64gyv";

  buildInputs = stdenv.lib.optionals stdenv.isDarwin [
    CoreServices
    # This is needed to avoid an undefined symbol error for "_CFURLResourceIsReachable"
    darwin.cf-private
  ];

  meta = with stdenv.lib; {
    description = "Create books from MarkDown";
    homepage = https://github.com/rust-lang-nursery/mdbook;
    license = [ licenses.asl20 licenses.mit ];
    maintainers = [ maintainers.havvy ];
    platforms = platforms.all;
  };
}