on iko/ghcjs-patch-master help sign in
Add enough logic to make plugins work conceptually. (#1131)
commitdd31db0a0a692ec9b4c96584750003b822c9da5f authorMoritz Angermann <moritz.angermann@gmail.com> dateMon 7 Jun 2021, 08:07 (5 years ago) parent70e3bc7
4 files changed+27−2
builder/ghc-for-component-wrapper.nix+4 compiler/ghcjs/ghcjs810-src.json+2−2 overlays/bootstrap.nix+1 overlays/patches/ghc/Cabal-unbreak-GHCJS.patch+20
builder/ghc-for-component-wrapper.nix+4
@@ -55,6 +55,10 @@ in runCommand "${componentName}-${ghc.name}-env" {
5555 # Replace the package database with the one from target package config.
5656 ln -s ${configFiles}/${packageCfgDir} $out/${packageCfgDir}
5757
58+ # now the tricky bit. For GHCJS (to make plugins work), we need a special
59+ # file called ghc_libdir. That points to the build ghc's lib.
60+ echo "${ghc.buildGHC or ghc}/lib/${(ghc.buildGHC or ghc).name}" > "${libDir}/ghc_libdir"
61+
5862 # Wrap compiler executables with correct env variables.
5963 # The NIX_ variables are used by the patched Paths_ghc module.
6064
compiler/ghcjs/ghcjs810-src.json+2−2
@@ -1,6 +1,6 @@
11{
22 "url": "https://github.com/ghcjs/ghcjs",
3− "rev": "88fc8b7993a7c06fa1a71dd8ea494330108fa397",
4− "sha256": "066vqflvxfiiw8xy0fygdq8bdqmhdjfgpqibnyfcg0xlr9wsf2ld",
3+ "rev": "ecb5954b98cdaeb3d4097401c9c3551e7a6f69ce",
4+ "sha256": "09120brnd8n8psskq9f098n7wrlrbb2h7s703678a4gbl2xfglql",
55 "fetchSubmodules": true
66}
overlays/bootstrap.nix+1
@@ -159,6 +159,7 @@ in {
159159 ++ fromUntil "8.10.3" "8.10.5" ./patches/ghc/ghc-8.10.3-rts-make-markLiveObject-thread-safe.patch
160160 ++ final.lib.optional (versionAtLeast "8.10.4" && final.targetPlatform.isWindows) ./patches/ghc/ghc-8.10-z-drive-fix.patch
161161 ++ final.lib.optional (versionAtLeast "8.6.5") ./patches/ghc/ghc-8.10-windows-add-dependent-file.patch
162+ ++ fromUntil "8.10.1" "9.0" ./patches/ghc/Cabal-unbreak-GHCJS.patch
162163 ;
163164 in ({
164165 ghc844 = final.callPackage ../compiler/ghc {
overlays/patches/ghc/Cabal-unbreak-GHCJS.patchnew file+20
@@ -0,0 +1,20 @@
1+diff --git a/libraries/Cabal/Cabal/Distribution/Simple/GHCJS.hs b/libraries/Cabal/Cabal/Distribution/Simple/GHCJS.hs
2+index 4ad5bb18c..5db4d27e7 100644
3+--- a/libraries/Cabal/Cabal/Distribution/Simple/GHCJS.hs
4++++ b/libraries/Cabal/Cabal/Distribution/Simple/GHCJS.hs
5+@@ -317,13 +317,10 @@ checkPackageDbStack :: Verbosity -> PackageDBStack -> IO ()
6+ checkPackageDbStack _ (GlobalPackageDB:rest)
7+ | GlobalPackageDB `notElem` rest = return ()
8+ checkPackageDbStack verbosity rest
9+- | GlobalPackageDB `notElem` rest =
10+- die' verbosity $ "With current ghc versions the global package db is always used "
11+- ++ "and must be listed first. This ghc limitation may be lifted in "
12+- ++ "future, see http://ghc.haskell.org/trac/ghc/ticket/5977"
13+-checkPackageDbStack verbosity _ =
14++ | GlobalPackageDB `elem` rest =
15+ die' verbosity $ "If the global package db is specified, it must be "
16+ ++ "specified first and cannot be specified multiple times"
17++checkPackageDbStack _ _ = return ()
18+
19+ getInstalledPackages' :: Verbosity -> [PackageDB] -> ProgramDb
20+ -> IO [(PackageDB, [InstalledPackageInfo])]