Merge pull request #34973 from pallavagarwal07/zathura

zathura: make compatible with darwin

authored by Jörg Thalheim and committed by GitHub 4857b148 aaeeff6f

+57 -19
+10 -5
pkgs/applications/misc/zathura/core/default.nix
··· 1 1 { stdenv, fetchurl, makeWrapper, pkgconfig 2 2 , gtk, girara, ncurses, gettext, docutils 3 - , file, sqlite, glib, texlive 4 - , synctexSupport ? true 3 + , file, sqlite, glib, texlive, libintlOrEmpty 4 + , gtk-mac-integration, synctexSupport ? true 5 5 }: 6 6 7 7 assert synctexSupport -> texlive != null; ··· 19 19 20 20 icon = ./icon.xpm; 21 21 22 - nativeBuildInputs = [ pkgconfig ]; 22 + nativeBuildInputs = [ 23 + pkgconfig 24 + ] ++ optional stdenv.isDarwin [ libintlOrEmpty ]; 25 + 23 26 buildInputs = [ 24 27 file gtk girara 25 28 gettext makeWrapper sqlite glib 26 - ] ++ optional synctexSupport texlive.bin.core; 29 + ] ++ optional synctexSupport texlive.bin.core 30 + ++ optional stdenv.isDarwin [ gtk-mac-integration ]; 27 31 32 + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl"; 28 33 NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; 29 34 30 35 makeFlags = [ ··· 50 55 homepage = http://pwmt.org/projects/zathura/; 51 56 description = "A core component for zathura PDF viewer"; 52 57 license = licenses.zlib; 53 - platforms = platforms.linux; 58 + platforms = platforms.unix; 54 59 maintainers = with maintainers; [ garbas ]; 55 60 }; 56 61 }
+8 -1
pkgs/applications/misc/zathura/djvu/default.nix
··· 13 13 14 14 patches = [ ./gtkflags.patch ]; 15 15 16 + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' 17 + string1='-shared ''${LDFLAGS} -o $@ ''$(OBJECTS) ''${LIBS}' 18 + string2='-Wl,-dylib_install_name,''${PLUGIN}.dylib -Wl,-bundle_loader,${zathura_core}/bin/.zathura-wrapped -bundle ''${LDFLAGS} -o $@ ''${OBJECTS} ''${LIBS}' 19 + makefileC1=$(sed -r 's/\.so/.dylib/g' Makefile) 20 + echo "''${makefileC1/$string1/$string2}" > Makefile 21 + ''; 22 + 16 23 makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ]; 17 24 18 25 meta = with stdenv.lib; { ··· 23 30 djvulibre library. 24 31 ''; 25 32 license = licenses.zlib; 26 - platforms = platforms.linux; 33 + platforms = platforms.unix; 27 34 maintainers = with maintainers; [ garbas ]; 28 35 }; 29 36 }
+17 -4
pkgs/applications/misc/zathura/pdf-mupdf/default.nix
··· 1 - { stdenv, lib, fetchurl, pkgconfig, zathura_core, gtk, girara, mupdf, openssl 2 - , libjpeg, jbig2dec, openjpeg, fetchpatch }: 1 + { stdenv, lib, fetchurl, pkgconfig, zathura_core, gtk, 2 + gtk-mac-integration, girara, mupdf, openssl , libjpeg, jbig2dec, 3 + openjpeg, fetchpatch }: 3 4 4 5 stdenv.mkDerivation rec { 5 6 version = "0.3.2"; ··· 11 12 }; 12 13 13 14 nativeBuildInputs = [ pkgconfig ]; 14 - buildInputs = [ zathura_core gtk girara openssl mupdf libjpeg jbig2dec openjpeg ]; 15 + 16 + buildInputs = [ 17 + zathura_core gtk girara openssl mupdf libjpeg jbig2dec openjpeg 18 + ] ++ stdenv.lib.optional stdenv.isDarwin [ 19 + gtk-mac-integration 20 + ]; 21 + 22 + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' 23 + string1='-shared ''${LDFLAGS} -o $@ ''$(OBJECTS) ''${LIBS}' 24 + string2='-Wl,-dylib_install_name,''${PLUGIN}.dylib -Wl,-bundle_loader,${zathura_core}/bin/.zathura-wrapped -bundle ''${LDFLAGS} -o $@ ''${OBJECTS} ''${LIBS}' 25 + makefileC1=$(sed -r 's/\.so/.dylib/g' Makefile) 26 + echo "''${makefileC1/$string1/$string2}" > Makefile 27 + ''; 15 28 16 29 makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ]; 17 30 ··· 23 36 using the mupdf rendering library. 24 37 ''; 25 38 license = licenses.zlib; 26 - platforms = platforms.linux; 39 + platforms = platforms.unix; 27 40 maintainers = with maintainers; [ cstrahan ]; 28 41 }; 29 42 }
+10 -3
pkgs/applications/misc/zathura/pdf-poppler/default.nix
··· 9 9 sha256 = "1m55m7s7f8ng8a7lmcw9z4n5zv7xk4vp9n6fp9j84z6rk2imf7a2"; 10 10 }; 11 11 12 - nativeBuildInputs = [ pkgconfig ]; 13 - buildInputs = [ poppler zathura_core girara ]; 12 + nativeBuildInputs = [ pkgconfig zathura_core ]; 13 + buildInputs = [ poppler girara ]; 14 14 15 15 makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ]; 16 16 17 + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' 18 + string1='-shared ''${LDFLAGS} -o $@ ''$(OBJECTS) ''${LIBS}' 19 + string2='-Wl,-dylib_install_name,''${PLUGIN}.dylib -Wl,-bundle_loader,${zathura_core}/bin/.zathura-wrapped -bundle ''${LDFLAGS} -o $@ ''${OBJECTS} ''${LIBS}' 20 + makefileC1=$(sed -r 's/\.so/.dylib/g' Makefile) 21 + echo "''${makefileC1/$string1/$string2}" > Makefile 22 + ''; 23 + 17 24 meta = with lib; { 18 25 homepage = http://pwmt.org/projects/zathura/; 19 26 description = "A zathura PDF plugin (poppler)"; ··· 22 29 using the poppler rendering library. 23 30 ''; 24 31 license = licenses.zlib; 25 - platforms = platforms.linux; 32 + platforms = platforms.unix; 26 33 maintainers = with maintainers; [ cstrahan garbas ]; 27 34 }; 28 35 }
+10 -3
pkgs/applications/misc/zathura/ps/default.nix
··· 1 - { stdenv, lib, fetchurl, pkgconfig, gtk, zathura_core, girara, libspectre, gettext }: 1 + { stdenv, lib, fetchurl, pkgconfig, gtk2, zathura_core, girara, libspectre, gettext }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "zathura-ps-0.2.5"; ··· 9 9 }; 10 10 11 11 nativeBuildInputs = [ pkgconfig ]; 12 - buildInputs = [ libspectre gettext zathura_core gtk girara ]; 12 + buildInputs = [ libspectre gettext zathura_core gtk2 girara ]; 13 13 14 14 patches = [ ./gtkflags.patch ]; 15 15 16 + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' 17 + makefileC1=$(sed -r 's/\.so/.dylib/g' Makefile) 18 + 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' ) 19 + echo "$makefileC2" > Makefile 20 + echo "$makefileC2" 21 + ''; 22 + 16 23 makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ]; 17 24 18 25 meta = with lib; { ··· 23 30 libspectre library. 24 31 ''; 25 32 license = licenses.zlib; 26 - platforms = platforms.linux; 33 + platforms = platforms.unix; 27 34 maintainers = with maintainers; [ cstrahan garbas ]; 28 35 }; 29 36 }
+2 -3
pkgs/applications/misc/zathura/wrapper.nix
··· 11 11 buildInputs = [ makeWrapper ]; 12 12 13 13 postBuild = '' 14 - wrapProgram $out/bin/zathura \ 15 - --add-flags --plugins-dir=${pluginsPath} 14 + wrapProgram $out/bin/zathura --add-flags --plugins-dir=${pluginsPath} 16 15 ''; 17 16 18 17 meta = with lib; { ··· 25 24 as well as an easy usage that mainly focuses on keyboard interaction. 26 25 ''; 27 26 license = licenses.zlib; 28 - platforms = platforms.linux; 27 + platforms = platforms.unix; 29 28 maintainers = with maintainers;[ garbas smironov ]; 30 29 }; 31 30 }