about summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-09-28 12:32:57 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-09-28 12:32:57 -0400
commitf037625f87b0b1d8852a1f31ebaece5fdbc87a2b (patch)
treeaf8c8369954890db69195a1e9394ce16c7640d7f /pkgs/applications/office
parentf08d6f0e2daf9f3d9daa070eee223855b33c430d (diff)
parent4e22e88b914ffb63393449c5e20fe8843a7ce93b (diff)
downloadnixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar
nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.gz
nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.bz2
nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.lz
nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.xz
nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.tar.zst
nixlib-f037625f87b0b1d8852a1f31ebaece5fdbc87a2b.zip
Merge remote-tracking branch 'upstream/staging' into deps-reorg
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/impressive/default.nix43
1 files changed, 16 insertions, 27 deletions
diff --git a/pkgs/applications/office/impressive/default.nix b/pkgs/applications/office/impressive/default.nix
index 3232abfb268e..59249d1a6eb0 100644
--- a/pkgs/applications/office/impressive/default.nix
+++ b/pkgs/applications/office/impressive/default.nix
@@ -1,12 +1,12 @@
-{ fetchurl, stdenv, python2Packages, makeWrapper, lib
-, xpdf, mesa, SDL, freeglut }:
+{ fetchurl, stdenv, python2, makeWrapper, lib
+, mesa, SDL, freeglut, ghostscript, pdftk, dejavu_fonts }:
 
 let
-  inherit (python2Packages) python pyopengl pygame setuptools pillow;
   version = "0.11.1";
+  pythonEnv = python2.withPackages (ps: with ps; [pyopengl pygame pillow]);
 in stdenv.mkDerivation {
     # This project was formerly known as KeyJNote.
-    # See http://keyj.s2000.ws/?p=77 for details.
+    # See http://keyj.emphy.de/apple-lawsuit/ for details.
 
     name = "impressive-${version}";
 
@@ -15,37 +15,26 @@ in stdenv.mkDerivation {
       sha256 = "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr";
     };
 
-    # Note: We need to have `setuptools' in the path to be able to use
-    # PyOpenGL.
-    buildInputs = [ makeWrapper xpdf pillow pyopengl pygame ];
+    buildInputs = [ makeWrapper pythonEnv ];
 
     configurePhase = ''
+      # Let's fail at build time if the library we're substituting in doesn't
+      # exist/isn't marked as executable
+      test -x ${SDL}/lib/libSDL.so
       sed -i "impressive.py" \
-          -e 's|^#!/usr/bin/env.*$|#!${python}/bin/python|g'
+          -e '/^__website__/a SDL_LIBRARY = "${SDL}/lib/libSDL.so"' \
+          -e 's/sdl = CDLL.*/sdl = CDLL(SDL_LIBRARY)/' \
+          -e 's^FontPath =.*/usr/.*$^FontPath = ["${dejavu_fonts}/share/fonts", ""]^'
     '';
 
     installPhase = ''
-      mkdir -p "$out/bin" "$out/share/doc/impressive"
+      mkdir -p "$out/bin" "$out/share/doc/impressive" "$out/share/man/man1"
       mv impressive.py "$out/bin/impressive"
-      mv * "$out/share/doc/impressive"
+      mv impressive.1 "$out/share/man/man1"
+      mv changelog.txt impressive.html license.txt "$out/share/doc/impressive"
 
-      # XXX: We have to reiterate PyOpenGL's dependencies here.
-      #
-      # `setuptools' must be in the Python path as it's used by
-      # PyOpenGL.
-      #
-      # We set $LIBRARY_PATH (no `LD_'!) so that ctypes can find
-      # `libGL.so', which it does by running `gcc', which in turn
-      # honors $LIBRARY_PATH.  See
-      # http://python.net/crew/theller/ctypes/reference.html#id1 .
       wrapProgram "$out/bin/impressive" \
-         --prefix PATH ":" "${xpdf}/bin" \
-         --prefix PYTHONPATH ":" \
-                  ${lib.concatStringsSep ":"
-                     (map (path:
-                            path + "/lib/${python.libPrefix}/site-packages")
-                          [ pillow pyopengl pygame setuptools ])} \
-         --prefix LIBRARY_PATH ":" "${lib.makeLibraryPath [ mesa freeglut SDL ]}"
+         --prefix PATH ":" "${ghostscript}/bin:${pdftk}/bin"
     '';
 
     meta = {
@@ -73,7 +62,7 @@ in stdenv.mkDerivation {
 
       license = stdenv.lib.licenses.gpl2;
 
-      maintainers = [ ];
+      maintainers = with lib.maintainers; [ lheckemann ];
       platforms = stdenv.lib.platforms.mesaPlatforms;
     };
   }