about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/e2fsprogs/default.nix
blob: c116b74a8103f422f444ca8dfb7d5e49ca258be1 (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
{stdenv, fetchurl}:

stdenv.mkDerivation {
  name = "e2fsprogs-1.41.3";
  
  src = fetchurl {
    url = mirror://sourceforge/e2fsprogs/e2fsprogs-1.41.3.tar.gz;
    sha256 = "0yldax5z1d1gfxpvzmr8y2z5zg5xhbi9pjjy4yw0q28dd2pfsxyf";
  };
  
  configureFlags =
    if stdenv ? isDietLibC
    then "--with-diet-libc"
    else "--enable-elf-shlibs";

  preBuild = if stdenv ? isDietLibC then ''
    sed -e 's/-lpthread//' -i Makefile */Makefile */*/Makefile
  '' else "";
    
  preInstall = "installFlagsArray=('LN=ln -s')";
  
  postInstall = "make install-libs";
  
  NIX_CFLAGS_COMPILE =
    if stdenv ? isDietLibC then
      "-UHAVE_SYS_PRCTL_H " +
      (if stdenv.system == "x86_64-linux" then "-DHAVE_LSEEK64_PROTOTYPE=1 -Dstat64=stat" else "")
      + " -lcompat -lpthread "
    else "";

  meta = {
    homepage = http://e2fsprogs.sourceforge.net/;
    description = "Tools for creating and checking ext2/ext3/ext4 filesystems";
  };
}