summary refs log tree commit diff
path: root/pkgs/os-specific/linux/blcr/0.8.2.nix
blob: d5d715c223c873c4f3d0b7120ee97f5c50407b4e (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ stdenv, fetchurl, kernel, perl, makeWrapper, autoconf, automake, libtool }:

assert stdenv.isLinux;

let
  version = "0.8.2";
  website = https://ftg.lbl.gov/CheckpointRestart;
in

stdenv.mkDerivation {
  name = "blcr-${version}-${kernel.version}";

  src = fetchurl {
    url = "${website}/downloads/blcr-${version}.tar.gz";
    sha256 = "1ldvzrajljkm318z5ix1p27n0gmv7gqxij6ck7p5fz4ncdbb01x8";
  };

  patches = [ ./fixes.patch ];

  buildInputs = [ perl makeWrapper autoconf automake libtool ];

  # this gives "configure: error: unrecognized option: `-d'"
  /*
  configureFlags = [
    "--with-linux=$(ls -d ${kernel}/lib/modules/ * /build)"
    "--with-kmod-dir=$out/lib/modules/$(cd ${kernel}/lib/modules; ls -d 2.6.*)" 
    "--with-system-map=${kernel}/System.map"
  ];
  */

  configurePhase = ''
    autoreconf
    ./configure --prefix=$out \
    --with-linux=$(ls -d ${kernel}/lib/modules/*/build) \
    --with-kmod-dir=$out/lib/modules/$(cd ${kernel}/lib/modules; ls -d 2.6.*) \
    --with-system-map=${kernel}/System.map
  '';

  postInstall = ''
    for prog in "$out/bin/"*
    do
      wrapProgram "$prog" --prefix LD_LIBRARY_PATH ":" "$out/lib"
    done
  '';
      
  meta = {
    description = "Berkeley Lab Checkpoint/Restart for Linux (BLCR)";
    homepage = website;
    license = "GPL2";
  };
}