Skip to content

Commit 4e85729

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 41f4749 + e338f23 commit 4e85729

86 files changed

Lines changed: 1305 additions & 81 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Stop Commands
4040
run: T="$(echo -n ${{ github.token }} | sha256sum | head -c 64)" && echo -e "::add-mask::${T}\n::stop-commands::${T}"
4141
- name: Build target base image
42-
uses: docker/build-push-action@v5
42+
uses: docker/build-push-action@v6
4343
with:
4444
context: images/base
4545
pull: true
@@ -102,7 +102,7 @@ jobs:
102102
- name: Stop Commands
103103
run: T="$(echo -n ${{ github.token }} | sha256sum | head -c 64)" && echo -e "::add-mask::${T}\n::stop-commands::${T}"
104104
- name: Build target base image
105-
uses: docker/build-push-action@v5
105+
uses: docker/build-push-action@v6
106106
with:
107107
context: images/base-${{ matrix.target }}
108108
pull: true
@@ -164,7 +164,7 @@ jobs:
164164
key: download-cache-${{ steps.dl_cache.outputs.dltagname }}
165165
fail-on-cache-miss: true
166166
- name: Build target base image
167-
uses: docker/build-push-action@v5
167+
uses: docker/build-push-action@v6
168168
with:
169169
context: .
170170
pull: true

build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ EOF
4848

4949
docker run --rm -i $TTY_ARG "${UIDARGS[@]}" -v "$PWD/ffbuild":/ffbuild -v "$BUILD_SCRIPT":/build.sh "$IMAGE" bash /build.sh
5050

51+
if [[ -n "$FFBUILD_OUTPUT_DIR" ]]; then
52+
mkdir -p "$FFBUILD_OUTPUT_DIR"
53+
package_variant ffbuild/prefix "$FFBUILD_OUTPUT_DIR"
54+
rm -rf ffbuild
55+
exit 0
56+
fi
57+
5158
mkdir -p artifacts
5259
ARTIFACTS_PATH="$PWD/artifacts"
5360
BUILD_NAME="ffmpeg-$(./ffbuild/ffmpeg/ffbuild/version.sh ffbuild/ffmpeg)-${TARGET}-${VARIANT}${ADDINS_STR:+-}${ADDINS_STR}"

images/base-linux32/Dockerfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
ARG GH_REPO=ghcr.io/fwgs/ffmpeg-builds
2+
FROM $GH_REPO/base:latest
3+
4+
RUN --mount=src=ct-ng-config,dst=/.config \
5+
git clone --filter=blob:none https://github.com/crosstool-ng/crosstool-ng.git /ct-ng && cd /ct-ng && \
6+
./bootstrap && \
7+
./configure --enable-local && \
8+
make -j$(nproc) && \
9+
cp /.config .config && \
10+
./ct-ng build && \
11+
cd / && \
12+
rm -rf ct-ng
13+
14+
# Prepare "cross" environment to heavily favour static builds
15+
RUN \
16+
find /opt/ct-ng -type l \
17+
-and -name '*.so' \
18+
-and -not -ipath '*plugin*' \
19+
-and -not -name 'libdl.*' \
20+
-and -not -name 'libc.*' \
21+
-and -not -name 'libm.*' \
22+
-and -not -name 'libmvec.*' \
23+
-and -not -name 'librt.*' \
24+
-and -not -name 'libpthread.*' \
25+
-delete && \
26+
find /opt/ct-ng \
27+
-name 'libdl.a' \
28+
-or -name 'libc.a' \
29+
-or -name 'libm.a' \
30+
-or -name 'libmvec.a' \
31+
-or -name 'librt.a' \
32+
-or -name 'libpthread.a' \
33+
-delete && \
34+
mkdir /opt/ffbuild
35+
36+
ENV FFBUILD_TOOLCHAIN=i686-ffbuild-linux-gnu \
37+
FFBUILD_RUST_TARGET="i686-unknown-linux-gnu"
38+
39+
#RUN \
40+
# rustup default nightly && \
41+
# echo "[unstable]\ntarget-applies-to-host = true\nhost-config = true\n" > "$CARGO_HOME"/config.toml && \
42+
# echo "[target.$FFBUILD_RUST_TARGET]\nlinker = \"${FFBUILD_TOOLCHAIN}-gcc\"\nar = \"${FFBUILD_TOOLCHAIN}-gcc-ar\"\n" >> "$CARGO_HOME"/config.toml && \
43+
# echo "[target.host]\nlinker = \"gcc\"\nar = \"ar\"\n" >> "$CARGO_HOME"/config.toml
44+
45+
ADD toolchain.cmake /toolchain.cmake
46+
ADD cross.meson /cross.meson
47+
48+
ADD gen-implib.sh /usr/bin/gen-implib
49+
RUN git clone --filter=blob:none --depth=1 https://github.com/yugr/Implib.so /opt/implib
50+
51+
ENV PATH="/opt/ct-ng/bin:${PATH}" \
52+
FFBUILD_TARGET_FLAGS="--pkg-config=pkg-config --cross-prefix=${FFBUILD_TOOLCHAIN}- --arch=i686 --target-os=linux" \
53+
FFBUILD_CROSS_PREFIX="${FFBUILD_TOOLCHAIN}-" \
54+
FFBUILD_PREFIX=/opt/ffbuild \
55+
FFBUILD_CMAKE_TOOLCHAIN=/toolchain.cmake \
56+
PKG_CONFIG=pkg-config \
57+
PKG_CONFIG_LIBDIR=/opt/ffbuild/lib/pkgconfig:/opt/ffbuild/share/pkgconfig \
58+
CC="${FFBUILD_TOOLCHAIN}-gcc" \
59+
CXX="${FFBUILD_TOOLCHAIN}-g++" \
60+
LD="${FFBUILD_TOOLCHAIN}-ld" \
61+
AR="${FFBUILD_TOOLCHAIN}-gcc-ar" \
62+
RANLIB="${FFBUILD_TOOLCHAIN}-gcc-ranlib" \
63+
NM="${FFBUILD_TOOLCHAIN}-gcc-nm" \
64+
CFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -fPIC -DPIC -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -pthread" \
65+
CXXFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -fPIC -DPIC -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -pthread" \
66+
LDFLAGS="-static-libgcc -static-libstdc++ -L/opt/ffbuild/lib -O2 -pipe -fstack-protector-strong -fstack-clash-protection -Wl,-z,relro,-z,now -pthread -lm" \
67+
STAGE_CFLAGS="-fvisibility=hidden -fno-semantic-interposition" \
68+
STAGE_CXXFLAGS="-fvisibility=hidden -fno-semantic-interposition"

images/base-linux32/cross.meson

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[binaries]
2+
c = 'i686-ffbuild-linux-gnu-gcc'
3+
cpp = 'i686-ffbuild-linux-gnu-g++'
4+
ld = 'i686-ffbuild-linux-gnu-ld'
5+
ar = 'i686-ffbuild-linux-gnu-gcc-ar'
6+
ranlib = 'i686-ffbuild-linux-gnu-gcc-ranlib'
7+
strip = 'i686-ffbuild-linux-gnu-strip'
8+
9+
[host_machine]
10+
system = 'linux'
11+
cpu_family = 'x86'
12+
cpu = 'i686'
13+
endian = 'little'

0 commit comments

Comments
 (0)