From bfcca3a8704bd16116922c4978354033ea3b1830 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Thu, 6 Apr 2023 16:26:13 +0300 Subject: [PATCH] Alpine build --- Makefile | 35 +++++++++++++++++++++++++++++++++++ cabal-plan.cabal | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bb45d0c..27c47fd 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/cabal-plan.cabal b/cabal-plan.cabal index ff7a231..dd2e072 100644 --- a/cabal-plan.cabal +++ b/cabal-plan.cabal @@ -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: {