@@ -1,12 +1,12 @@
1−{ fetchurl, stdenv, python2Packages, makeWrapper, lib
1+{ fetchurl, stdenv, python2, makeWrapper, lib
2−, xpdf, mesa, SDL, freeglut }:
2+, mesa, SDL, freeglut, ghostscript, pdftk, dejavu_fonts }:
5− inherit (python2Packages) python pyopengl pygame setuptools pillow;
6 version = "0.11.1";
5 version = "0.11.1";
6+ pythonEnv = python2.withPackages (ps: with ps; [pyopengl pygame pillow]);
7in stdenv.mkDerivation {
7in stdenv.mkDerivation {
8 # This project was formerly known as KeyJNote.
8 # This project was formerly known as KeyJNote.
9− # See http://keyj.s2000.ws/?p=77 for details.
9+ # See http://keyj.emphy.de/apple-lawsuit/ for details.
11 name = "impressive-${version}";
11 name = "impressive-${version}";
@@ -15,37 +15,26 @@ in stdenv.mkDerivation {
15 sha256 = "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr";
15 sha256 = "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr";
18− # Note: We need to have `setuptools' in the path to be able to use
20− buildInputs = [ makeWrapper xpdf pillow pyopengl pygame ];
18+ buildInputs = [ makeWrapper pythonEnv ];
22 configurePhase = ''
20 configurePhase = ''
21+ # Let's fail at build time if the library we're substituting in doesn't
22+ # exist/isn't marked as executable
23+ test -x ${SDL}/lib/libSDL.so
23 sed -i "impressive.py" \
24 sed -i "impressive.py" \
24− -e 's|^#!/usr/bin/env.*$|#!${python}/bin/python|g'
25+ -e '/^__website__/a SDL_LIBRARY = "${SDL}/lib/libSDL.so"' \
26+ -e 's/sdl = CDLL.*/sdl = CDLL(SDL_LIBRARY)/' \
27+ -e 's^FontPath =.*/usr/.*$^FontPath = ["${dejavu_fonts}/share/fonts", ""]^'
27 installPhase = ''
30 installPhase = ''
28− mkdir -p "$out/bin" "$out/share/doc/impressive"
31+ mkdir -p "$out/bin" "$out/share/doc/impressive" "$out/share/man/man1"
29 mv impressive.py "$out/bin/impressive"
32 mv impressive.py "$out/bin/impressive"
33+ mv impressive.1 "$out/share/man/man1"
30− mv * "$out/share/doc/impressive"
34+ mv changelog.txt impressive.html license.txt "$out/share/doc/impressive"
32− # XXX: We have to reiterate PyOpenGL's dependencies here.
34− # `setuptools' must be in the Python path as it's used by
37− # We set $LIBRARY_PATH (no `LD_'!) so that ctypes can find
38− # `libGL.so', which it does by running `gcc', which in turn
39− # honors $LIBRARY_PATH. See
40− # http://python.net/crew/theller/ctypes/reference.html#id1 .
41 wrapProgram "$out/bin/impressive" \
36 wrapProgram "$out/bin/impressive" \
42− --prefix PATH ":" "${xpdf}/bin" \
37+ --prefix PATH ":" "${ghostscript}/bin:${pdftk}/bin"
43− --prefix PYTHONPATH ":" \
44− ${lib.concatStringsSep ":"
46− path + "/lib/${python.libPrefix}/site-packages")
47− [ pillow pyopengl pygame setuptools ])} \
48− --prefix LIBRARY_PATH ":" "${lib.makeLibraryPath [ mesa freeglut SDL ]}"
@@ -73,7 +62,7 @@ in stdenv.mkDerivation {
74 license = stdenv.lib.licenses.gpl2;
63 license = stdenv.lib.licenses.gpl2;
76− maintainers = [ ];
65+ maintainers = with lib.maintainers; [ lheckemann ];
77 platforms = stdenv.lib.platforms.mesaPlatforms;
66 platforms = stdenv.lib.platforms.mesaPlatforms;