sequoia-sq

Source

FROM stagex/pallet-rust AS build
COPY --from=stagex/core-gmp . /
COPY --from=stagex/core-sqlite3 . /
COPY --from=stagex/user-nettle . /
COPY --from=stagex/user-capnproto . /
ARG VERSION
ADD fetch/sq-${VERSION}.tar.gz .
WORKDIR /sequoia-sq-v${VERSION}
ADD patches/*.patch .
ENV RUSTFLAGS='-C codegen-units=1'
RUN <<-EOF
	patch -p1 < 0001-Update-nettle-sys-to-fix-building-with-LLVM-clang-22.patch
	cargo fetch
EOF
RUN --network=none <<-EOF
  cargo build \
    --frozen \
    --release \
    --target $(uname -m)-unknown-linux-musl
    mkdir -p /rootfs/usr/bin
    cp target/$(uname -m)-unknown-linux-musl/release/sq /rootfs/usr/bin/
		install -vDm644 -t /rootfs/usr/share/licenses/sequoia-sq LICENSE.txt

		#	completions
		install -vDm644 -t /rootfs-completions/usr/share/bash-completion/completions/sq target/x86_64-unknown-linux-musl/release/build/sequoia-sq-*/out/shell-completions/sq.bash
		install -vDm644 -t /rootfs-completions/usr/share/zsh/site-functions target/x86_64-unknown-linux-musl/release/build/sequoia-sq-*/out/shell-completions/_sq
		install -vDm644 -t /rootfs-completions/usr/share/fish/vendor_completions.d target/x86_64-unknown-linux-musl/release/build/sequoia-sq-*/out/shell-completions/sq.fish
		install -vDm644 -t /rootfs-completions/usr/share/licenses/sequoia-sq LICENSE.txt
EOF

FROM stagex/core-filesystem AS package-sequoia-sq-completions
COPY --from=build /rootfs-completions/ /

FROM stagex/core-filesystem AS package-sequoia-sq
COPY --from=build /rootfs/ /
Copied to clipboard!