Skip to content

Instantly share code, notes, and snippets.

@phadej
Created April 6, 2023 14: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 phadej/87d52ffc7965313cd8126278ffd9a4e5 to your computer and use it in GitHub Desktop.
Save phadej/87d52ffc7965313cd8126278ffd9a4e5 to your computer and use it in GitHub Desktop.
cabal-version: 2.4
name: bug23034
version: 0.1.0.0
extra-source-files: CHANGELOG.md
executable bug23034
main-is: Main.hs
build-depends: base <5, template-haskell
default-language: Haskell2010

Revision history for bug23034

0.1.0.0 -- YYYY-mm-dd

  • First version. Released on an unsuspecting world.
{-# LANGUAGE TemplateHaskell #-}
module Main (main) where
import Language.Haskell.TH (litE, stringL)
import Language.Haskell.TH.Syntax (qAddDependentFile, qRunIO)
content :: String
content =
$(do
let fp = "CHANGELOG.md"
qAddDependentFile fp
contents <- qRunIO (readFile fp)
litE $ stringL contents
)
main :: IO ()
main = putStr content
EXETARGET=bug23034
CABAL:=$(HOME)/.ghcup/bin/cabal
GHC:=$(HOME)/.ghcup/bin/ghc-9.2.7
GHCUP:=$(HOME)/.ghcup/bin/ghcup
ALPINEVERSION:=3.17.3
GHCUPVERSION:=0.1.19.2
# GHCVERSION:=9.2.7
# GHCVERSION:=9.4.4
GHCVERSION:=9.6.1
CABALVERSION:=3.10.1.0
# docker run -ti -v $(pwd):/src alpine:3.17.3
# cd /src/cabal-docspec
# apk add make
# make alpine-release
#
.PHONY: alpine-release
alpine-release :
apk add binutils-gold curl gcc g++ git gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev openssh-client perl tar tmux vim xz zlib-dev zlib-static
mkdir -p $(HOME)/.ghcup/bin
curl https://downloads.haskell.org/~ghcup/$(GHCUPVERSION)/x86_64-linux-ghcup-$(GHCUPVERSION) > $(GHCUP)
chmod a+x $(GHCUP)
$(GHCUP) install ghc $(GHCVERSION)
$(GHCUP) install cabal $(CABALVERSION)
$(CABAL) update --ignore-project
$(CABAL) build exe:$(EXETARGET) -fexe --with-compiler $(GHC) --enable-executable-static
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment