From 9b385535e86cc56458fde630bba6903e3bfc2f80 Mon Sep 17 00:00:00 2001 From: Rahul Gopinath Date: Sat, 11 Jun 2016 20:34:57 -0700 Subject: [PATCH 1/4] mupdf: 1.8 -> 1.9 Updates mupdf, and libmupdf.so --- pkgs/applications/misc/mupdf/default.nix | 51 ++++++++---------------- 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/pkgs/applications/misc/mupdf/default.nix b/pkgs/applications/misc/mupdf/default.nix index b7e4e1966c9a..fb475f047b46 100644 --- a/pkgs/applications/misc/mupdf/default.nix +++ b/pkgs/applications/misc/mupdf/default.nix @@ -1,42 +1,25 @@ -{ stdenv, fetchurl, fetchpatch, pkgconfig, zlib, freetype, libjpeg, jbig2dec, openjpeg -, libX11, libXext }: +{ stdenv, fetchurl, fetchpatch, pkgconfig +, zlib, freetype, libjpeg, jbig2dec, openjpeg +, libX11, libXcursor, libXrandr, libXinerama, libXext, harfbuzz, mesa }: stdenv.mkDerivation rec { - version = "1.8"; + version = "1.9"; name = "mupdf-${version}"; src = fetchurl { url = "http://mupdf.com/downloads/archive/${name}-source.tar.gz"; - sha256 = "01n26cy41lc2fjri63s4js23ixxb4nd37aafry3hz4i4id6wd8x2"; + sha256 = "15p2k1n3afc7bnqrc0zfqz31fjfq3rrrrj4fwwy5az26d11ynxhp"; }; + NIX_CFLAGS_COMPILE= [ "-fPIC" ]; nativeBuildInputs = [ pkgconfig ]; - propagatedBuildInputs = [ openjpeg libjpeg jbig2dec ]; - buildInputs = [ zlib freetype libX11 libXext ]; + buildInputs = [ zlib freetype libX11 libXcursor libXext harfbuzz mesa libXrandr libXinerama]; - enableParallelBuilding = true; + installPhase = '' + make install prefix=$out + gcc -shared -o $out/lib/libmupdf.so.${version} -Wl,--whole-archive $out/lib/libmupdf.a -Wl,--no-whole-archive - my_soname = "libmupdf.so.1.3"; - my_soname_js_none = "libmupdf-js-none.so.1.3"; - preBuild = '' - export makeFlags="prefix=$out build=release XCFLAGS=-fpic" - export NIX_CFLAGS_COMPILE=" $NIX_CFLAGS_COMPILE -I$(echo ${openjpeg}/include/openjpeg-*) " - - # Copied from Gentoo ebuild - rm -rf thirdparty - sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \ - -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \ - -e "/^MUPDF_LIB :=/s:=.*:= \$(OUT)/${my_soname}:" \ - -e "\$a\$(MUPDF_JS_NONE_LIB):" \ - -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \ - -e "/^MUPDF_JS_NONE_LIB :=/s:=.*:= \$(OUT)/${my_soname_js_none}:" \ - -i Makefile - - sed -e "s/libopenjpeg1/libopenjp2/" -i Makerules - ''; - - postInstall = '' - ln -s ${my_soname} $out/lib/libmupdf.so + ln -s $out/lib/libmupdf.so.${version} $out/lib/libmupdf.so mkdir -p "$out/lib/pkgconfig" cat >"$out/lib/pkgconfig/mupdf.pc" < Date: Sat, 11 Jun 2016 21:59:15 -0700 Subject: [PATCH 2/4] zathura: Update mupdf dependency --- .../misc/zathura/pdf-mupdf/config.patch | 17 ----------------- .../misc/zathura/pdf-mupdf/default.nix | 12 +++++++----- 2 files changed, 7 insertions(+), 22 deletions(-) delete mode 100644 pkgs/applications/misc/zathura/pdf-mupdf/config.patch diff --git a/pkgs/applications/misc/zathura/pdf-mupdf/config.patch b/pkgs/applications/misc/zathura/pdf-mupdf/config.patch deleted file mode 100644 index 6445fab22989..000000000000 --- a/pkgs/applications/misc/zathura/pdf-mupdf/config.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- zathura-pdf-mupdf-0.2.7/config.mk -+++ zathura-pdf-mupdf-0.2.7/config.mk -@@ -32,10 +32,11 @@ - OPENSSL_INC ?= $(shell pkg-config --cflags libcrypto) - OPENSSL_LIB ?= $(shell pkg-config --libs libcrypto) - --MUPDF_LIB ?= -lmupdf -lmujs -+MUPDF_INC ?= $(shell pkg-config --cflags mupdf) -+MUPDF_LIB ?= $(shell pkg-config --libs mupdf) - --INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${ZATHURA_INC} --LIBS = ${GTK_LIB} ${GIRARA_LIB} ${MUPDF_LIB} ${OPENSSL_LIB} -ljbig2dec -lopenjp2 -ljpeg -+INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${ZATHURA_INC} ${MUPDF_INC} -+LIBS = ${GTK_LIB} ${GIRARA_LIB} ${OPENSSL_LIB} ${MUPDF_LIB} -ljbig2dec -ljpeg - - # flags - CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS) diff --git a/pkgs/applications/misc/zathura/pdf-mupdf/default.nix b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix index 2b74fc21b8c6..b8f75b7151f5 100644 --- a/pkgs/applications/misc/zathura/pdf-mupdf/default.nix +++ b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, pkgconfig, zathura_core, gtk, girara, mupdf, openssl }: +{ stdenv, lib, fetchurl, pkgconfig, zathura_core, gtk, girara, mupdf, openssl, libjpeg, jbig2dec, openjpeg, fetchpatch}: stdenv.mkDerivation rec { version = "0.3.0"; @@ -9,13 +9,15 @@ stdenv.mkDerivation rec { sha256 = "1j3j3wbp49walb19f0966qsnlqbd26wnsjpcxfbf021dav8vk327"; }; - buildInputs = [ pkgconfig zathura_core gtk girara openssl mupdf ]; + buildInputs = [ pkgconfig zathura_core gtk girara openssl mupdf libjpeg jbig2dec openjpeg ]; makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ]; - patches = [ - ./config.patch - ]; + patches = [(fetchpatch { + name = "mupdf-1.9.patch"; + url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/mupdf-1.9.patch?h=packages/zathura-pdf-mupdf"; + sha256 = "185wgg0z4b0z5aybcnnyvbs50h43imn5xz3nqmya4rk4v5bwy49y"; + })]; meta = with lib; { homepage = http://pwmt.org/projects/zathura/; From b8a525a8b644d9fc9961ca3ab3c4083b93987b2c Mon Sep 17 00:00:00 2001 From: Rahul Gopinath Date: Sat, 11 Jun 2016 23:32:33 -0700 Subject: [PATCH 3/4] jfbview: update mupdf 1.8 -> 1.9 --- pkgs/os-specific/linux/jfbview/default.nix | 4 +++ .../os-specific/linux/jfbview/mupdf-1.9.patch | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/os-specific/linux/jfbview/mupdf-1.9.patch diff --git a/pkgs/os-specific/linux/jfbview/default.nix b/pkgs/os-specific/linux/jfbview/default.nix index 31ba5e1152c5..bad64a20cac7 100644 --- a/pkgs/os-specific/linux/jfbview/default.nix +++ b/pkgs/os-specific/linux/jfbview/default.nix @@ -31,6 +31,10 @@ stdenv.mkDerivation rec { imlib2 ]; + patches = [ + ./mupdf-1.9.patch + ]; + configurePhase = '' # Hack. Probing (`ldconfig -p`) fails with ‘cannot execute binary file’. # Overriding `OPENJP2 =` later works, but makes build output misleading: diff --git a/pkgs/os-specific/linux/jfbview/mupdf-1.9.patch b/pkgs/os-specific/linux/jfbview/mupdf-1.9.patch new file mode 100644 index 000000000000..99d7377239bf --- /dev/null +++ b/pkgs/os-specific/linux/jfbview/mupdf-1.9.patch @@ -0,0 +1,28 @@ +--- JFBView-0.5.2-src/Makefile 2016-06-11 23:27:54.969894750 -0700 ++++ JFBView-0.5.2-src/Makefile 2016-06-11 23:24:45.181142832 -0700 +@@ -134,13 +134,22 @@ + + .PHONY: detect_libopenjp2 + detect_libopenjp2: +- $(eval OPENJP2 = $(shell ldconfig -p | grep -q libopenjp2 && echo 'openjp2' || echo 'openjpeg')) ++ $(eval OPENJP2 = $(shell echo libopenjp2 | grep -q libopenjp2 && echo 'openjp2' || echo 'openjpeg')) + @echo "OPENJP2 = $(OPENJP2)" >> $(CONFIG_MK) + + # mupdf_version only depends on -lmupdf. + mupdf_version: mupdf_version.cpp +- $(CXX) $(CXXFLAGS) -o $@ $^ $(LDLIBS) -lmupdf +- ++ $(CXX) $(CXXFLAGS) -o $@ $^ $(LDLIBS) -lmupdf \ ++ -lpthread \ ++ -lform \ ++ -lncurses \ ++ -lfreetype \ ++ -lharfbuzz \ ++ -lz \ ++ -ljbig2dec \ ++ -ljpeg \ ++ -lmujs \ ++ -lopenjp2 + endif + + From 857ba2d956c17e87c1a347e0a8454ca5dec4cc73 Mon Sep 17 00:00:00 2001 From: Rahul Gopinath Date: Sat, 11 Jun 2016 23:39:59 -0700 Subject: [PATCH 4/4] llpp: 21-git-2016-05-07 -> 21-git-2015-07-30 Update llpp to sync with mupdf --- pkgs/applications/misc/llpp/default.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/misc/llpp/default.nix b/pkgs/applications/misc/llpp/default.nix index 42bfe698a9b6..04ad52175ff1 100644 --- a/pkgs/applications/misc/llpp/default.nix +++ b/pkgs/applications/misc/llpp/default.nix @@ -1,33 +1,36 @@ { stdenv, makeWrapper, fetchgit, pkgconfig, ninja, ocaml, findlib, mupdf, lablgl -, gtk3, openjpeg, jbig2dec, mujs, xsel, openssl }: +, gtk3, openjpeg, jbig2dec, mujs, xsel, openssl, freetype, ncurses }: let ocamlVersion = (builtins.parseDrvName (ocaml.name)).version; in stdenv.mkDerivation rec { name = "llpp-${version}"; - version = "21-git-2015-07-30"; + version = "21-git-2016-05-07"; src = fetchgit { url = "git://repo.or.cz/llpp.git"; - rev = "e9fe06d684b145a104cc319673076e069e853cac"; - sha256 = "0w6kdjmh6jp5j88m213r0dg66ma42nxl6j4hjy4xnhkf52mg0iwx"; + rev = "1beb003ca0f4ed90fda2823cb07c2eb674fc3ca4"; + sha256 = "1r59yfm81zmiij401d3wc3zb1zc873ss02gkplbwi4lad2l0chba"; fetchSubmodules = false; }; buildInputs = [ pkgconfig ninja makeWrapper ocaml findlib mupdf lablgl - gtk3 jbig2dec openjpeg mujs openssl ]; + gtk3 jbig2dec openjpeg mujs openssl freetype ncurses ]; + + dontStrip = true; configurePhase = '' - sh configure.sh -O -F ${mupdf} - sed -i 's;-lopenjpeg;-lopenjp2;g' .config - sed -i 's;$builddir/link\.so;link.so;g' build.ninja + sed -i -e 's+-I \$srcdir/mupdf/include -I \$srcdir/mupdf/thirdparty/freetype/include+-I ${freetype}/include+' build.sh + sed -i -e 's+-lmupdf +-lfreetype -lz -lharfbuzz -ljbig2dec -lopenjp2 -ljpeg -lmupdf +' build.sh + sed -i -e 's+-L\$srcdir/mupdf/build/native ++' build.sh ''; - buildPhase = "${ninja}/bin/ninja"; + buildPhase = '' + sh ./build.sh build + ''; installPhase = '' install -d $out/bin $out/lib install build/llpp $out/bin - install link.so $out/lib wrapProgram $out/bin/llpp \ --prefix CAML_LD_LIBRARY_PATH ":" "${lablgl}/lib/ocaml/${ocamlVersion}/site-lib/lablgl" \ --prefix CAML_LD_LIBRARY_PATH ":" "$out/lib" \