-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.git-2.33.0
More file actions
45 lines (42 loc) · 1.85 KB
/
Dockerfile.git-2.33.0
File metadata and controls
45 lines (42 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ARG MUSL_TARGET=x86_64-linux-musl
FROM zlib-1.2.11-${MUSL_TARGET} AS zlib
FROM expat-2.4.1-${MUSL_TARGET} AS expat
FROM openssl-1.1.1k-${MUSL_TARGET} AS openssl
FROM curl-7.79.1-${MUSL_TARGET} AS curl
FROM musl-cross-make-$MUSL_TARGET
ARG MUSL_TARGET
COPY --from=zlib /output /output
COPY --from=expat /output /output
COPY --from=openssl /output /output
COPY --from=curl /output /output
WORKDIR /build
RUN download https://github.com/git/git/archive/refs/tags/v2.33.0.tar.gz source.tar.gz ac8bb4bd4f689ddacd1f17c13e519c78d0f38ffc7c41dc24a4dbeb576bc88e91 && tar xf source.tar.gz
RUN export PATH=/build/cross/bin:/output/bin:$PATH && \
cd git-* && \
export CC="$MUSL_TARGET-gcc" && \
export CFLAGS="-static -frandom-seed=pulse" && \
export CPPFLAGS="-I/output/include" && \
export LDFLAGS="-L/output/lib" && \
export LIBS="-lssl -lcrypto -lz" && \
make configure && \
./configure \
--without-tcltk \
--host=$($MUSL_TARGET-gcc -dumpmachine) \
--target=$($MUSL_TARGET-gcc -dumpmachine) \
--prefix=/output \
# https://public-inbox.org/git/20190211214306.GB14229@alpha/
# https://git.exherbo.org/arbor.git/tree/packages/dev-scm/git/git-build.exlib#n161
# https://patch-diff.githubusercontent.com/raw/void-linux/void-packages/pull/18139.patch
# https://marc.info/?l=git&m=120473229209965
ac_cv_iconv_omits_bom=yes ac_cv_fread_reads_directories=no ac_cv_snprintf_returns_bogus=no && \
# Avoid generating translations by dummying out msgfmt, also makes dependency on gettext optional
echo "#!/bin/sh\nexit 0" > /usr/local/bin/msgfmt && \
chmod +x /usr/local/bin/msgfmt && \
make -j$(nproc) && \
export BEFORE_INSTALL=$(find /output/bin/ -type f | xargs) && \
make install && \
rm -- ${BEFORE_INSTALL} && \
${MUSL_TARGET}-strip /output/bin/* || true && \
${MUSL_TARGET}-strip /output/libexec/git-core/* || true && \
tar -z -c -f /output/full.tar.gz -C /output --transform 's,^,git/,' bin libexec
CMD bash