summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/text/mdbook-pdf/default.nix
blob: 0b3b0bfbc8606f7432f013a2c4c2420006b54733 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ lib
, stdenv
, fetchCrate
, rustPlatform
, pkg-config
, rustfmt
, openssl
, CoreServices
}:

rustPlatform.buildRustPackage rec {
  pname = "mdbook-pdf";
  version = "0.1.8";

  src = fetchCrate {
    inherit pname version;
    hash = "sha256-UPSh0/8HFaLvnU95Gyd+uQaRvWeXlp+HViVUKX0I1jI=";
  };

  cargoHash = "sha256-WYG2EkfEqjOOelxwivk5srtTNLxEPGX1ztwntvgft1I=";

  nativeBuildInputs = [
    pkg-config
    rustfmt
  ];

  buildInputs = [
    openssl
  ] ++ lib.optionals stdenv.isDarwin [
    CoreServices
  ];

  # Stop downloading from the Internet to
  # generate the Chrome Devtools Protocol
  DOCS_RS=true;

  # # Stop formating with rustfmt, pending version update for
  # # https://github.com/mdrokz/auto_generate_cdp/pull/8
  # # to remove rustfmt dependency
  # DO_NOT_FORMAT=true;

  # No test.
  doCheck = false;

  meta = with lib; {
    description = "A backend for mdBook written in Rust for generating PDF";
    mainProgram = "mdbook-pdf";
    homepage = "https://github.com/HollowMan6/mdbook-pdf";
    changelog = "https://github.com/HollowMan6/mdbook-pdf/releases/tag/v${version}";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ hollowman6 matthiasbeyer ];
  };
}