3
0
Fork 0
forked from mirrors/nixpkgs

llpp: update to latest revision, uses now the ninja build system

This commit is contained in:
Pascal Wittmann 2014-11-29 14:17:19 +01:00
parent f063a0a245
commit 5dd9d2d342
2 changed files with 28 additions and 59 deletions

View file

@ -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;
};
}

View file

@ -10076,7 +10076,10 @@ let
bison = bison2;
};
llpp = callPackage ../applications/misc/llpp { inherit (ocamlPackages) lablgl; };
llpp = callPackage ../applications/misc/llpp {
inherit (ocamlPackages_4_02_1) lablgl findlib;
ocaml = ocaml_4_02_1;
};
lmms = callPackage ../applications/audio/lmms { };