on iko/ghcjs-patch-master help sign in
Respect the nonReinstallablePackages
d75fb33Moritz Angermann
builder/comp-builder.nix+10−1
@@ -49,10 +49,19 @@ let
49 "extra-framework-dirs" = map (p: "${p}/Library/Frameworks") component.frameworks;
49 "extra-framework-dirs" = map (p: "${p}/Library/Frameworks") component.frameworks;
50 })}
50 })}
51
51
52+ # Copy over the nonReinstallablePkgs from the global package db.
53+ # Note: we need to use --global-package-db with ghc-pkg to prevent it
54+ # from looking into the implicit global package db when registering the package.
55+ ${lib.concatMapStringsSep "\n" (p: ''
56+ ${ghc.targetPrefix}ghc-pkg describe ${p} | ${ghc.targetPrefix}ghc-pkg --force --global-package-db $out/package.conf.d register - || true
57+ '') nonReinstallablePkgs}
58+
52 ${lib.concatMapStringsSep "\n" (p: ''
59 ${lib.concatMapStringsSep "\n" (p: ''
53 ${ghc.targetPrefix}ghc-pkg --package-db ${p}/package.conf.d dump | ${ghc.targetPrefix}ghc-pkg --force --package-db $out/package.conf.d register -
60 ${ghc.targetPrefix}ghc-pkg --package-db ${p}/package.conf.d dump | ${ghc.targetPrefix}ghc-pkg --force --package-db $out/package.conf.d register -
54 '') flatDepends}
61 '') flatDepends}
62+
63+ # Note: we pass `clear` first to ensure that we never consult the implicit global package db.
55− ${flagsAndConfig "package-db" ["$out/package.conf.d"]}
64+ ${flagsAndConfig "package-db" ["clear" "$out/package.conf.d"]}
56
65
57 echo ${lib.concatStringsSep " " (lib.mapAttrsToList (fname: val: "--flags=${lib.optionalString (!val) "-" + fname}") flags)} >> $out/configure-flags
66 echo ${lib.concatStringsSep " " (lib.mapAttrsToList (fname: val: "--flags=${lib.optionalString (!val) "-" + fname}") flags)} >> $out/configure-flags
58
67