Skip to content

Commit 4a17dea

Browse files
lheckemannMic92
authored andcommittedSep 21, 2017
impressive: fixes and improvements
- Fix finding SDL (would previously fail unless gcc was in environment) - Use ghostscript rather than xpdf for rendering as it has a slightly smaller closure - Fix broken link for reasoning behind name change - Add self to maintainers - Add reference to DejaVu fonts so it can always find the OSD fonts - Install manpage into correct location (cherry picked from commit 05101d3)
1 parent 34efc5b commit 4a17dea

File tree

1 file changed

+16
-27
lines changed

1 file changed

+16
-27
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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 }:
33

44
let
5-
inherit (python2Packages) python pyopengl pygame setuptools pillow;
65
version = "0.11.1";
6+
pythonEnv = python2.withPackages (ps: with ps; [pyopengl pygame pillow]);
77
in stdenv.mkDerivation {
88
# 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.
1010

1111
name = "impressive-${version}";
1212

@@ -15,37 +15,26 @@ in stdenv.mkDerivation {
1515
sha256 = "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr";
1616
};
1717

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 ];
2119

2220
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
2324
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", ""]^'
2528
'';
2629

2730
installPhase = ''
28-
mkdir -p "$out/bin" "$out/share/doc/impressive"
31+
mkdir -p "$out/bin" "$out/share/doc/impressive" "$out/share/man/man1"
2932
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"
3135
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 .
4136
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"
4938
'';
5039

5140
meta = {
@@ -73,7 +62,7 @@ in stdenv.mkDerivation {
7362

7463
license = stdenv.lib.licenses.gpl2;
7564

76-
maintainers = [ ];
65+
maintainers = with lib.maintainers; [ lheckemann ];
7766
platforms = stdenv.lib.platforms.mesaPlatforms;
7867
};
7968
}

0 commit comments

Comments
 (0)
Please sign in to comment.