git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #29609 from lheckemann/impressive-fixes

impressive: fixes and improvements

commiteaac347982976de98ae33016247d35378e857a06 authorJörg Thalheim <Mic92@users.noreply.github.com> dateThu 21 Sep 2017, 08:53 (9 years ago) parent4eb573105101d3
1 file changed+16−27
pkgs/applications/office/impressive/default.nix+16−27
pkgs/applications/office/impressive/default.nix+16−27
@@ -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
44let
5− inherit (python2Packages) python pyopengl pygame setuptools pillow;
65 version = "0.11.1";
6+ pythonEnv = python2.withPackages (ps: with ps; [pyopengl pygame pillow]);
77in 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 }