@@ -1,9 +1,11 @@
6with stdenv.lib;
7with stdenv.lib;
9 pkgSet = haskell.mkPkgSet {
11 pkgSet = haskell.mkPkgSet {
@@ -34,22 +36,32 @@ let
35 packages = pkgSet.config.hsPkgs;
37 packages = pkgSet.config.hsPkgs;
37− # Add cabal as a buildInput for a haskell derivation. Useful for nix-shell.
39+ package = packages.test-with-packages;
38− addCabalInstall = drv: drv.overrideAttrs (oldAttrs: {
40+ inherit (package.components) library;
39− buildInputs = (oldAttrs.buildInputs or []) ++ [ pkgs.cabal-install ];
41+
40− });
42+ pkgId = p: "${p.identifier.name}-${p.identifier.version}";
43+ showDepends = component: concatMapStringsSep " " pkgId component.depends;
43 stdenv.mkDerivation {
46 stdenv.mkDerivation {
44 name = "with-packages-test";
47 name = "with-packages-test";
48+ libraryDepends = showDepends pkgSet.config.packages.test-with-packages.components.library;
49+ allDepends = showDepends pkgSet.config.packages.test-with-packages.components.all;
46− buildCommand = let
51+ buildCommand = ''
47− package = packages.test-with-packages;
48− inherit (package.components) library;
50 ########################################################################
52 ########################################################################
51 # test with-packages
53 # test with-packages
55+ printf "checking merging of the 'all' component depends ... " >& 2
56+ if [ -n "$libraryDepends" -a "$libraryDepends" = "$allDepends" ]; then
60+ echo "libraryDepends = $libraryDepends"
61+ echo "allDepends = $allDepends"
53 printf "checking that the 'all' component works... " >& 2
65 printf "checking that the 'all' component works... " >& 2
54 echo ${package.components.all} >& 2
66 echo ${package.components.all} >& 2
@@ -62,7 +74,7 @@ in
63 printf "checking that components.library.env has the dependencies... " >& 2
75 printf "checking that components.library.env has the dependencies... " >& 2
64 ${library.env}/bin/runghc ${./Point.hs}
76 ${library.env}/bin/runghc ${./Point.hs}
65− # echo >& 2
77+ echo >& 2
67 touch $out
79 touch $out