on iko/ghcjs-patch-master help sign in
GHC-PKG shut up!
ed45659Moritz Angermann
builder/comp-builder.nix+9−9
@@ -44,10 +44,10 @@ let
44 in map ({val,...}: val) closure;
44 in map ({val,...}: val) closure;
45
45
46 exactDep = pdbArg: p: ''
46 exactDep = pdbArg: p: ''
47− if id=$(${ghc.targetPrefix}ghc-pkg ${pdbArg} field ${p} id --simple-output); then
47+ if id=$(${ghc.targetPrefix}ghc-pkg -v0 ${pdbArg} field ${p} id --simple-output); then
48 echo "--dependency=${p}=$id" >> $out/configure-flags
48 echo "--dependency=${p}=$id" >> $out/configure-flags
49 fi
49 fi
50− if ver=$(${ghc.targetPrefix}ghc-pkg ${pdbArg} field ${p} version --simple-output); then
50+ if ver=$(${ghc.targetPrefix}ghc-pkg -v0 ${pdbArg} field ${p} version --simple-output); then
51 echo "constraint: ${p} == $ver" >> $out/cabal.config
51 echo "constraint: ${p} == $ver" >> $out/cabal.config
52 echo "constraint: ${p} installed" >> $out/cabal.config
52 echo "constraint: ${p} installed" >> $out/cabal.config
53 fi
53 fi
@@ -55,7 +55,7 @@ let
55
55
56 configFiles = runCommand "${fullName}-config" { nativeBuildInputs = [ghc]; } (''
56 configFiles = runCommand "${fullName}-config" { nativeBuildInputs = [ghc]; } (''
57 mkdir -p $out
57 mkdir -p $out
58− ${ghc.targetPrefix}ghc-pkg init $out/package.conf.d
58+ ${ghc.targetPrefix}ghc-pkg -v0 init $out/package.conf.d
59
59
60 ${lib.concatStringsSep "\n" (lib.mapAttrsToList flagsAndConfig {
60 ${lib.concatStringsSep "\n" (lib.mapAttrsToList flagsAndConfig {
61 "extra-lib-dirs" = map (p: "${lib.getLib p}/lib") component.libs;
61 "extra-lib-dirs" = map (p: "${lib.getLib p}/lib") component.libs;
@@ -67,11 +67,11 @@ let
67 # Note: we need to use --global-package-db with ghc-pkg to prevent it
67 # Note: we need to use --global-package-db with ghc-pkg to prevent it
68 # from looking into the implicit global package db when registering the package.
68 # from looking into the implicit global package db when registering the package.
69 ${lib.concatMapStringsSep "\n" (p: ''
69 ${lib.concatMapStringsSep "\n" (p: ''
70− ${ghc.targetPrefix}ghc-pkg describe ${p} | ${ghc.targetPrefix}ghc-pkg --force --global-package-db $out/package.conf.d register - || true
70+ ${ghc.targetPrefix}ghc-pkg -v0 describe ${p} | ${ghc.targetPrefix}ghc-pkg -v0 --force --global-package-db $out/package.conf.d register - || true
71 '') nonReinstallablePkgs}
71 '') nonReinstallablePkgs}
72
72
73 ${lib.concatMapStringsSep "\n" (p: ''
73 ${lib.concatMapStringsSep "\n" (p: ''
74− ${ghc.targetPrefix}ghc-pkg --package-db ${p}/package.conf.d dump | ${ghc.targetPrefix}ghc-pkg --force --package-db $out/package.conf.d register -
74+ ${ghc.targetPrefix}ghc-pkg -v0 --package-db ${p}/package.conf.d dump | ${ghc.targetPrefix}ghc-pkg -v0 --force --package-db $out/package.conf.d register -
75 '') flatDepends}
75 '') flatDepends}
76
76
77 # Note: we pass `clear` first to ensure that we never consult the implicit global package db.
77 # Note: we pass `clear` first to ensure that we never consult the implicit global package db.
@@ -115,9 +115,9 @@ let
115 sed -i "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f
115 sed -i "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f
116 done
116 done
117 '' + ''
117 '' + ''
118− ${ghc.targetPrefix}ghc-pkg --package-db $out/package.conf.d recache
118+ ${ghc.targetPrefix}ghc-pkg -v0 --package-db $out/package.conf.d recache
119 '' + ''
119 '' + ''
120− ${ghc.targetPrefix}ghc-pkg --package-db $out/package.conf.d check
120+ ${ghc.targetPrefix}ghc-pkg -v0 --package-db $out/package.conf.d check
121 '');
121 '');
122
122
123 finalConfigureFlags = lib.concatStringsSep " " (
123 finalConfigureFlags = lib.concatStringsSep " " (
@@ -215,8 +215,8 @@ in stdenv.mkDerivation ({
215 $SETUP_HS copy ${lib.concatStringsSep " " component.setupInstallFlags}
215 $SETUP_HS copy ${lib.concatStringsSep " " component.setupInstallFlags}
216 ${lib.optionalString (haskellLib.isLibrary componentId) ''
216 ${lib.optionalString (haskellLib.isLibrary componentId) ''
217 $SETUP_HS register --gen-pkg-config=${name}.conf
217 $SETUP_HS register --gen-pkg-config=${name}.conf
218− ${ghc.targetPrefix}ghc-pkg init $out/package.conf.d
218+ ${ghc.targetPrefix}ghc-pkg -v0 init $out/package.conf.d
219− ${ghc.targetPrefix}ghc-pkg --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf
219+ ${ghc.targetPrefix}ghc-pkg -v0 --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf
220 ''}
220 ''}
221 ${lib.optionalString (componentId.ctype == "test") ''
221 ${lib.optionalString (componentId.ctype == "test") ''
222 mkdir -p $out/${name}
222 mkdir -p $out/${name}