about summary refs log tree commit diff
path: root/pkgs/applications/misc/zathura/pdf-mupdf/default.nix
blob: 05f6c2b6a65ec67a82a40d5710384ade418c6ac8 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ stdenv, lib, meson, ninja, fetchurl, fetchpatch
, cairo
, girara
, gtk-mac-integration
, gumbo
, jbig2dec
, libjpeg
, mupdf
, openjpeg
, pkg-config
, zathura_core
}:

stdenv.mkDerivation rec {
  version = "0.3.6";
  pname = "zathura-pdf-mupdf";

  src = fetchurl {
    url = "https://pwmt.org/projects/${pname}/download/${pname}-${version}.tar.xz";
    sha256 = "1r3v37k9fl2rxipvacgxr36llywvy7n20a25h3ajlyk70697sa66";
  };

  nativeBuildInputs = [ meson ninja pkg-config ];

  buildInputs = [
    cairo
    girara
    gumbo
    jbig2dec
    libjpeg
    mupdf
    openjpeg
    zathura_core
  ] ++ lib.optional stdenv.isDarwin gtk-mac-integration;

  mesonFlags = [
    "-Dlink-external=true"
  ];

  # avoid: undefined symbol: gumbo_destroy_output
  NIX_LDFLAGS = [ "-lgumbo" ];

  PKG_CONFIG_ZATHURA_PLUGINDIR= "lib/zathura";

  meta = with lib; {
    homepage = "https://pwmt.org/projects/zathura-pdf-mupdf/";
    description = "A zathura PDF plugin (mupdf)";
    longDescription = ''
      The zathura-pdf-mupdf plugin adds PDF support to zathura by
      using the mupdf rendering library.
    '';
    license = licenses.zlib;
    platforms = platforms.unix;
    maintainers = with maintainers; [ cstrahan ];
  };
}