tup: add setupHook
This commit is contained in:
parent
896959cf66
commit
3065ab3a92
@ -37,6 +37,8 @@ stdenv.mkDerivation rec {
|
|||||||
cp tup.1 $out/share/man/man1/
|
cp tup.1 $out/share/man/man1/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
setupHook = ./tup/setup-hook.sh;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "A fast, file-based build system";
|
description = "A fast, file-based build system";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
|
44
pkgs/development/tools/build-managers/tup/setup-hook.sh
Normal file
44
pkgs/development/tools/build-managers/tup/setup-hook.sh
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
tupConfigurePhase() {
|
||||||
|
runHook preConfigure
|
||||||
|
|
||||||
|
echo -n CONFIG_TUP_ARCH= >> tup.config
|
||||||
|
case "$system" in
|
||||||
|
"i686-*") echo i386 >> tup.config;;
|
||||||
|
"x86_64-*") echo x86_64 >> tup.config;;
|
||||||
|
"powerpc-*") echo powerpc >> tup.config;;
|
||||||
|
"powerpc64-*") echo powerpc64 >> tup.config;;
|
||||||
|
"ia64-*") echo ia64 >> tup.config;;
|
||||||
|
"alpha-*") echo alpha >> tup.config;;
|
||||||
|
"sparc-*") echo sparc >> tup.config;;
|
||||||
|
"aarch64-*") echo arm64 >> tup.config;;
|
||||||
|
"arm*") echo arm >> tup.config;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "${tupConfig-}" >> tup.config
|
||||||
|
|
||||||
|
tup init
|
||||||
|
tup generate tupBuild.sh
|
||||||
|
|
||||||
|
runHook postConfigure
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z "${dontUseTupConfigure-}" -a -z "${configurePhase-}" ]; then
|
||||||
|
configurePhase=tupConfigurePhase
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
tupBuildPhase() {
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
pushd .
|
||||||
|
. tupBuild.sh
|
||||||
|
popd
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z "${dontUseTupBuild-}" -a -z "${buildPhase-}" ]; then
|
||||||
|
buildPhase=tupBuildPhase
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user