Skip to content

Instantly share code, notes, and snippets.

@liamoc
Created April 10, 2021 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liamoc/b1dd2f4fe095962e231cc3ff176eb0a9 to your computer and use it in GitHub Desktop.
Save liamoc/b1dd2f4fe095962e231cc3ff176eb0a9 to your computer and use it in GitHub Desktop.
  1. Install rosetta, command line tools, etc.
  2. install gnu tar, gnu coreutils and bash from brew.
  3. compile this dylib https://github.com/yairchu/macos11-haskell-workaround
  4. clone ghcjs 8.6 branch and submodules
  5. install ghc 8.6 and cabal-install 2.4 with ghcup
  6. Edit the ghcup ghc wrapper script to add the dylib to DYLD_INSERT_LIBRARIES before invoking ghc
  7. Edit the ./ghc/aclocal.m4 and remove the underscore before AC_
  8. Edit the ./utils/makePackages.sh to use the brew-installed bash
  9. Run the makePackages script
  10. Run cabal install, have a cup of tea
  11. It will put a bunch of broken symlinks into your bin folder, remove them and replace them with wrapper scripts that invoke GHC from your dist-new/build directory similar to ghcup, being sure to set topdir to your root ghcjs directory
  12. Run ghcjs-boot -s ./lib/boot --no-prof --no-haddock
  13. Upgrade cabal to a more sane version (And ghc too if you want)
  14. Compile your project with cabal build --ghcjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment