summary refs log tree commit diff
path: root/pkgs/applications/science/programming/plm/default.nix
blob: 0e35a0b2264c461e238b39457cf97fe5c197dea1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{stdenv, fetchurl, makeWrapper, jre, gcc, valgrind}:
# gcc and valgrind are not strict dependencies, they could be made
# optional. They are here because plm can only help you learn C if you
# have them installed.
stdenv.mkDerivation rec {
  major = "2";
  minor = "5";
  version = "${major}-${minor}";
  name = "plm-${version}";

  src = fetchurl {
    url = "http://webloria.loria.fr/~quinson/Teaching/PLM/plm-${major}_${minor}.jar";
    sha256 = "0m17cxa3nxi2cbswqvlfzp0mlfi3wrkw8ry2xhkxy6aqzm2mlgcc";
    name = "${name}.jar";
  };

  buildInputs = [ makeWrapper jre gcc valgrind ];

  phases = [ "installPhase" ];

  installPhase = ''
    mkdir -p "$prefix/bin"

    makeWrapper ${jre}/bin/java $out/bin/plm \
      --add-flags "-jar $src" \
      --prefix PATH : "$PATH"
  '';

  meta = with stdenv.lib; {
    description = "Free cross-platform programming exerciser";
    Homepage = http://webloria.loria.fr/~quinson/Teaching/PLM/;
    license = licenses.gpl3;
    maintainers = [ maintainers.DamienCassou ];
    platforms = stdenv.lib.platforms.all;
  };
}