#!/bin/sh # SPDX-License-Identifier: 0BSD set -eu apk update --no-cache apk add --no-cache file-dev libmagic libmagic-static cabal update feats='-f-assistant -f-webapp' # shellcheck disable=SC2086 cabal configure $feats # Generate a cabal.project.freeze file. Beyond recording what # dependencies were used for a build, this (hopefully) provides future # builds a way to get back to a known good state, if necessary. cabal v2-freeze make mans n=$(nproc --ignore=1) # Most of the cabal and GHC options from pandoc's Makefile (debpkg # target, 4c66bf279). # # shellcheck disable=SC2086 cabal build -j"$n" \ --enable-executable-static $feats \ --ghc-options="-j$n +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread"