summary refs log tree commit diff
path: root/pkgs/misc/foldingathome/default.nix
blob: 1aae47e603b580cf94b1d4e4d9564b513cffa089 (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}:

stdenv.mkDerivation {
  name = "folding-at-home-6.02";

  src = fetchurl {
    url = http://www.stanford.edu/group/pandegroup/folding/release/FAH6.02-Linux.tgz;
    sha256 = "01nwi0lb4vv0xg4k04i2fbf5v5qgabl70jm5cgvw1ibgqjz03910";
  };

  unpackPhase = "tar xvzf $src";

  # Otherwise it doesn't work at all, even ldd thinks it's not a dynamic executable
  dontStrip = true;

  # This program, to run with '-smp', wants to execute the program mpiexec
  # as "./mpiexec", although it also expects to write the data files into "."
  # I suggest, if someone wants to run it, in the data directory set a link
  # to the store for 'mpiexec', so './mpiexec' will work. That link better
  # be considered a gcroot.
  installPhase = ''
    BINFILES="fah6 mpiexec";
    for a in $BINFILES; do
      patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $a
    done
    mkdir -p $out/bin
    cp $BINFILES $out/bin
  '';

  meta = {
    homepage = http://folding.stanford.edu/;
    description = "Folding@home distributed computing client";
    license = stdenv.lib.licenses.unfree;
    platforms = [ "i686-linux" ];
  };
}