* Nix 0.10 compatibility.

svn path=/nixpkgs/branches/stdenv-updates/; revision=9883
This commit is contained in:
Yury G. Kudryashov 2007-12-08 01:08:12 +00:00
parent f1f5b31c0c
commit d1cc8aafd0
2 changed files with 21 additions and 15 deletions

View File

@ -43,14 +43,14 @@
# used to automatically get dependencies ( used for core_libs ) # used to automatically get dependencies ( used for core_libs )
# TODO use kind of state and evaluate deps of a dep only once # TODO use kind of state and evaluate deps of a dep only once
resolveDeps = ghc : libs : resolveDeps = ghc : libs :
let attrs = __listToAttrs libs; in let attrs = builtins.listToAttrs libs; in
rec { rec {
# using undocumented feature that attribute can contain hyphens when using listToAttrs # using undocumented feature that attribute can contain hyphens when using listToAttrs
# You should be able to get the attribute values using __getAttr # You should be able to get the attribute values using __getAttr
result = __listToAttrs (map ( l : lib.av l.name ( result = builtins.listToAttrs (map ( l : lib.av l.name (
packageByPackageDB ghc l.name packageByPackageDB ghc l.name
("lib/ghc-${ghc.version}/${l.name}.conf") ("lib/ghc-${ghc.version}/${l.name}.conf")
(map (n: __getAttr n result) l.deps) (map (n: builtins.getAttr n result) l.deps)
) ) libs ); ) ) libs );
}.result; }.result;

View File

@ -196,10 +196,13 @@ rec {
meta = (if drv ? meta then drv.meta else {}) // {priority = "10";}; meta = (if drv ? meta then drv.meta else {}) // {priority = "10";};
}; };
mkDerivationByConfiguration = { flagConfig ? {}, optionals ? [], defaults ? [], mkDerivationByConfiguration =
extraAttrs, collectExtraPhaseActions ? []} : assert builtins ? isAttrs;
{ flagConfig ? {}, optionals ? [], defaults ? []
, extraAttrs, collectExtraPhaseActions ? []
}:
args: with args.lib; with args; args: with args.lib; with args;
if ( __isAttrs extraAttrs ) then builtins.throw "the argument extraAttrs needs to be a function beeing passed co, but attribute set passed " if ( builtins.isAttrs extraAttrs ) then builtins.throw "the argument extraAttrs needs to be a function beeing passed co, but attribute set passed "
else else
let co = chooseOptionsByFlags { inherit args flagConfig optionals defaults collectExtraPhaseActions; }; in let co = chooseOptionsByFlags { inherit args flagConfig optionals defaults collectExtraPhaseActions; }; in
args.stdenv.mkDerivation ( args.stdenv.mkDerivation (
@ -938,8 +941,10 @@ rec {
{ ghcPkgUtil = ../development/libraries/haskell/generic/ghcPkgUtil.sh; } { ghcPkgUtil = ../development/libraries/haskell/generic/ghcPkgUtil.sh; }
"mkdir -p $out/nix-support; cp $ghcPkgUtil \$out/nix-support/setup-hook;"; "mkdir -p $out/nix-support; cp $ghcPkgUtil \$out/nix-support/setup-hook;";
ghcsAndLibs = recurseIntoAttrs (import ../development/compilers/ghcs { ghcsAndLibs =
inherit ghcboot fetchurl recurseIntoAttrs perl gnum4 gmp readline stdenv; assert builtins ? listToAttrs;
recurseIntoAttrs (import ../development/compilers/ghcs {
inherit ghcboot fetchurl recurseIntoAttrs perl gnum4 gmp readline;
inherit ghcPkgUtil; inherit ghcPkgUtil;
lib = lib_unstable; lib = lib_unstable;
}); });
@ -1185,11 +1190,11 @@ rec {
perl = if !stdenv.isLinux then sysPerl else realPerl; perl = if !stdenv.isLinux then sysPerl else realPerl;
# FIXME: unixODBC needs patching on Darwin (see darwinports) # FIXME: unixODBC needs patching on Darwin (see darwinports)
#php = import ../development/interpreters/php { phpOld = import ../development/interpreters/php {
#inherit stdenv fetchurl flex bison libxml2 apacheHttpd; inherit stdenv fetchurl flex bison libxml2 apacheHttpd;
#unixODBC = unixODBC =
#if stdenv.isDarwin then null else unixODBC; if stdenv.isDarwin then null else unixODBC;
#}; };
# FIXME somehow somewhen: We need to recompile php if the ini file changes because the only way to # FIXME somehow somewhen: We need to recompile php if the ini file changes because the only way to
# tell the apache module where to look for this file is using a compile time flag ;-( # tell the apache module where to look for this file is using a compile time flag ;-(
@ -1198,7 +1203,8 @@ rec {
php = (import ../development/interpreters/php_configurable) { php = (import ../development/interpreters/php_configurable) {
inherit mkDerivationByConfiguration; inherit mkDerivationByConfiguration;
lib = lib_unstable; lib = lib_unstable;
inherit fetchurl flex bison apacheHttpd mysql; # gettext; inherit fetchurl flex bison apacheHttpd; # gettext;
mysql = mysql5;
inherit libxml2; inherit libxml2;
}; };