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" \ 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" <> $(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 + +