1
- { fetchurl , stdenv , python2Packages , makeWrapper , lib
2
- , xpdf , mesa , SDL , freeglut } :
1
+ { fetchurl , stdenv , python2 , makeWrapper , lib
2
+ , mesa , SDL , freeglut , ghostscript , pdftk , dejavu_fonts } :
3
3
4
4
let
5
- inherit ( python2Packages ) python pyopengl pygame setuptools pillow ;
6
5
version = "0.11.1" ;
6
+ pythonEnv = python2 . withPackages ( ps : with ps ; [ pyopengl pygame pillow ] ) ;
7
7
in stdenv . mkDerivation {
8
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.
10
10
11
11
name = "impressive-${ version } " ;
12
12
@@ -15,37 +15,26 @@ in stdenv.mkDerivation {
15
15
sha256 = "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr" ;
16
16
} ;
17
17
18
- # Note: We need to have `setuptools' in the path to be able to use
19
- # PyOpenGL.
20
- buildInputs = [ makeWrapper xpdf pillow pyopengl pygame ] ;
18
+ buildInputs = [ makeWrapper pythonEnv ] ;
21
19
22
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
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", ""]^'
25
28
'' ;
26
29
27
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
32
mv impressive.py "$out/bin/impressive"
30
- mv * "$out/share/doc/impressive"
33
+ mv impressive.1 "$out/share/man/man1"
34
+ mv changelog.txt impressive.html license.txt "$out/share/doc/impressive"
31
35
32
- # XXX: We have to reiterate PyOpenGL's dependencies here.
33
- #
34
- # `setuptools' must be in the Python path as it's used by
35
- # PyOpenGL.
36
- #
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
36
wrapProgram "$out/bin/impressive" \
42
- --prefix PATH ":" "${ xpdf } /bin" \
43
- --prefix PYTHONPATH ":" \
44
- ${ lib . concatStringsSep ":"
45
- ( map ( path :
46
- path + "/lib/${ python . libPrefix } /site-packages" )
47
- [ pillow pyopengl pygame setuptools ] ) } \
48
- --prefix LIBRARY_PATH ":" "${ lib . makeLibraryPath [ mesa freeglut SDL ] } "
37
+ --prefix PATH ":" "${ ghostscript } /bin:${ pdftk } /bin"
49
38
'' ;
50
39
51
40
meta = {
@@ -73,7 +62,7 @@ in stdenv.mkDerivation {
73
62
74
63
license = stdenv . lib . licenses . gpl2 ;
75
64
76
- maintainers = [ ] ;
65
+ maintainers = with lib . maintainers ; [ lheckemann ] ;
77
66
platforms = stdenv . lib . platforms . mesaPlatforms ;
78
67
} ;
79
68
}
0 commit comments