mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-25 20:06:52 +08:00
Rename build/ to builders/ to avoid looking like build output
This commit is contained in:
40
builders/linux.aarch64/Dockerfile
Normal file
40
builders/linux.aarch64/Dockerfile
Normal file
@@ -0,0 +1,40 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ENV TARGET aarch64-linux-gnu
|
||||
ENV TARGETNAME linux.aarch64
|
||||
|
||||
# Build dependencies
|
||||
USER root
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# These deps are from 20.04, because GHC's compiler/llvm support moves slowly
|
||||
RUN apt-get update && apt-get install -y llvm gcc-$TARGET
|
||||
|
||||
# The rest are from 22.10
|
||||
RUN sed -e 's/focal/kinetic/g' -i /etc/apt/sources.list
|
||||
# Kinetic does not receive updates anymore, switch to last available
|
||||
RUN sed -e 's/archive.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list
|
||||
RUN sed -e 's/security.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list
|
||||
|
||||
RUN apt-get update && apt-get install -y ghc alex happy automake autoconf build-essential curl qemu-user-static
|
||||
|
||||
# Build GHC
|
||||
WORKDIR /ghc
|
||||
RUN curl -L "https://downloads.haskell.org/~ghc/9.2.8/ghc-9.2.8-src.tar.xz" | tar xJ --strip-components=1
|
||||
RUN ./boot && ./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 "--ghc-options;-split-sections -optc-Os -optc-Wl,--gc-sections -optc-fPIC;--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg;-c;hashable -arch-native"
|
||||
|
||||
# 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
builders/linux.aarch64/build
Executable file
14
builders/linux.aarch64/build
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -xe
|
||||
{
|
||||
tar xzv --strip-components=1
|
||||
chmod +x striptests && ./striptests
|
||||
mkdir "$TARGETNAME"
|
||||
( IFS=';'; cabal build $CABALOPTS --enable-executable-static )
|
||||
find . -name shellcheck -type f -exec mv {} "$TARGETNAME/" \;
|
||||
ls -l "$TARGETNAME"
|
||||
"$TARGET-strip" -s "$TARGETNAME/shellcheck"
|
||||
ls -l "$TARGETNAME"
|
||||
qemu-aarch64-static "$TARGETNAME/shellcheck" --version
|
||||
} >&2
|
||||
tar czv "$TARGETNAME"
|
1
builders/linux.aarch64/tag
Normal file
1
builders/linux.aarch64/tag
Normal file
@@ -0,0 +1 @@
|
||||
koalaman/scbuilder-linux-aarch64
|
Reference in New Issue
Block a user