@@ -1,51 +1,42 @@
1−{ stdenv, fetchurl, jdk, jre, ant, coreutils, gnugrep }:
1+{ stdenv, fetchurl, jdk, jre, ant }:
22
3−stdenv.mkDerivation {
4− name = "freemind-0.9.0";
3+stdenv.mkDerivation rec {
4+ name = "freemind-${version}";
5+ version = "1.0.1";
56
67 src = fetchurl {
7− url = mirror://sourceforge/freemind/freemind-src-0.9.0.tar.gz;
8− sha256 = "1qd535gwx00d8z56mplxli5529yds2gsmbgla5b0bhhmsdwmrxmf";
8+ url = "mirror://sourceforge/freemind/freemind-src-${version}.tar.gz";
9+ sha256 = "06c6pm7hpwh9hbmyah3lj2wp1g957x8znfwc5cwygsi7dc98b0h1";
910 };
1011
1112 buildInputs = [ jdk ant ];
1213
13− phases = "unpackPhase patchPhase buildPhase installPhase";
14+ preConfigure = ''
15+ chmod +x check_for_duplicate_resources.sh
16+ sed 's,/bin/bash,${stdenv.shell},' -i check_for_duplicate_resources.sh
1417
15− patchPhase = ''
16− # There is a complain about this. I don't understand it.
17− mkdir plugins/plugins
18+ ## work around javac encoding errors
19+ export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
1820 '';
1921
20− buildPhase="ant dist";
21−
22− # LIBXCB_ALLOW_SLOPPY_LOCK=true :
23− # don't know yet what this option really means but I'm no longer getting
24− # Checking Java Version...
25− # Locking assertion failure. Backtrace:
26− # java: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed
27− # this way
28− # reference and more info https://bugs.launchpad.net/ubuntu/+source/sun-java5/+bug/86103
29− # JDK 7 beta seems to have fixed this (bug ?)
22+ buildPhase = "ant dist";
3023
3124 installPhase = ''
3225 mkdir -p $out/{bin,nix-support}
3326 cp -r ../bin/dist $out/nix-support
3427 sed -i 's/which/type -p/' $out/nix-support/dist/freemind.sh
35− cat > $out/bin/freemind << EOF
36− #!/bin/sh
37− export PATH=${coreutils}/bin:${gnugrep}/bin:"$PATH"
38− export JAVA_HOME="${jre}"
39− export LIBXCB_ALLOW_SLOPPY_LOCK=true
40− $out/nix-support/dist/freemind.sh
41− EOF
4228
29+ cat >$out/bin/freemind <<EOF
30+ #! /bin/sh
31+ JAVA_HOME=${jre} $out/nix-support/dist/freemind.sh
32+ EOF
4333 chmod +x $out/{bin/freemind,nix-support/dist/freemind.sh}
4434 '';
4535
46− meta = {
36+ meta = with stdenv.lib; {
4737 description = "Mind-mapping software";
4838 homepage = http://freemind.sourceforge.net/wiki/index.php/Main_Page;
49− license = "GPL";
50− };
39+ license = licenses.gpl2Plus;
40+ platforms = platforms.linux;
41+ };
5142}