nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 rustPlatform,
5 pkg-config,
6 cairo,
7}:
8
9rustPlatform.buildRustPackage (finalAttrs: {
10 pname = "tdf";
11 version = "0.5.0";
12
13 src = fetchFromGitHub {
14 owner = "itsjunetime";
15 repo = "tdf";
16 fetchSubmodules = true;
17 tag = "v${finalAttrs.version}";
18 hash = "sha256-YjIMuwQkPtwlGiQ2zs3lEZi28lfn9Z5b5zOYIDFf5qw=";
19 };
20
21 cargoHash = "sha256-lGbsb3hlFen0tXBVLbm8+CE5dddv6Ner4YSAvAd3/ug=";
22
23 nativeBuildInputs = [ pkg-config ];
24
25 buildFeatures = [
26 "epub"
27 "cbz"
28 ];
29
30 buildInputs = [
31 rustPlatform.bindgenHook
32 cairo
33 ];
34
35 # Tests depend on cpuprofiler, which is not packaged in nixpkgs
36 doCheck = false;
37
38 meta = {
39 description = "Tui-based PDF viewer";
40 homepage = "https://github.com/itsjunetime/tdf";
41 license = lib.licenses.agpl3Only;
42 maintainers = with lib.maintainers; [
43 luftmensch-luftmensch
44 DieracDelta
45 ];
46 mainProgram = "tdf";
47 platforms = lib.platforms.unix;
48 };
49
50 # Only used for development
51 postInstall = ''
52 rm "$out/bin/for_profiling"
53 '';
54})