Skip to content

Commit

Permalink
Alpine build
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Apr 6, 2023
1 parent 65d68fc commit bfcca3a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,38 @@ diff-demo :

tags :
hasktags -c src src-exe

EXETARGET:=cabal-plan
VERSION=0.7.3.0

CABALPLAN:=$(HOME)/.local/bin/cabal-plan
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
CABALVERSION:=3.10.1.0

# docker run -ti -v $(pwd):/src alpine:3.17.3
# cd /src
# apk add make
# make alpine-release
#
.PHONY: alpine-release
alpine-release :
apk add binutils-gold curl gcc 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) install --ignore-project cabal-plan -fexe --overwrite-policy=always --with-compiler $(GHC)
$(CABAL) build exe:$(EXETARGET) -fexe --with-compiler $(GHC) --enable-executable-static
strip $$($(CABALPLAN) list-bin $(EXETARGET))
@ls -l $$($(CABALPLAN) list-bin $(EXETARGET))
cat $$($(CABALPLAN) list-bin $(EXETARGET)) | xz > $(EXETARGET)-$(VERSION).xz
@ls -l $(EXETARGET)-$(VERSION).xz
sha256sum $(EXETARGET)-$(VERSION).xz | tee $(EXETARGET)-$(VERSION).SHA256SUM
2 changes: 1 addition & 1 deletion cabal-plan.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: cabal-plan
version: 0.7.2.4
version: 0.7.3.0

synopsis: Library and utility for processing cabal's plan.json file
description: {
Expand Down

0 comments on commit bfcca3a

Please sign in to comment.