@@ -1,35 +1,36 @@
1−{ stdenv, fetchurl, perl, libX11, libjpeg, libpng, libtiff, pkgconfig,
2−librsvg, glib, gtk2, libXext, libXxf86vm, poppler, xineLib }:
1+{ stdenv, fetchurl, perl, libX11, libXinerama, libjpeg, libpng, libtiff, pkgconfig,
2+librsvg, glib, gtk2, libXext, libXxf86vm, poppler, xineLib, ghostscript, makeWrapper }:
33
44stdenv.mkDerivation rec {
5− name = "eaglemode-0.86.0";
5+ name = "eaglemode-${version}";
6+ version = "0.94.0";
67
78 src = fetchurl {
89 url = "mirror://sourceforge/eaglemode/${name}.tar.bz2";
9− sha256 = "1a2hzyck95g740qg4p4wd4fjwsmlknh75i9sbx5r5v9pyr4i3m4f";
10+ sha256 = "1sr3bd9y9j2svqvdwhrak29yy9cxf92w9vq2cim7a8hzwi9qfy9k";
1011 };
1112
1213 nativeBuildInputs = [ pkgconfig ];
13− buildInputs = [ perl libX11 libjpeg libpng libtiff
14− librsvg glib gtk2 libXxf86vm libXext poppler xineLib ];
14+ buildInputs = [ perl libX11 libXinerama libjpeg libpng libtiff
15+ librsvg glib gtk2 libXxf86vm libXext poppler xineLib ghostscript makeWrapper ];
1516
16− # The program tries to dlopen both Xxf86vm and Xext, so we use the
17+ # The program tries to dlopen Xxf86vm, Xext and Xinerama, so we use the
1718 # trick on NIX_LDFLAGS and dontPatchELF to make it find them.
1819 # I use 'yes y' to skip a build error linking with xineLib,
1920 # because xine stopped exporting "_x_vo_new_port"
2021 # https://sourceforge.net/projects/eaglemode/forums/forum/808824/topic/5115261
2122 buildPhase = ''
22− export NIX_LDFLAGS="$NIX_LDFLAGS -lXxf86vm -lXext"
23+ export NIX_LDFLAGS="$NIX_LDFLAGS -lXxf86vm -lXext -lXinerama"
2324 perl make.pl build
2425 '';
2526
2627 dontPatchELF = true;
28+ # eaglemode expects doc to be in the root directory
29+ forceShare = [ "man" "info" ];
2730
2831 installPhase = ''
2932 perl make.pl install dir=$out
30− # I don't like this... but it seems the way they plan to run it by now.
31− # Run 'eaglemode.sh', not 'eaglemode'.
32− ln -s $out/eaglemode.sh $out/bin/eaglemode.sh
33+ wrapProgram $out/bin/eaglemode --set EM_DIR "$out" --prefix LD_LIBRARY_PATH : "$out/lib" --prefix PATH : "${ghostscript}/bin"
3334 '';
3435
3536 meta = with stdenv.lib; {
@@ -38,6 +39,5 @@ stdenv.mkDerivation rec {
3839 license = licenses.gpl3;
3940 maintainers = with maintainers; [ ];
4041 platforms = platforms.linux;
41− broken = true;
4242 };
4343}