cmake hooks changed

svn path=/nixpkgs/trunk/; revision=9349
This commit is contained in:
Yury G. Kudryashov 2007-09-20 19:27:55 +00:00
parent ad5847f250
commit b6b6888765
3 changed files with 15 additions and 25 deletions

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl}:
args: with args;
stdenv.mkDerivation {
name = "cmake-2.4.7";
setupHook = ./setup-hook.sh;
@ -8,15 +8,11 @@ stdenv.mkDerivation {
sha256 = "0mkx23s7zq48hzzzw3vbzsfzfz3rjsiwgf3i00xawcxrjjrgxm9g";
};
buildInputs = [];
propagatedBuildInputs = [replace];
preConfigure="find Modules -type f -name '*.cmake' |
xargs sed -e 's@/usr@/FOO@g' -e 's@ /\\(bin\\|sbin\\|lib\\)@ /FOO@g' -i";
postUnpack = "source \${setupHook}; fixCmakeFiles \${sourceRoot}";
postInstall="find \$out/share -type f -name '*.cmake' |
xargs sed -e 's@/usr@/FOO@g' -e 's@ /\\(bin\\|sbin\\|lib\\)@ /FOO@g' -i;
ensureDir \$out/nix-support;
cp -p $setupHook \$out/nix-support/setup-hook";
postInstall="fixCmakeFiles \$out/share";
meta = {
description = "Cross-Platform Makefile Generator";

View file

@ -12,17 +12,13 @@ addCMakeParamsLibs()
fi
}
fixCmake()
{
echo "fixing Cmake file $i"
sed -e 's@/usr@/FOO@g' -e 's@ /\(bin\|sbin\|lib\)@ /FOO@g' -i $i
}
fixCmakeFiles()
{
for i in $(find $1 -type f -name "*.cmake"); do
fixCmake $i;
done;
local replaceArgs;
echo "Fixing cmake files"
replaceArgs="-e -f -L -T /usr /FOO"
replaceArgs="${replaceArgs} -a NO_DEFAULT_PATH \"\" -a NO_SYSTEM_PATH \"\""
find $1 -type f -name "*.cmake" | xargs replace ${replaceArgs}
}
cmakePostUnpack()
@ -34,21 +30,19 @@ cmakePostUnpack()
if [ -z "$dontFixCmake" ]; then
fixCmakeFiles .
fi
}
cmakeTweaks()
{
postUnpack="cmakePostUnpack${postUnpack:+; }${postUnpack}"
if [ -z "$configureScript" ]; then
dontAddPrefix=1
configureScript="cmake .."
fi
if [ -z "$dontAddPrefix" ]; then
dontAddPrefix=1
configureFlags="-DCMAKE_INSTALL_PREFIX=$out $configureFlags"
fi
}
if [ -z "$noCmakeTewaks" ]; then
cmakeTweaks
postUnpack="cmakePostUnpack${postUnpack:+; }${postUnpack}"
fi;
envHooks=(${envHooks[@]} addCMakeParamsInclude addCMakeParamsLibs)

View file

@ -1190,7 +1190,7 @@ rec {
};
cmake = import ../development/tools/build-managers/cmake {
inherit fetchurl stdenv;
inherit fetchurl stdenv replace;
};
elfutils = import ../development/tools/misc/elfutils {