summary refs log tree commit diff
path: root/pkgs/applications/misc/zathura/pdf-poppler/default.nix
blob: 215ebdd756406fb2a29fcf163b1c4781c4824252 (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
{ stdenv, lib, fetchurl, pkgconfig, zathura_core, girara, poppler }:

stdenv.mkDerivation rec {
  version = "0.2.8";
  name = "zathura-pdf-poppler-${version}";

  src = fetchurl {
    url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
    sha256 = "1m55m7s7f8ng8a7lmcw9z4n5zv7xk4vp9n6fp9j84z6rk2imf7a2";
  };

  nativeBuildInputs = [ pkgconfig zathura_core ];
  buildInputs = [ poppler girara ];

  makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ];

  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
    string1='-shared ''${LDFLAGS} -o $@ ''$(OBJECTS) ''${LIBS}'
    string2='-Wl,-dylib_install_name,''${PLUGIN}.dylib -Wl,-bundle_loader,${zathura_core}/bin/.zathura-wrapped -bundle ''${LDFLAGS} -o $@ ''${OBJECTS} ''${LIBS}'
    makefileC1=$(sed -r 's/\.so/.dylib/g' Makefile)
    echo "''${makefileC1/$string1/$string2}" > Makefile
  '';

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