|
1 | 1 | { pkgs, stdenv, buildPackages, pkgsBuildBuild, ghc, llvmPackages, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, haddockBuilder, ghcForComponent, hsPkgs, compiler, runCommand, libffi, gmp, windows, zlib, ncurses, nodejs, nonReinstallablePkgs }@defaults: |
2 | | -lib.makeOverridable ( |
3 | | -let self = |
4 | 2 | { componentId |
5 | 3 | , component |
6 | 4 | , package |
@@ -92,7 +90,76 @@ let self = |
92 | 90 | # LLVM |
93 | 91 | , useLLVM ? ghc.useLLVM or false |
94 | 92 | , smallAddressSpace ? false |
95 | | - |
| 93 | +}: |
| 94 | +# makeOverridable is called here after all the `? DEFAULT` arguments |
| 95 | +# will have been applied. This makes sure that `c.override (oldAttrs: {...})` |
| 96 | +# includes these `DEFAULT` values in `oldAttrs`. This is important |
| 97 | +# so that overrides can modify the existing values instead of replacing them. |
| 98 | +lib.makeOverridable ( |
| 99 | +let self = |
| 100 | +{ componentId |
| 101 | +, component |
| 102 | +, package |
| 103 | +, name |
| 104 | +, setup |
| 105 | +, src |
| 106 | +, flags |
| 107 | +, cabalFile |
| 108 | +, cabal-generator |
| 109 | +, patches |
| 110 | +, preUnpack |
| 111 | +, configureFlags |
| 112 | +, prePatch |
| 113 | +, postPatch |
| 114 | +, preConfigure |
| 115 | +, postConfigure |
| 116 | +, setupBuildFlags |
| 117 | +, preBuild |
| 118 | +, postBuild |
| 119 | +, preCheck |
| 120 | +, postCheck |
| 121 | +, setupInstallFlags |
| 122 | +, preInstall |
| 123 | +, postInstall |
| 124 | +, preHaddock |
| 125 | +, postHaddock |
| 126 | +, shellHook |
| 127 | +, configureAllComponents |
| 128 | +, allComponent |
| 129 | +, build-tools |
| 130 | +, pkgconfig |
| 131 | +, platforms |
| 132 | +, frameworks |
| 133 | +, dontPatchELF |
| 134 | +, dontStrip |
| 135 | +, dontUpdateAutotoolsGnuConfigScripts |
| 136 | +, hardeningDisable |
| 137 | +, enableStatic |
| 138 | +, enableShared |
| 139 | +, enableExecutableDynamic |
| 140 | +, enableDeadCodeElimination |
| 141 | +, writeHieFiles |
| 142 | +, ghcOptions |
| 143 | +, contentAddressed |
| 144 | +, doHaddock |
| 145 | +, doHoogle |
| 146 | +, hyperlinkSource |
| 147 | +, quickjump |
| 148 | +, keepConfigFiles |
| 149 | +, keepGhc |
| 150 | +, keepSource |
| 151 | +, setupHaddockFlags |
| 152 | +, enableLibraryProfiling |
| 153 | +, enableProfiling |
| 154 | +, profilingDetail |
| 155 | +, doCoverage |
| 156 | +, enableSeparateDataOutput |
| 157 | +, enableLibraryForGhci |
| 158 | +, enableDebugRTS |
| 159 | +, enableDWARF |
| 160 | +, enableTSanRTS |
| 161 | +, useLLVM |
| 162 | +, smallAddressSpace |
96 | 163 | }@drvArgs: |
97 | 164 |
|
98 | 165 | let |
|
341 | 408 | } |
342 | 409 | // lib.optionalAttrs stdenv.hostPlatform.isMusl { |
343 | 410 | # This fixes musl compilation of TH code that depends on C++ (for instance TH code that uses the double-conversion package) |
344 | | - LD_LIBRARY_PATH="${pkgs.buildPackages.gcc-unwrapped.lib}/x86_64-unknown-linux-musl/lib"; |
| 411 | + LD_LIBRARY_PATH="${pkgs.buildPackages.gcc-unwrapped.lib}/${stdenv.hostPlatform.config}/lib"; |
345 | 412 | } |
346 | 413 | // lib.optionalAttrs dontUpdateAutotoolsGnuConfigScripts { |
347 | 414 | inherit dontUpdateAutotoolsGnuConfigScripts; |
|
655 | 722 | mkdir -p $out/share |
656 | 723 | if [ -d dist/build/extra-compilation-artifacts ]; then |
657 | 724 | cp -r dist/build/extra-compilation-artifacts/hpc $out/share |
| 725 | + elif [ -d ${testExecutable}-tmp/extra-compilation-artifacts ]; then |
| 726 | + cp -r ${testExecutable}-tmp/extra-compilation-artifacts/hpc $out/share |
| 727 | + elif [ -d dist/build/${componentId.cname}/extra-compilation-artifacts ]; then |
| 728 | + cp -r dist/build/${componentId.cname}/extra-compilation-artifacts/hpc $out/share |
658 | 729 | else |
659 | 730 | cp -r dist/hpc $out/share |
660 | 731 | fi |
|
718 | 789 | // lib.optionalAttrs (hardeningDisable != [] || stdenv.hostPlatform.isMusl) { |
719 | 790 | hardeningDisable = hardeningDisable ++ lib.optional stdenv.hostPlatform.isMusl "pie"; |
720 | 791 | }); |
721 | | -in drv; in self) |
| 792 | +in drv; in self) { |
| 793 | + inherit componentId |
| 794 | + component |
| 795 | + package |
| 796 | + name |
| 797 | + setup |
| 798 | + src |
| 799 | + flags |
| 800 | + cabalFile |
| 801 | + cabal-generator |
| 802 | + patches |
| 803 | + preUnpack |
| 804 | + configureFlags |
| 805 | + prePatch |
| 806 | + postPatch |
| 807 | + preConfigure |
| 808 | + postConfigure |
| 809 | + setupBuildFlags |
| 810 | + preBuild |
| 811 | + postBuild |
| 812 | + preCheck |
| 813 | + postCheck |
| 814 | + setupInstallFlags |
| 815 | + preInstall |
| 816 | + postInstall |
| 817 | + preHaddock |
| 818 | + postHaddock |
| 819 | + shellHook |
| 820 | + configureAllComponents |
| 821 | + allComponent |
| 822 | + build-tools |
| 823 | + pkgconfig |
| 824 | + platforms |
| 825 | + frameworks |
| 826 | + dontPatchELF |
| 827 | + dontStrip |
| 828 | + dontUpdateAutotoolsGnuConfigScripts |
| 829 | + hardeningDisable |
| 830 | + enableStatic |
| 831 | + enableShared |
| 832 | + enableExecutableDynamic |
| 833 | + enableDeadCodeElimination |
| 834 | + writeHieFiles |
| 835 | + ghcOptions |
| 836 | + contentAddressed |
| 837 | + doHaddock |
| 838 | + doHoogle |
| 839 | + hyperlinkSource |
| 840 | + quickjump |
| 841 | + keepConfigFiles |
| 842 | + keepGhc |
| 843 | + keepSource |
| 844 | + setupHaddockFlags |
| 845 | + enableLibraryProfiling |
| 846 | + enableProfiling |
| 847 | + profilingDetail |
| 848 | + doCoverage |
| 849 | + enableSeparateDataOutput |
| 850 | + enableLibraryForGhci |
| 851 | + enableDebugRTS |
| 852 | + enableDWARF |
| 853 | + enableTSanRTS |
| 854 | + useLLVM |
| 855 | + smallAddressSpace; |
| 856 | +} |
0 commit comments