Created
December 28, 2021 03:26
-
-
Save 3socha/c81b13c7c62811a9357838ec5c6a368d to your computer and use it in GitHub Desktop.
egison-tarball-builder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
egison-*.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:21.10 | |
ARG EGISON_VERSION | |
ENV DEBIAN_FRONTEND=noninteractive | |
ENV BUILDROOT=/egison | |
ENV PACKAGE_DIR=/egison-$EGISON_VERSION | |
# install build tools (ghc 8.8.4, cabal-install 3.0.0) | |
RUN apt update | |
RUN apt install -y git haskell-platform libghc-bifunctors-dev libghc-free-dev | |
RUN cabal update | |
# build egison statically | |
RUN git clone --depth 1 --branch $EGISON_VERSION https://github.com/egison/egison.git $BUILDROOT | |
WORKDIR $BUILDROOT | |
RUN sed '/Executable egison-translate/,${s/ghc-options:/& -threaded/}' -i egison.cabal | |
RUN cabal configure --enable-executable-static | |
RUN cabal build | |
# packaging | |
RUN bash -c "mkdir -p $PACKAGE_DIR/{bin,/lib/egison}" | |
RUN cp $(find $BUILDROOT/dist-newstyle/build -type f -name egison) $PACKAGE_DIR/bin/ | |
RUN cp -r lib/ $PACKAGE_DIR/lib/egison/ | |
RUN cp LICENSE README.md THANKS.md $PACKAGE_DIR/ | |
WORKDIR $PACKAGE_DIR | |
RUN tar -zcvf /egison-linux-$(uname -m | sed s/aarch64/arm64/).tar.gz . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOCKER_IMAGE_NAME := egison-builder | |
EGISON_VERSION := 4.1.3 | |
EGISON_PACKAGE_NAME := egison-linux-$(shell uname -m | sed s/aarch64/arm64/).tar.gz | |
export_package: build | |
$(shell docker create $(DOCKER_IMAGE_NAME) | xargs -I@ sh -c "docker cp @:/$(EGISON_PACKAGE_NAME) .; docker rm @" >/dev/null) | |
build: | |
DOCKER_BUILDKIT=1 docker image build --tag $(DOCKER_IMAGE_NAME) --build-arg EGISON_VERSION=$(EGISON_VERSION) . | |
clean: | |
docker rmi $(DOCKER_IMAGE_NAME) | |
rm -f $(EGISON_PACKAGE_NAME) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment