Skip to content

Instantly share code, notes, and snippets.

@TerrorJack
Last active June 8, 2018 20:18
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 TerrorJack/c0b847fff0e9f221144c5b61f69f9988 to your computer and use it in GitHub Desktop.
Save TerrorJack/c0b847fff0e9f221144c5b61f69f9988 to your computer and use it in GitHub Desktop.
Recipe for building ghc-8.4.3 bindist for Alpine Linux on CircleCI
SRC_HC_OPTS = -O -H64m
GhcStage1HcOpts = -O
GhcStage2HcOpts = -O2
GhcLibHcOpts = -O2
BUILD_PROF_LIBS = YES
SplitObjs = NO
SplitSections = YES
BUILD_SPHINX_HTML = YES
BUILD_SPHINX_PDF = NO
HADDOCK_DOCS = YES
EXTRA_HADDOCK_OPTS += --quickjump --hyperlinked-source
version: 2
jobs:
build:
docker:
- image: alpine:edge
environment:
GHC_REV: ghc-8.4.3-release
JOBS: 4
XZ_OPT: -9
steps:
- checkout
- run:
name: Compile GHC
no_output_timeout: 1h
command: |
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
apk upgrade --no-cache --no-progress
apk add --no-cache --no-progress \
autoconf \
automake \
binutils-gold \
bzip2 \
ca-certificates \
coreutils \
curl \
file \
findutils \
g++ \
gawk \
gcc \
ghc \
git \
gmp-dev \
gzip \
libffi-dev \
libtool \
make \
musl-dev \
ncurses-dev \
numactl-dev \
openssh \
patch \
perl \
py3-sphinx \
sed \
tar \
xz \
zlib-dev
mkdir -p ~/.local/bin
export PATH=~/.local/bin:$PATH
curl -L https://github.com/commercialhaskell/stack/releases/download/v1.6.5/stack-1.6.5-linux-x86_64-static.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
stack --no-terminal --resolver lts-9 --system-ghc install \
alex \
happy \
hscolour
export PROJECT_DIR=$(pwd)
cd /tmp
git clone git://git.haskell.org/ghc.git
cd ghc
git checkout $GHC_REV
git submodule update --init --recursive
mv $PROJECT_DIR/build.mk mk/
./boot
SPHINXBUILD=/usr/bin/sphinx-build-3 ./configure --disable-ld-override
make -j$JOBS
make binary-dist
mkdir /tmp/ghc-bindist
mv *.tar.xz /tmp/ghc-bindist/
- store_artifacts:
path: /tmp/ghc-bindist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment