Skip to content

Instantly share code, notes, and snippets.

@dtaskoff
Last active September 28, 2021 09:05
Show Gist options
  • Save dtaskoff/8a815fbdd4f29d86bbe91b476692bd49 to your computer and use it in GitHub Desktop.
Save dtaskoff/8a815fbdd4f29d86bbe91b476692bd49 to your computer and use it in GitHub Desktop.
Build a non-gmp GHC bindist

install stack

CentOS-specific preparations:

yum install ncurses-devel gcc-c++
localedef -c -f UTF-8 -i en_US en_US.UTF-8
export LC_ALL=en_US.UTF-8

Building the binary distribution:

stack setup
stack install alex happy
stack exec --no-ghc-package-path bash # the --no-ghc-package-path is important!

pacman -Syuu
pacman -S --needed git tar bsdtar binutils autoconf make xz zstd \
    curl libtool automake python python3 p7zip patch ca-certificates \
    mingw-w64-$(uname -m)-gcc \
    mingw-w64-$(uname -m)-python3 \
    mingw-w64-$(uname -m)-python3-sphinx \
    mingw-w64-$(uname -m)-tools-git


./configure --enable-tarballs-autodownload

# copy the mk/build.mk.sample to mk/build.mk
# for GHC < 9.0.1 - add INTEGER_LIBRARY=integer-simple
# for GHC >= 9.0.1 -  add BIGNUM_BACKEND=native

make
make binary-dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment