diff options
author | Pascal Wittmann <mail@pascal-wittmann.de> | 2014-11-29 14:17:19 +0100 |
---|---|---|
committer | Pascal Wittmann <mail@pascal-wittmann.de> | 2014-11-29 14:21:16 +0100 |
commit | 5dd9d2d342caa7acc84dab0d5ea7514be70d25f2 (patch) | |
tree | aca701d294d3ff08021c6d14e61026238add7b40 /pkgs/applications/misc/llpp | |
parent | f063a0a24504e6ae4ad128a3f363a8689508a792 (diff) |
llpp: update to latest revision, uses now the ninja build system
Diffstat (limited to 'pkgs/applications/misc/llpp')
-rw-r--r-- | pkgs/applications/misc/llpp/default.nix | 82 |
1 files changed, 24 insertions, 58 deletions
diff --git a/pkgs/applications/misc/llpp/default.nix b/pkgs/applications/misc/llpp/default.nix index e04898fba29fc..5284d441b44f2 100644 --- a/pkgs/applications/misc/llpp/default.nix +++ b/pkgs/applications/misc/llpp/default.nix @@ -1,75 +1,41 @@ -{ stdenv, fetchgit, ocaml, mupdf, lablgl, mesa -, libX11, libXext, gtk3, freetype, zlib, openjpeg -, jbig2dec, libjpeg, ncurses }: +{ stdenv, makeWrapper, fetchgit, pkgconfig, ninja, ocaml, findlib, mupdf, lablgl +, gtk3, openjpeg, jbig2dec, mujs }: -stdenv.mkDerivation { - name = "llpp-2014-05-26"; +let ocamlVersion = (builtins.parseDrvName (ocaml.name)).version; +in stdenv.mkDerivation rec { + name = "llpp-2014-11-29"; src = fetchgit { url = "git://repo.or.cz/llpp.git"; - rev = "902143de64d86b5714b3a59d2cc7085083b87249"; - sha256 = "038xl4gbvm57na2lz1fw36sf43zaxq407zi2d53985vc33677j9s"; + rev = "481c8398b2c5dc4589738f5f80104ed75b9c73ff"; + sha256 = "13zi5mzpd9j4mmm68m3zkv49xgkhswhqvmp4bbyi0psmhxak8y5l"; }; - buildInputs = [ ocaml mupdf lablgl mesa libX11 libXext gtk3 - freetype jbig2dec libjpeg openjpeg zlib ncurses ]; + buildInputs = [ pkgconfig ninja makeWrapper ocaml findlib mupdf lablgl + gtk3 jbig2dec openjpeg mujs ]; - # The build phase was extracted from buildall.sh, because that script - # fetched the dependencies on its own. - buildPhase = '' - ccopt="-O" - ccopt="$ccopt -I ${jbig2dec}/include" - ccopt="$ccopt -I ${libjpeg}/include" - ccopt="$ccopt -I ${freetype}/include/freetype2" - ccopt="$ccopt -I ${openjpeg}/include" - ccopt="$ccopt -I ${zlib}/include" - ccopt="$ccopt -I ${mupdf}/include" - ccopt="$ccopt -include ft2build.h" - ccopt="$ccopt -D_GNU_SOURCE" - - cclib="$cclib -lmupdf" - cclib="$cclib -lz -ljpeg -lopenjp2 -ljbig2dec -lfreetype -lpthread" - cclib="$cclib -lX11" - cclib="$cclib -lfreetype" - - comp=ocamlc.opt - cmsuf=cmo - - sh mkhelp.sh keystoml.ml KEYS > help.ml - - $comp -c -o link.o -ccopt "$ccopt" link.c - $comp -c -o help.$cmsuf help.ml - $comp -c -o utils.$cmsuf utils.ml - $comp -c -o wsi.cmi wsi.mli - $comp -c -o wsi.$cmsuf wsi.ml - $comp -c -o parser.$cmsuf parser.ml - $comp -c -o main.$cmsuf -I ${lablgl}/lib/ocaml/4.01.0/site-lib/lablgl main.ml - - $comp -custom -o llpp \ - -I ${lablgl}/lib/ocaml/4.01.0/site-lib/lablgl \ - str.cma unix.cma lablgl.cma \ - link.o \ - -cclib "$cclib" \ - help.cmo \ - utils.cmo \ - parser.cmo \ - wsi.cmo \ - main.cmo + 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 ''; - # Binary fails with 'No bytecode file specified.' if stripped. - dontStrip = true; + buildPhase = "${ninja}/bin/ninja"; installPhase = '' - install -d $out/bin - install llpp llppac $out/bin + 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" ''; - meta = { + meta = with stdenv.lib; { homepage = http://repo.or.cz/w/llpp.git; description = "A MuPDF based PDF pager written in OCaml"; - platforms = stdenv.lib.platforms.linux; - maintainers = [ stdenv.lib.maintainers.pSub ]; - license = "GPL"; + platforms = platforms.linux; + maintainers = with maintainers; [ pSub ]; + license = licenses.gpl3; }; } |