@@ -242,6 +242,9 @@ stdenv.mkDerivation ({
242 # Note 2: if a package contains multiple libs (lib + sublibs) SETUP register will generate a
242 # Note 2: if a package contains multiple libs (lib + sublibs) SETUP register will generate a
243 # folder isntead of a file for the configuration. Therfore if the result is a folder,
243 # folder isntead of a file for the configuration. Therfore if the result is a folder,
244 # we need to register each and every element of that folder.
244 # we need to register each and every element of that folder.
246+ # Note 3: if a package has no libs SETUP will not generate anything. This can
247+ # happen when building the `all` component of a package.
245 installPhase = ''
248 installPhase = ''
246 runHook preInstall
249 runHook preInstall
247 $SETUP_HS copy ${lib.concatStringsSep " " component.setupInstallFlags}
250 $SETUP_HS copy ${lib.concatStringsSep " " component.setupInstallFlags}
@@ -252,7 +255,7 @@ stdenv.mkDerivation ({
252 for pkg in ${name}.conf/*; do
255 for pkg in ${name}.conf/*; do
253 ${ghc.targetPrefix}ghc-pkg -v0 --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register "$pkg"
256 ${ghc.targetPrefix}ghc-pkg -v0 --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register "$pkg"
255− else
258+ elif [ -e "${name}.conf" ]; then
256 ${ghc.targetPrefix}ghc-pkg -v0 --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf
259 ${ghc.targetPrefix}ghc-pkg -v0 --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf