Skip to content

Commit

Permalink
Added llpp, a mupdf based pdf pager written in ocaml.
Browse files Browse the repository at this point in the history
Updated lablgl to 1.05 and mupdf to 1.4.
Added myself as maintainer for lablgl.
  • Loading branch information
pSub committed Jun 4, 2014
1 parent 6b21186 commit 86b7cf8
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 65 deletions.
75 changes: 75 additions & 0 deletions pkgs/applications/misc/llpp/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{ stdenv, fetchgit, ocaml, mupdf, lablgl, mesa
, libX11, libXext, gtk3, freetype, zlib, openjpeg
, jbig2dec, libjpeg, ncurses }:

stdenv.mkDerivation {
name = "llpp-2014-05-26";

src = fetchgit {
url = "git://repo.or.cz/llpp.git";
rev = "902143de64d86b5714b3a59d2cc7085083b87249";
sha256 = "038xl4gbvm57na2lz1fw36sf43zaxq407zi2d53985vc33677j9s";
};

buildInputs = [ ocaml mupdf lablgl mesa libX11 libXext gtk3
freetype jbig2dec libjpeg openjpeg zlib ncurses ];

# 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"
ccopt="$ccopt -I ${openjpeg}/include"
ccopt="$ccopt -I ${zlib}/include"
ccopt="$ccopt -I ${mupdf}/include"
ccopt="$ccopt -include ${freetype}/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
'';

# Binary fails with 'No bytecode file specified.' if stripped.
dontStrip = true;

installPhase = ''
install -d $out/bin
install llpp llppac $out/bin
'';

meta = {
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";
};
}
11 changes: 2 additions & 9 deletions pkgs/applications/misc/mupdf/default.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
{ stdenv, fetchurl, fetchpatch, pkgconfig, zlib, freetype, libjpeg, jbig2dec, openjpeg
, libX11, libXext }:
stdenv.mkDerivation rec {
name = "mupdf-1.3";
name = "mupdf-1.4";

src = fetchurl {
url = "http://mupdf.com/download/archive/${name}-source.tar.gz";
sha256 = "0y247nka5gkr1ajn47jrlp5rcnf6h4ff7dfsprma3h4wxqdv7a5b";
sha256 = "08pc6fv42sb9k9dzjs8ph32nixzrzmr08yxh7arkpsdm42asp2q1";
};

patches = [(fetchpatch {
name = "CVE-2014-2013.patch";
url = "http://git.ghostscript.com/?p=mupdf.git;a=commitdiff_plain;"
+ "h=60dabde18d7fe12b19da8b509bdfee9cc886aafc";
sha256 = "0p721f3g2djz9fy6rcgj83c20f5k257wg2d0yvvmp02m7sp06l0g";
})];

buildInputs = [ pkgconfig zlib freetype libjpeg jbig2dec openjpeg libX11 libXext ];

enableParallelBuilding = true;
Expand Down
52 changes: 1 addition & 51 deletions pkgs/development/ocaml-modules/lablgl/Makefile.config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ diff -Naur lablGL.ori/Makefile.config lablGL/Makefile.config
+
+##### Uncomment these for windows
+#TKLIBS = tk83.lib tcl83.lib gdi32.lib user32.lib
+#GLLIBS = opengl32.lib glu32.lib
+#GLLIBS = opengl32.lib glu32.lib
+#TOOLCHAIN = msvc
+#XA = .lib
+#XB = .bat
Expand All @@ -65,53 +65,3 @@ diff -Naur lablGL.ori/Makefile.config lablGL/Makefile.config
+
+# C Compiler options
+#COPTS = -c -O
diff -Naur lablGL.ori/META lablGL/META
--- lablGL.ori/META 1970-01-01 01:00:00.000000000 +0100
+++ lablGL/META 2013-06-02 22:00:59.000000000 +0200
@@ -0,0 +1,21 @@
+description = "Bindings for OpenGL graphics engines"
+version = "1.04-1"
+archive(byte) = "lablgl.cma"
+archive(native) = "lablgl.cmxa"
+
+#package "togl" (
+# description = "OpenGL widget for labltk"
+# version = "1.01"
+# requires = "lablgl, labltk"
+# archive(byte) = "togl.cma"
+# archive(native) = "togl.cmxa"
+#)
+
+package "glut" (
+ description = "Platform-independent OpenGL window"
+ version = "1.01"
+ requires = "lablgl"
+ archive(byte) = "lablglut.cma"
+ archive(native) = "lablglut.cmxa"
+)
+
diff -Naur lablGL.ori/META~ lablGL/META~
--- lablGL.ori/META~ 1970-01-01 01:00:00.000000000 +0100
+++ lablGL/META~ 2013-06-02 21:59:17.000000000 +0200
@@ -0,0 +1,21 @@
+description = "Bindings for OpenGL graphics engines"
+version = "1.04-1"
+archive(byte) = "lablgl.cma"
+archive(native) = "lablgl.cmxa"
+
+#package "togl" (
+# description = "OpenGL widget for labltk"
+# version = "1.01"
+# requires = "lablGL, labltk"
+# archive(byte) = "togl.cma"
+# archive(native) = "togl.cmxa"
+#)
+
+package "glut" (
+ description = "Platform-independent OpenGL window"
+ version = "1.01"
+ requires = "lablGL"
+ archive(byte) = "lablglut.cma"
+ archive(native) = "lablglut.cmxa"
+)
+
9 changes: 4 additions & 5 deletions pkgs/development/ocaml-modules/lablgl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
pname = "lablgl";
version = "1.04-1";
version = "1.05";
in

stdenv.mkDerivation {
name = "${pname}-${version}";

src = fetchurl {
url = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/dist/lablgl-20120306.tar.gz";
sha256 = "1w5di2n38h7fkrf668zphnramygwl7ybjhrmww3pi9jcf9apa09r";
url = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/dist/lablgl-${version}.tar.gz";
sha256 = "0qabydd219i4ak7hxgc67496qnnscpnydya2m4ijn3cpbgih7zyq";
};

buildInputs = [ocaml findlib lablgtk mesa freeglut ];
Expand All @@ -29,7 +29,6 @@ stdenv.mkDerivation {

createFindlibDestdir = true;

#makeFlags = "BINDIR=$(out)/bin MANDIR=$(out)/usr/share/man/man1 DYPGENLIBDIR=$(out)/lib/ocaml/${ocaml_version}/site-lib";
buildFlags = "lib libopt glut glutopt";

postInstall = ''
Expand All @@ -40,6 +39,6 @@ stdenv.mkDerivation {
homepage = http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html;
description = "OpenGL bindings for ocaml";
license = "GnuGPLV2";
# maintainers = [ stdenv.lib.maintainers.roconnor ];
maintainers = [ stdenv.lib.maintainers.psub ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8830,6 +8830,8 @@ let
bison = bison2;
};

llpp = callPackage ../applications/misc/llpp { inherit (ocamlPackages) lablgl; };

lmms = callPackage ../applications/audio/lmms { };

lxdvdrip = callPackage ../applications/video/lxdvdrip { };
Expand Down

0 comments on commit 86b7cf8

Please sign in to comment.