summary refs log tree commit diff
path: root/pkgs/development/tools/misc/unifdef/default.nix
blob: 19dd907b73b98efb5296297ff8fba324225dd348 (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
{ fetchurl, stdenv }:

stdenv.mkDerivation rec {
  name = "unifdef-2.6";

  src = fetchurl {
    url    = "https://github.com/fanf2/unifdef/archive/${name}.tar.gz";
    sha256 = "1p5wr5ms9w8kijy9h7qs1mz36dlavdj6ngz2bks588w7a20kcqxj";
  };

  postUnpack = ''
    substituteInPlace $sourceRoot/unifdef.c \
      --replace '#include "version.h"' ""

    substituteInPlace $sourceRoot/Makefile \
      --replace "unifdef.c: version.h" "unifdef.c:"
  '';

  preBuild = ''
    unset HOME
    export DESTDIR=$out
  '';

  meta = with stdenv.lib; {
    homepage = "http://dotat.at/prog/unifdef/";
    description = "Selectively remove C preprocessor conditionals";
    license = licenses.bsd2;
    platforms = platforms.unix;
    maintainers = [ maintainers.vrthra ];
  };
}