Actually build (a newer version of) unifdef from source, so we can use it on non-linux platforms
This commit is contained in:
parent
e32950d11a
commit
f43c324cee
@ -1,24 +1,27 @@
|
|||||||
{ fetchurl, stdenv }:
|
{ fetchurl, stdenv }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation rec {
|
||||||
name = "unifdef-1.0";
|
name = "unifdef-2.6";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://www.cs.cmu.edu/~ajw/public/dist/unifdef-1.0.tar.gz;
|
url = "https://github.com/fanf2/unifdef/archive/${name}.tar.gz";
|
||||||
sha256 = "1bcxq7qgf6r98m6l277fx6s0gn9sr4vn7f3s0r5mwx79waqk0k6i";
|
sha256 = "1p5wr5ms9w8kijy9h7qs1mz36dlavdj6ngz2bks588w7a20kcqxj";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildPhase = ''
|
postUnpack = ''
|
||||||
make unifdef
|
substituteInPlace $sourceRoot/unifdef.c \
|
||||||
|
--replace '#include "version.h"' ""
|
||||||
|
|
||||||
|
substituteInPlace $sourceRoot/Makefile \
|
||||||
|
--replace "unifdef.c: version.h" "unifdef.c:"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
preBuild = ''
|
||||||
mkdir -p $out/bin
|
unset HOME
|
||||||
cp unifdef $out/bin
|
export DESTDIR=$out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "useful for removing #ifdef'ed lines from a file while otherwise leaving the file alone";
|
description = "Selectively remove C preprocessor conditionals";
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user