1{ fetchurl, stdenv }:
2
3stdenv.mkDerivation rec {
4 name = "unifdef-2.6";
5
6 src = fetchurl {
7 url = "https://github.com/fanf2/unifdef/archive/${name}.tar.gz";
8 sha256 = "1p5wr5ms9w8kijy9h7qs1mz36dlavdj6ngz2bks588w7a20kcqxj";
9 };
10
11 postUnpack = ''
12 substituteInPlace $sourceRoot/unifdef.c \
13 --replace '#include "version.h"' ""
14
15 substituteInPlace $sourceRoot/Makefile \
16 --replace "unifdef.c: version.h" "unifdef.c:"
17 '';
18
19 preBuild = ''
20 unset HOME
21 export DESTDIR=$out
22 '';
23
24 meta = {
25 description = "Selectively remove C preprocessor conditionals";
26 };
27}