mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
Merge pull request #17819 from abbradar/printing-updates
Printing and PDF-related updates
This commit is contained in:
commit
edb9416228
|
@ -1,7 +1,7 @@
|
|||
{ stdenv, fetchurl
|
||||
, ghostscript, atk, gtk, glib, fontconfig, freetype
|
||||
, libgnomecanvas, libgnomeprint, libgnomeprintui
|
||||
, pango, libX11, xproto, zlib, poppler, poppler_data
|
||||
, pango, libX11, xproto, zlib, poppler
|
||||
, autoconf, automake, libtool, pkgconfig}:
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.4.8";
|
||||
|
@ -14,12 +14,12 @@ stdenv.mkDerivation rec {
|
|||
buildInputs = [
|
||||
ghostscript atk gtk glib fontconfig freetype
|
||||
libgnomecanvas libgnomeprint libgnomeprintui
|
||||
pango libX11 xproto zlib poppler poppler_data
|
||||
pango libX11 xproto zlib poppler
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
|
||||
|
||||
NIX_LDFLAGS="-lX11 -lz";
|
||||
NIX_LDFLAGS = [ "-lX11" "-lz" ];
|
||||
|
||||
meta = {
|
||||
homepage = http://xournal.sourceforge.net/;
|
||||
|
|
|
@ -18,17 +18,32 @@ stdenv.mkDerivation rec {
|
|||
url = "http://git.ghostscript.com/?p=mupdf.git;a=commitdiff_plain;h=39b0f07dd960f34e7e6bf230ffc3d87c41ef0f2e;hp=fa1936405b6a84e5c9bb440912c23d532772f958";
|
||||
sha256 = "1g9fkd1f5rx1z043vr9dj4934qf7i4nkvbwjc61my9azjrrc3jv7";
|
||||
})
|
||||
# Compatibility with new openjpeg
|
||||
(fetchpatch {
|
||||
name = "mupdf-1.5-openjpeg-2.1.0.patch";
|
||||
url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/mupdf-1.5-openjpeg-2.1.0.patch?h=packages/mupdf&id=ca5e3ef6c7788ccfb6011d785078bc47762f19e5";
|
||||
sha256 = "0f18793q9fd22h3lclm8wahvc8az4v08an6lzy8mczrkl8mcgm3k";
|
||||
})
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE= [ "-fPIC" ];
|
||||
makeFlags = [ "prefix=$(out)" ];
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ zlib freetype libX11 libXcursor libXext harfbuzz mesa libXrandr libXinerama ];
|
||||
buildInputs = [ zlib libX11 libXcursor libXext harfbuzz mesa libXrandr libXinerama freetype libjpeg jbig2dec openjpeg ];
|
||||
outputs = [ "out" "bin" "doc" ];
|
||||
|
||||
installPhase = ''
|
||||
make install prefix=$out
|
||||
gcc -shared -o $out/lib/libmupdf.so.${version} -Wl,--whole-archive $out/lib/libmupdf.a -Wl,--no-whole-archive
|
||||
preConfigure = ''
|
||||
# Don't remove mujs because upstream version is incompatible
|
||||
rm -rf thirdparty/{curl,freetype,glfw,harfbuzz,jbig2dec,jpeg,openjpeg,zlib}
|
||||
'';
|
||||
|
||||
ln -s $out/lib/libmupdf.so.${version} $out/lib/libmupdf.so
|
||||
postInstall = ''
|
||||
for i in $out/lib/*.a; do
|
||||
so="''${i%.a}.so"
|
||||
gcc -shared -o $so.${version} -Wl,--whole-archive $i -Wl,--no-whole-archive
|
||||
ln -s $so.${version} $so
|
||||
rm $i
|
||||
done
|
||||
|
||||
mkdir -p "$out/lib/pkgconfig"
|
||||
cat >"$out/lib/pkgconfig/mupdf.pc" <<EOF
|
||||
|
@ -38,23 +53,24 @@ stdenv.mkDerivation rec {
|
|||
|
||||
Name: mupdf
|
||||
Description: Library for rendering PDF documents
|
||||
Requires: freetype2 libopenjp2 libcrypto
|
||||
Version: ${version}
|
||||
Libs: -L$out/lib -lmupdf
|
||||
Libs: -L$out/lib -lmupdf -lmupdfthird
|
||||
Cflags: -I$out/include
|
||||
EOF
|
||||
|
||||
mkdir -p $out/share/applications
|
||||
cat > $out/share/applications/mupdf.desktop <<EOF
|
||||
moveToOutput "bin" "$bin"
|
||||
mkdir -p $bin/share/applications
|
||||
cat > $bin/share/applications/mupdf.desktop <<EOF
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=mupdf
|
||||
Comment=PDF viewer
|
||||
Exec=$out/bin/mupdf-x11 %f
|
||||
Exec=$bin/bin/mupdf-x11 %f
|
||||
Terminal=false
|
||||
EOF
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ fetchurl, stdenv, cmake }:
|
||||
{ fetchurl, stdenv }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "poppler-data-0.4.7";
|
||||
|
@ -8,22 +8,17 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "1pm7wg6xqj4sppb5az4pa7psfdk4yxxkw52j85bm9fksibcb0lp7";
|
||||
};
|
||||
|
||||
buildInputs = [ cmake ];
|
||||
postPatch = ''
|
||||
sed -i 's,$(datadir)/pkgconfig,$(prefix)/lib/pkgconfig,g' Makefile
|
||||
'';
|
||||
|
||||
# TODO: actually use $prefix/etc/profile.d in NixOS
|
||||
postInstall =
|
||||
''
|
||||
mkdir -pv ''${out}/etc/profile.d
|
||||
echo "export POPPLER_DATADIR=''${out}/share/poppler" |
|
||||
tee ''${out}/etc/profile.d/60-poppler.sh
|
||||
chmod -c +x ''${out}/etc/profile.d/60-poppler.sh
|
||||
'';
|
||||
installFlags = [ "prefix=$(out)" ];
|
||||
|
||||
meta = {
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://poppler.freedesktop.org/;
|
||||
description = "Encoding files for Poppler, a PDF rendering library";
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
license = stdenv.lib.licenses.free; # more free licenses combined
|
||||
maintainers = [ stdenv.lib.maintainers.urkud ];
|
||||
platforms = platforms.all;
|
||||
license = licenses.free; # more free licenses combined
|
||||
maintainers = with maintainers; [ urkud ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
|
||||
index 2e11bb0..a277ab9 100644
|
||||
--- a/poppler/GlobalParams.cc
|
||||
+++ b/poppler/GlobalParams.cc
|
||||
@@ -748,7 +748,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
|
||||
void GlobalParams::scanEncodingDirs() {
|
||||
GDir *dir;
|
||||
GDirEntry *entry;
|
||||
- const char *dataRoot = popplerDataDir ? popplerDataDir : POPPLER_DATADIR;
|
||||
+ const char *dataRoot = popplerDataDir ? popplerDataDir : ( getenv("POPPLER_DATADIR") ? getenv("POPPLER_DATADIR") : POPPLER_DATADIR );
|
||||
|
||||
// allocate buffer large enough to append "/nameToUnicode"
|
||||
size_t bufSize = strlen(dataRoot) + strlen("/nameToUnicode") + 1;
|
|
@ -1,14 +1,15 @@
|
|||
{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, libiconv, libintlOrEmpty
|
||||
, zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg
|
||||
, minimal ? false
|
||||
, withData ? false, poppler_data
|
||||
, qt4Support ? false, qt4 ? null
|
||||
, qt5Support ? false, qtbase ? null
|
||||
, utils ? false, suffix ? "glib"
|
||||
, utils ? false
|
||||
, minimal ? false, suffix ? "glib"
|
||||
}:
|
||||
|
||||
let # beware: updates often break cups_filters build
|
||||
version = "0.43.0"; # even major numbers are stable
|
||||
sha256 = "0mi4zf0pz3x3fx3ir7szz1n57nywgbpd4mp2r7mvf47f4rmf4867";
|
||||
version = "0.46.0"; # even major numbers are stable
|
||||
sha256 = "11z4d5vrrd0m7w9bfydwabksk273z7z0xf2nwvzf5pk17p8kazcn";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = "poppler-${suffix}-${version}";
|
||||
|
@ -20,22 +21,19 @@ stdenv.mkDerivation rec {
|
|||
|
||||
outputs = [ "dev" "out" ];
|
||||
|
||||
patches = [ ./datadir_env.patch ];
|
||||
buildInputs = [ libiconv ] ++ libintlOrEmpty ++ lib.optional withData poppler_data;
|
||||
|
||||
# TODO: reduce propagation to necessary libs
|
||||
propagatedBuildInputs = with lib;
|
||||
[ zlib freetype fontconfig libjpeg ]
|
||||
++ optionals (!minimal) [ cairo lcms curl openjpeg ]
|
||||
[ zlib freetype fontconfig libjpeg openjpeg ]
|
||||
++ optionals (!minimal) [ cairo lcms curl ]
|
||||
++ optional qt4Support qt4
|
||||
++ optional qt5Support qtbase;
|
||||
|
||||
nativeBuildInputs = [ pkgconfig libiconv ] ++ libintlOrEmpty;
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ];
|
||||
|
||||
# Any package depending on Qt >= 5.7 must build using the C++11 standard.
|
||||
CXXFLAGS = lib.optional qt5Support "-std=c++11";
|
||||
|
||||
configureFlags = with lib;
|
||||
[
|
||||
"--enable-xpdf-headers"
|
||||
|
@ -45,7 +43,7 @@ stdenv.mkDerivation rec {
|
|||
]
|
||||
++ optionals minimal [
|
||||
"--disable-poppler-glib" "--disable-poppler-cpp"
|
||||
"--disable-libopenjpeg" "--disable-libcurl"
|
||||
"--disable-libcurl"
|
||||
]
|
||||
++ optional (!utils) "--disable-utils" ;
|
||||
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
|
||||
### IMPORTANT: before updating cups, make sure the nixos/tests/printing.nix test
|
||||
### works at least for your platform.
|
||||
let version = "2.1.3"; in
|
||||
|
||||
with stdenv.lib;
|
||||
stdenv.mkDerivation {
|
||||
stdenv.mkDerivation rec {
|
||||
name = "cups-${version}";
|
||||
version = "2.1.4";
|
||||
|
||||
passthru = { inherit version; };
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.cups.org/software/${version}/cups-${version}-source.tar.bz2";
|
||||
sha256 = "1lyl3z01xhg9xb9c8m42398c6h9kw8qr6jwiv8bjdsjab11hv9rn";
|
||||
url = "https://github.com/apple/cups/releases/download/release-${version}/cups-${version}-source.tar.gz";
|
||||
sha256 = "13bjxw256wd1nff22vj2z25mdhllj2h6d9xypsg55b40661zs52b";
|
||||
};
|
||||
|
||||
# FIXME: the cups libraries contains some $out/share strings so can't be split.
|
||||
|
|
|
@ -8,11 +8,11 @@ let
|
|||
|
||||
in stdenv.mkDerivation rec {
|
||||
name = "cups-filters-${version}";
|
||||
version = "1.5.0";
|
||||
version = "1.11.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://openprinting.org/download/cups-filters/${name}.tar.xz";
|
||||
sha256 = "0cjrh4wpdhkvmahfkg8f2a2qzilcq12i78q5arwr7dnmx1j8hapj";
|
||||
sha256 = "0x0jxn1hnif92m7dyqrqh015gpsf79dviarb7dfl0zya2drlk1m8";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig makeWrapper ];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ fetchurl, stdenv, pkgconfig, poppler, poppler_data, makeWrapper }:
|
||||
{ fetchurl, stdenv, pkgconfig, poppler, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "pdfgrep-${version}";
|
||||
|
@ -9,19 +9,13 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "6e8bcaf8b219e1ad733c97257a97286a94124694958c27506b2ea7fc8e532437";
|
||||
};
|
||||
|
||||
buildInputs = [ pkgconfig poppler poppler_data makeWrapper ];
|
||||
buildInputs = [ pkgconfig poppler makeWrapper ];
|
||||
|
||||
patchPhase = ''
|
||||
sed -i -e "s%cpp/poppler-document.h%poppler/cpp/poppler-document.h%" pdfgrep.cc
|
||||
sed -i -e "s%cpp/poppler-page.h%poppler/cpp/poppler-page.h%" pdfgrep.cc
|
||||
'';
|
||||
|
||||
# workarround since it can't be hardcoded in pdfgrep
|
||||
preFixup = ''
|
||||
wrapProgram "$out/bin/pdfgrep" \
|
||||
--set POPPLER_DATADIR "${poppler_data}/share/poppler"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A tool to search text in PDF files";
|
||||
homepage = http://pdfgrep.sourceforge.net/;
|
||||
|
|
|
@ -14133,9 +14133,7 @@ in
|
|||
|
||||
pdfdiff = callPackage ../applications/misc/pdfdiff { };
|
||||
|
||||
mupdf = callPackage ../applications/misc/mupdf {
|
||||
openjpeg = openjpeg_2_0;
|
||||
};
|
||||
mupdf = callPackage ../applications/misc/mupdf { };
|
||||
|
||||
diffpdf = callPackage ../applications/misc/diffpdf { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue