summaryrefslogtreecommitdiffstats
path: root/.github/actions/muslbuilder/Dockerfile
blob: dc545fc6232948dc20f50416da56a8db9447dd4e (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
FROM --platform=$TARGETPLATFORM alpine:latest AS depsbuilder

RUN apk add --no-cache \
    autoconf \
    automake \
    build-base \
    curl \
    ncurses \
    ncurses-terminfo \
    zip

RUN mkdir -p /fake.root /extract

ENV SQLITE_CFLAGS="\
    -DSQLITE_ENABLE_COLUMN_METADATA \
    -DSQLITE_SOUNDEX \
    -DSQLITE_ENABLE_DBSTAT_VTAB \
    -DSQLITE_ENABLE_API_ARMOR \
    -DSQLITE_ENABLE_JSON1 \
    -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
    "

ENV NCURSES_FALLBACKS="\
ansi,\
cygwin,\
Eterm,\
Eterm-256color,\
gnome,\
gnome-256color,\
konsole,\
konsole-256color,\
linux,\
putty,\
rxvt,\
rxvt-256color,\
screen,\
screen-16color,\
screen-256color,\
tmux,\
tmux-256color,\
vt100,\
vt220,\
xterm,\
xterm-256color\
"

RUN curl -sSL https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz | tar xvzC /extract/ && \
    cd /extract/bzip* && \
    make install PREFIX=/fake.root && \
    cd /extract && rm -rf *

RUN curl -sSL https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz | tar xvzC /extract/ && \
    cd /extract/lz4* && \
    make install PREFIX=/fake.root && \
    cd /extract && rm -rf *

RUN curl -sSL https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz | tar xvzC /extract/ && \
    cd /extract/zstd* && \
    make install PREFIX=/fake.root && \
    cd /extract && rm -rf *

RUN curl -sSL https://www.zlib.net/zlib-1.3.1.tar.gz | tar xvzC /extract/ && \
    cd /extract/zlib-* && ./configure --prefix=/fake.root --static && \
    make -j2 && \
    make install && \
    cd /extract && rm -rf *

RUN curl -sSL https://tukaani.org/xz/xz-5.4.3.tar.gz | tar xvzC /extract/ && \
    cd /extract/xz-* && \
    ./configure --prefix=/fake.root \
        --disable-shared \
        "LDFLAGS=-L/fake.root/lib" \
        "CPPFLAGS=-I/fake.root/include" \
    && \
    make -j2 && \
    make install && \
    cd /extract && rm -rf *

RUN curl -sSL https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.gz | tar xvzC /extract/ && \
    cd /extract/pcre2-* && \
    ./configure --prefix=/fake.root \
        --enable-jit \
        --disable-shared \
     && \
     make -j2 && \
     make install && \
     cd /extract && rm -rf *

RUN curl -sSL https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz | tar xvzC /extract/ && \
    cd /extract/ncurses-* && \
    ./configure --prefix=/fake.root \
        --enable-ext-mouse \
        --enable-sigwinch \
        --enable-ext-colors \
        --enable-widec \
        --enable-termcap \
        --with-fallbacks=$NCURSES_FALLBACKS \
        --without-shared \
        --without-progs \
        --without-manpages \
        --without-tests \
    && \
    make -j2 install && \
    cd /extract && rm -rf *

RUN curl -sSL https://www.openssl.org/source/openssl-1.0.2n.tar.gz | tar xvzC /extract/ && \
    cd /extract/openssl-* && \
    ./config --prefix=/fake.root no-shared -fPIC && \
    make -j2 && \
    make install && \
    cd /extract && rm -rf *

RUN curl -sSL https://www.libssh2.org/download/libssh2-1.11.0.tar.gz | tar xvzC /extract/ && \
    cd /extract/libssh2-* && \
    ./configure --prefix=/fake.root \
        --with-libssl-prefix=/fake.root \
        --with-libz-prefix=/fake.root \
        --disable-shared \
        "CPPFLAGS=-I/fake.root/include" \
        "LDFLAGS=-L/fake.root/lib" && \
    make -j2 && \
    make install && \
    cd /extract && rm -rf *

RUN curl -sSL https://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz | tar xvzC /extract/ && \
    cd /extract/readline-* && \
    ./configure --prefix=/fake.root --disable-shared && \
    make -j2 && \
    make install && \
    cd /extract && rm -rf *

RUN curl -sSL https://www.libarchive.org/downloads/libarchive-3.7.2.tar.gz | tar xvzC /extract/ && \
    cd /extract/libarchive-* && \
    ./configure --prefix=/fake.root \
        --disable-shared \
        "LDFLAGS=-L/fake.root/lib" \
        "CPPFLAGS=-I/fake.root/include" \
    && \
    make -j2 && \
    make install && \
    cd /extract && rm -rf *

RUN curl -sSL https://curl.se/download/curl-8.6.0.tar.gz | tar xvzC /extract/ && \
    cd /extract/curl-* && \
    ./configure --prefix=/fake.root \
        --disable-shared \
        --with-libssh2=/fake.root \
        --without-libpsl \
        --with-ssl=/fake.root \
        --with-zlib=/fake.root && \
    make -j2 && \
    make install && \
    cd /extract && rm -rf *

RUN curl -sSL https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz | tar xvzC /extract/ && \
    cd /extract/sqlite-* && \
    ./configure --disable-editline \
        --disable-shared \
        --prefix=/fake.root \
        CFLAGS="${SQLITE_CFLAGS}" \
    && \
    make -j2 && \
    make install && \
    cd /extract && rm -rf *

FROM --platform=$TARGETPLATFORM alpine:latest

COPY --from=depsbuilder /fake.root /fake.root

LABEL com.github.actions.name="C++ MUSL Builder Slim"
LABEL com.github.actions.description="Provides a C++ MUSL environment"
LABEL com.github.actions.icon="settings"
LABEL com.github.actions.color="orange"

RUN apk add --no-cache \
    autoconf \
    automake \
    build-base \
    cargo \
    git \
    rust \
    zip

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]