Merge pull request #34973 from pallavagarwal07/zathura

zathura: make compatible with darwin
This commit is contained in:
Jörg Thalheim 2018-02-15 10:17:54 +00:00 committed by GitHub
commit 4857b148ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 19 deletions

View file

@ -1,7 +1,7 @@
{ stdenv, fetchurl, makeWrapper, pkgconfig
, gtk, girara, ncurses, gettext, docutils
, file, sqlite, glib, texlive
, synctexSupport ? true
, file, sqlite, glib, texlive, libintlOrEmpty
, gtk-mac-integration, synctexSupport ? true
}:
assert synctexSupport -> texlive != null;
@ -19,12 +19,17 @@ stdenv.mkDerivation rec {
icon = ./icon.xpm;
nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [
pkgconfig
] ++ optional stdenv.isDarwin [ libintlOrEmpty ];
buildInputs = [
file gtk girara
gettext makeWrapper sqlite glib
] ++ optional synctexSupport texlive.bin.core;
] ++ optional synctexSupport texlive.bin.core
++ optional stdenv.isDarwin [ gtk-mac-integration ];
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
makeFlags = [
@ -50,7 +55,7 @@ stdenv.mkDerivation rec {
homepage = http://pwmt.org/projects/zathura/;
description = "A core component for zathura PDF viewer";
license = licenses.zlib;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ garbas ];
};
}

View file

@ -13,6 +13,13 @@ stdenv.mkDerivation rec {
patches = [ ./gtkflags.patch ];
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
'';
makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ];
meta = with stdenv.lib; {
@ -23,7 +30,7 @@ stdenv.mkDerivation rec {
djvulibre library.
'';
license = licenses.zlib;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ garbas ];
};
}

View file

@ -1,5 +1,6 @@
{ stdenv, lib, fetchurl, pkgconfig, zathura_core, gtk, girara, mupdf, openssl
, libjpeg, jbig2dec, openjpeg, fetchpatch }:
{ stdenv, lib, fetchurl, pkgconfig, zathura_core, gtk,
gtk-mac-integration, girara, mupdf, openssl , libjpeg, jbig2dec,
openjpeg, fetchpatch }:
stdenv.mkDerivation rec {
version = "0.3.2";
@ -11,7 +12,19 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ zathura_core gtk girara openssl mupdf libjpeg jbig2dec openjpeg ];
buildInputs = [
zathura_core gtk girara openssl mupdf libjpeg jbig2dec openjpeg
] ++ stdenv.lib.optional stdenv.isDarwin [
gtk-mac-integration
];
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
'';
makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ];
@ -23,7 +36,7 @@ stdenv.mkDerivation rec {
using the mupdf rendering library.
'';
license = licenses.zlib;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ cstrahan ];
};
}

View file

@ -9,11 +9,18 @@ stdenv.mkDerivation rec {
sha256 = "1m55m7s7f8ng8a7lmcw9z4n5zv7xk4vp9n6fp9j84z6rk2imf7a2";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ poppler zathura_core girara ];
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)";
@ -22,7 +29,7 @@ stdenv.mkDerivation rec {
using the poppler rendering library.
'';
license = licenses.zlib;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ cstrahan garbas ];
};
}

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, pkgconfig, gtk, zathura_core, girara, libspectre, gettext }:
{ stdenv, lib, fetchurl, pkgconfig, gtk2, zathura_core, girara, libspectre, gettext }:
stdenv.mkDerivation rec {
name = "zathura-ps-0.2.5";
@ -9,10 +9,17 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libspectre gettext zathura_core gtk girara ];
buildInputs = [ libspectre gettext zathura_core gtk2 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" ];
meta = with lib; {
@ -23,7 +30,7 @@ stdenv.mkDerivation rec {
libspectre library.
'';
license = licenses.zlib;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ cstrahan garbas ];
};
}

View file

@ -11,8 +11,7 @@ in symlinkJoin {
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/zathura \
--add-flags --plugins-dir=${pluginsPath}
wrapProgram $out/bin/zathura --add-flags --plugins-dir=${pluginsPath}
'';
meta = with lib; {
@ -25,7 +24,7 @@ in symlinkJoin {
as well as an easy usage that mainly focuses on keyboard interaction.
'';
license = licenses.zlib;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers;[ garbas smironov ];
};
}