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 { stdenv.mkDerivation {
name = "cmake-2.4.7"; name = "cmake-2.4.7";
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
@ -8,15 +8,11 @@ stdenv.mkDerivation {
sha256 = "0mkx23s7zq48hzzzw3vbzsfzfz3rjsiwgf3i00xawcxrjjrgxm9g"; sha256 = "0mkx23s7zq48hzzzw3vbzsfzfz3rjsiwgf3i00xawcxrjjrgxm9g";
}; };
buildInputs = []; propagatedBuildInputs = [replace];
preConfigure="find Modules -type f -name '*.cmake' | postUnpack = "source \${setupHook}; fixCmakeFiles \${sourceRoot}";
xargs sed -e 's@/usr@/FOO@g' -e 's@ /\\(bin\\|sbin\\|lib\\)@ /FOO@g' -i";
postInstall="find \$out/share -type f -name '*.cmake' | postInstall="fixCmakeFiles \$out/share";
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";
meta = { meta = {
description = "Cross-Platform Makefile Generator"; description = "Cross-Platform Makefile Generator";

View File

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

View File

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