From 2e7b2f8c4370e8b66001441ddab056408577dc62 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 23 Nov 2007 16:58:42 +0000 Subject: [PATCH] * Nix 0.10 compatibility. svn path=/nixpkgs/trunk/; revision=9782 --- pkgs/development/compilers/ghcs/default.nix | 6 ++-- pkgs/top-level/all-packages.nix | 39 ++++++++++++--------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/pkgs/development/compilers/ghcs/default.nix b/pkgs/development/compilers/ghcs/default.nix index c3a46968880..c026a860d40 100644 --- a/pkgs/development/compilers/ghcs/default.nix +++ b/pkgs/development/compilers/ghcs/default.nix @@ -43,14 +43,14 @@ # used to automatically get dependencies ( used for core_libs ) # TODO use kind of state and evaluate deps of a dep only once resolveDeps = ghc : libs : - let attrs = __listToAttrs libs; in + let attrs = builtins.listToAttrs libs; in rec { # using undocumented feature that attribute can contain hyphens when using listToAttrs # 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 ("lib/ghc-${ghc.version}/${l.name}.conf") - (map (n: __getAttr n result) l.deps) + (map (n: builtins.getAttr n result) l.deps) ) ) libs ); }.result; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ad326c6cbc1..8b4a84aa689 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -196,10 +196,13 @@ rec { meta = (if drv ? meta then drv.meta else {}) // {priority = "10";}; }; - mkDerivationByConfiguration = { flagConfig ? {}, optionals ? [], defaults ? [], - extraAttrs, collectExtraPhaseActions ? []} : + mkDerivationByConfiguration = + assert builtins ? isAttrs; + { flagConfig ? {}, optionals ? [], defaults ? [] + , extraAttrs, collectExtraPhaseActions ? [] + }: 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 let co = chooseOptionsByFlags { inherit args flagConfig optionals defaults collectExtraPhaseActions; }; in args.stdenv.mkDerivation ( @@ -944,12 +947,14 @@ rec { { ghcPkgUtil = ../development/libraries/haskell/generic/ghcPkgUtil.sh; } "mkdir -p $out/nix-support; cp $ghcPkgUtil \$out/nix-support/setup-hook;"; - ghcsAndLibs = recurseIntoAttrs (import ../development/compilers/ghcs { + ghcsAndLibs = + assert builtins ? listToAttrs; + recurseIntoAttrs (import ../development/compilers/ghcs { inherit ghcboot fetchurl recurseIntoAttrs perl gnum4 gmp readline; inherit ghcPkgUtil; stdenv = stdenvUsingSetupNew2; lib = lib_unstable; - }); + }); # creates ghc-X-wl wich adds the passed libraries to the env var GHC_PACKAGE_PATH createGhcWrapper = { ghcPackagedLibs ? false, ghc, libraries, name, suffix ? "ghc_wrapper_${ghc.name}" } : @@ -1192,23 +1197,23 @@ rec { perl = if !stdenv.isLinux then sysPerl else realPerl; # FIXME: unixODBC needs patching on Darwin (see darwinports) - #php = import ../development/interpreters/php { - #inherit stdenv fetchurl flex bison libxml2 apacheHttpd; - #unixODBC = - #if stdenv.isDarwin then null else unixODBC; - #}; + phpOld = import ../development/interpreters/php { + inherit stdenv fetchurl flex bison libxml2 apacheHttpd; + 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 # tell the apache module where to look for this file is using a compile time flag ;-( # perhaps this can be done setting php_value in apache don't have time to investigate any further ? # This expression is a quick hack now. But perhaps it helps you adding the configuration flags you need? - php = (import ../development/interpreters/php_configurable) { - inherit mkDerivationByConfiguration; - lib = lib_unstable; - stdenv = stdenvUsingSetupNew2; - inherit fetchurl flex bison apacheHttpd; # gettext; - mysql = mysql5; - inherit libxml2; + php = import ../development/interpreters/php_configurable { + inherit mkDerivationByConfiguration; + lib = lib_unstable; + stdenv = stdenvUsingSetupNew2; + inherit fetchurl flex bison apacheHttpd; # gettext; + mysql = mysql5; + inherit libxml2; }; python = getVersion "python" python_alts;