@@ -3,6 +3,7 @@
33, fetchurl
44, xlibsWrapper
55, makeWrapper
6+, imagemagick
67, libXpm
78, libXmu
89, libXi
@@ -21,7 +22,7 @@ stdenv.mkDerivation rec {
2122 sha256 = "0fndgbm1mkqb1sn2v2kj3nx9mxj70jbp31y2bjvzcmmkry0q3k5j";
2223 };
2324
24− nativeBuildInputs = [ makeWrapper ];
25+ nativeBuildInputs = [ imagemagick makeWrapper ];
2526
2627 buildInputs = [
2728 xlibsWrapper
@@ -34,7 +35,8 @@ stdenv.mkDerivation rec {
3435 ];
3536
3637 postPatch = ''
37− sed -i 's:"fig2dev":"${fig2dev}/bin/fig2dev":' src/main.c
38+ substituteInPlace src/main.c --replace '"fig2dev"' '"${fig2dev}/bin/fig2dev"'
39+ substituteInPlace xfig.desktop --replace "/usr/bin/" "$out/bin/"
3840 '';
3941
4042 postInstall = ''
@@ -43,6 +45,15 @@ stdenv.mkDerivation rec {
4345
4446 wrapProgram $out/bin/xfig \
4547 --set XAPPLRESDIR $out/share/X11/app-defaults
48+
49+ mkdir -p $out/share/icons/hicolor/{16x16,22x22,48x48,64x64}/apps
50+
51+ for dimension in 16x16 22x22 48x48; do
52+ convert doc/html/images/xfig-logo.png -geometry $dimension\
53+ $out/share/icons/hicolor/16x16/apps/xfig.png
54+ done
55+ install doc/html/images/xfig-logo.png \
56+ $out/share/icons/hicolor/64x64/apps/xfig.png
4657 '';
4758
4859 enableParallelBuilding = true;