Unverified Commit 8a4793a5 authored by Jan Tojnar's avatar Jan Tojnar
Browse files

zathura_ps: 0.2.5 → 0.2.6

parent 33662598
Loading
Loading
Loading
Loading
+8 −17
Original line number Diff line number Diff line
{ stdenv, lib, fetchurl, pkgconfig, gtk2, zathura_core, girara, libspectre, gettext }:
{ stdenv, lib, fetchurl, meson, ninja, pkgconfig, zathura_core, girara, libspectre, gettext }:

stdenv.mkDerivation rec {
  name = "zathura-ps-0.2.5";
  name = "zathura-ps-0.2.6";

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

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ libspectre gettext zathura_core gtk2 girara ];
  nativeBuildInputs = [ meson ninja pkgconfig gettext ];
  buildInputs = [ libspectre zathura_core girara ];

  patches = [ ./gtkflags.patch ];

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

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

  meta = with lib; {
    homepage = http://pwmt.org/projects/zathura/;
    homepage = https://pwmt.org/projects/zathura-ps/;
    description = "A zathura PS plugin";
    longDescription = ''
      The zathura-ps plugin adds PS support to zathura by using the
+0 −23
Original line number Diff line number Diff line
--- zathura-ps-0.2.5.orig/config.mk	2017-12-21 14:21:17.000000000 +0100
+++ zathura-ps-0.2.5/config.mk	2017-12-31 01:05:17.507268817 +0100
@@ -16,6 +16,9 @@
 DESKTOPPREFIX ?= ${PREFIX}/share/applications
 
 # libs
+GTK_INC ?= $(shell pkg-config --cflags gtk+-2.0)
+GTK_LIB ?= $(shell pkg-config --libs gtk+-2.0)
+
 CAIRO_INC ?= $(shell pkg-config --cflags cairo)
 CAIRO_LIB ?= $(shell pkg-config --libs cairo)
 
@@ -34,8 +37,8 @@
 PLUGINDIR = ${LIBDIR}/zathura
 endif
 
-INCS = ${GLIB_INC} ${SPECTRE_INC} ${GIRARA_INC} ${CAIRO_INC} ${ZATHURA_INC}
-LIBS = ${GLIB_LIB} ${SPECTRE_LIB} ${GIRARA_LIB} ${CAIRO_LIB}
+INCS = ${GLIB_INC} ${SPECTRE_INC} ${GIRARA_INC} ${CAIRO_INC} ${ZATHURA_INC} ${GTK_INC}
+LIBS = ${GLIB_LIB} ${SPECTRE_LIB} ${GIRARA_LIB} ${CAIRO_LIB } ${GTK_LIB}
 
 # compiler flags
 CFLAGS += -std=c11 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)