Trying to make busybox more configurable
svn path=/nixpkgs/branches/stdenv-updates/; revision=22846
This commit is contained in:
parent
212161482f
commit
fbad1b3a56
@ -1,12 +1,37 @@
|
|||||||
{stdenv, fetchurl, enableStatic ? false}:
|
{stdenv, fetchurl, enableStatic ? false, extraConfig ? ""}:
|
||||||
|
|
||||||
let
|
let
|
||||||
basicConfigure = ''
|
configParser = ''
|
||||||
make defconfig
|
function parseconfig {
|
||||||
sed -i 's,.*CONFIG_PREFIX.*,CONFIG_PREFIX="'$out'",' .config
|
set -x
|
||||||
sed -i 's,.*CONFIG_INSTALL_NO_USR.*,CONFIG_INSTALL_NO_USR=y,' .config
|
while read LINE; do
|
||||||
'' +
|
NAME=`cut -d \ -f 1 $LINE`
|
||||||
(if enableStatic then ''
|
OPTION=`cut -d \ -f 2 $LINE`
|
||||||
|
|
||||||
|
if test -z "$NAME"; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$NAME" == "CLEAR"; then
|
||||||
|
echo > .config
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -i /^$NAME=/d .config
|
||||||
|
|
||||||
|
if test "$OPTION" != n; then
|
||||||
|
echo "$NAME=$OPTION" >> .config
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
set +x
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
nixConfig = ''
|
||||||
|
CONFIG_PREFIX "$out"
|
||||||
|
CONFIG_INSTALL_NO_USR n
|
||||||
|
'';
|
||||||
|
|
||||||
|
staticConfig = (if enableStatic then ''
|
||||||
sed -i 's,.*CONFIG_STATIC.*,CONFIG_STATIC=y,' .config
|
sed -i 's,.*CONFIG_STATIC.*,CONFIG_STATIC=y,' .config
|
||||||
'' else "");
|
'' else "");
|
||||||
|
|
||||||
@ -20,14 +45,24 @@ stdenv.mkDerivation {
|
|||||||
sha256 = "1n738zk01yi2sjrx2y36hpzxbslas8b91vzykcifr0p1j7ym0lim";
|
sha256 = "1n738zk01yi2sjrx2y36hpzxbslas8b91vzykcifr0p1j7ym0lim";
|
||||||
};
|
};
|
||||||
|
|
||||||
configurePhase = basicConfigure;
|
configurePhase = ''
|
||||||
|
set -x
|
||||||
|
make defconfig
|
||||||
|
${configParser}
|
||||||
|
cat << EOF | parseconfig
|
||||||
|
${extraConfig}
|
||||||
|
${nixConfig}
|
||||||
|
$extraCrossConfig
|
||||||
|
EOF
|
||||||
|
set +x
|
||||||
|
'';
|
||||||
|
|
||||||
crossAttrs = {
|
crossAttrs = {
|
||||||
configurePhase = basicConfigure + ''
|
extraCrossConfig = ''
|
||||||
sed -i 's,.*CONFIG_CROSS_COMPILER_PREFIX.*,CONFIG_CROSS_COMPILER_PREFIX="'$crossConfig-'",' .config
|
CONFIG_CROSS_COMPILER_PREFIX "$crossConfig-"
|
||||||
'' +
|
'' +
|
||||||
(if (stdenv.cross.platform.kernelMajor == "2.4") then ''
|
(if (stdenv.cross.platform.kernelMajor == "2.4") then ''
|
||||||
sed -i 's,.*CONFIG_IONICE.*,CONFIG_IONICE=n,' .config
|
CONFIG_IONICE n
|
||||||
'' else "");
|
'' else "");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user