summary refs log tree commit diff
path: root/pkgs/tools/text/dos2unix/default.nix
blob: 59fb08aad5f0838d1bf1ba5d4878e998ecd9c400 (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
{stdenv, fetchurl}:

stdenv.mkDerivation {
  name = "dos2unix-2.2";
  
  src = fetchurl {
    url = http://cvs.fedoraproject.org/repo/pkgs/dos2unix/dos2unix-3.1.tar.bz2/f90026a397cf787083ec2e4892c6dcdd/dos2unix-3.1.tar.bz2;
    md5 = "f90026a397cf787083ec2e4892c6dcdd";
  };
  
  patches = [
    ./dos2unix-3.1.patch
    ./dos2unix-3.1-segfault.patch
    ./dos2unix-3.1-safeconv.patch
    ./dos2unix-3.1-manpage-update-57507.patch
    ./dos2unix-3.1-preserve-file-modes.patch
    ./dos2unix-3.1-tmppath.patch
    ./dos2unix-c-missing-arg.patch
    ./dos2unix-missing-proto.patch
    ./dos2unix-manpage.patch
    ./dos2unix-preserve-file-modes.patch
  ];

  installPhase = ''
    ensureDir $out/bin
    ensureDir $out/share/man/man1
    install -p -m755 dos2unix $out/bin
    install  -p -m644 dos2unix.1 $out/share/man/man1
    ln -s dos2unix $out/bin/mac2unix
  '';

  buildPhase = ''
    rm -f dos2unix
    make dos2unix
  '';

  meta = {
    homepage = http://unknown/;
    description = "dos2unix tool";
  };
}