System setup where installing ghcjs was succeeded. In another system setup the steps could be different.
OS: Manjaro 23.0.0 Uranos
Kernel: x86_64 Linux 6.4.6-1-MANJARO
DE: KDE 5.108.0 / Plasma 5.27.7
-
I use
ghcupfor tool management. Thus there should not exist (or be visible in a PATH) any alternative of cabal setup (for example in/home/$USERNAME/.cabal) except ones that installed byghcup. Also,no extraghc-pkgsetups, for example in/usr/binPATH. Highly likely installed globallyhappyshould have version1.19.11. Likely, in your case there are another toolings installed with different version that slips into GHCJS compiling. -
GHCUP: GHC set to 8.6.5, Cabal set to 3.2.0.0
-
git clone --branch ghc-8.6 https://github.com/ghcjs/ghcjs.git
-
cd ghcjs
-
git submodule update --init --recursive
-
Replace
_AC_PROG_CC_C99withAC_PROG_CC_C99inghc/aclocal.m4if you run into error:configure:6892: error: possibly undefined macro: _AC_PROG_CC_C99 If this token and others are legitimate, please use m4_pattern_allow -
./utils/makePackages.sh
-
cabal new-configure
-
cabal new-build
-
Make
ghcjs-runvisible by adding toutils/dist-newstyle-wrapper.shthe lines:
elif [ "$PGM" = "ghcjs-run" ]; then
exec "$DISTDIR/ghcjs-run/ghcjs-run" ${1+"$@"}
- Make executables being global:
ln -sf `pwd`/utils/dist-newstyle-wrapper.sh /home/$USER/.local/bin/ghcjs && \
ln -sf `pwd`/utils/dist-newstyle-wrapper.sh /home/$USER/.local/bin/ghcjs-pkg && \
ln -sf `pwd`/utils/dist-newstyle-wrapper.sh /home/$USER/.local/bin/haddock-ghcjs && \
ln -sf `pwd`/utils/dist-newstyle-wrapper.sh /home/$USER/.local/bin/hsc2hs-ghcjs && \
ln -sf `pwd`/utils/dist-newstyle-wrapper.sh /home/$USER/.local/bin/ghcjs-boot && \
ln -sf `pwd`/utils/dist-newstyle-wrapper.sh /home/$USER/.local/bin/ghcjs-run
ghcjs-boot -s ./lib/boot --no-haddock -j8I turned off building haddock documentation with--no-haddockbecause of an errorHaddock's resource directory does not exist!which could be fixed for sure.