mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-19 13:00:54 -07:00
feat(build): add build files for macos arm64
This commit is contained in:
parent
260c98f5d6
commit
e7e78066e1
3 changed files with 48 additions and 0 deletions
33
build/darwin.aarch64/Dockerfile
Normal file
33
build/darwin.aarch64/Dockerfile
Normal file
|
@ -0,0 +1,33 @@
|
|||
FROM liushuyu/osxcross@sha256:fa32af4677e2860a1c5950bc8c360f309e2a87e2ddfed27b642fddf7a6093b76
|
||||
|
||||
ENV TARGET aarch64-apple-darwin18
|
||||
ENV TARGETNAME darwin.aarch64
|
||||
|
||||
# Build dependencies
|
||||
USER root
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
RUN sed -e 's/focal/kinetic/g' -i /etc/apt/sources.list
|
||||
RUN apt-get update
|
||||
RUN apt-get dist-upgrade -y
|
||||
RUN apt-get install -y ghc automake autoconf llvm curl alex happy
|
||||
|
||||
# Build GHC
|
||||
WORKDIR /ghc
|
||||
RUN curl -L "https://downloads.haskell.org/~ghc/9.2.5/ghc-9.2.5-src.tar.xz" | tar xJ --strip-components=1
|
||||
RUN ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET"
|
||||
RUN cp mk/flavours/quick-cross.mk mk/build.mk && make -j "$(nproc)"
|
||||
RUN make install
|
||||
RUN curl -L "https://downloads.haskell.org/~cabal/cabal-install-3.9.0.0/cabal-install-3.9-x86_64-linux-alpine.tar.xz" | tar xJv -C /usr/local/bin
|
||||
|
||||
# Due to an apparent cabal bug, we specify our options directly to cabal
|
||||
# It won't reuse caches if ghc-options are specified in ~/.cabal/config
|
||||
ENV CABALOPTS "--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg"
|
||||
|
||||
# Prebuild the dependencies
|
||||
RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck
|
||||
|
||||
# Copy the build script
|
||||
COPY build /usr/bin
|
||||
|
||||
WORKDIR /scratch
|
||||
ENTRYPOINT ["/usr/bin/build"]
|
14
build/darwin.aarch64/build
Normal file
14
build/darwin.aarch64/build
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
set -xe
|
||||
{
|
||||
tar xzv --strip-components=1
|
||||
chmod +x striptests && ./striptests
|
||||
mkdir "$TARGETNAME"
|
||||
cabal update
|
||||
( IFS=';'; cabal build $CABALOPTS )
|
||||
find . -name shellcheck -type f -exec mv {} "$TARGETNAME/" \;
|
||||
ls -l "$TARGETNAME"
|
||||
"$TARGET-strip" -Sx "$TARGETNAME/shellcheck"
|
||||
ls -l "$TARGETNAME"
|
||||
} >&2
|
||||
tar czv "$TARGETNAME"
|
1
build/darwin.aarch64/tag
Normal file
1
build/darwin.aarch64/tag
Normal file
|
@ -0,0 +1 @@
|
|||
koalaman/scbuilder-darwin-aarch64
|
Loading…
Add table
Add a link
Reference in a new issue