mirror of
https://github.com/BtbN/FFmpeg-Builds.git
synced 2025-05-24 02:22:10 +02:00
Move configure flags into each respective image
This commit is contained in:
parent
c032e0fa41
commit
281ab29417
36
build.sh
36
build.sh
@ -4,42 +4,12 @@ shopt -s globstar
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
source util/vars.sh
|
source util/vars.sh
|
||||||
|
|
||||||
get_output() {
|
|
||||||
(
|
|
||||||
SELF="$1"
|
|
||||||
source $1
|
|
||||||
if ffbuild_enabled; then
|
|
||||||
ffbuild_$2 || exit 0
|
|
||||||
else
|
|
||||||
ffbuild_un$2 || exit 0
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
source "variants/${TARGET}-${VARIANT}.sh"
|
source "variants/${TARGET}-${VARIANT}.sh"
|
||||||
|
|
||||||
for addin in ${ADDINS[*]}; do
|
for addin in ${ADDINS[*]}; do
|
||||||
source "addins/${addin}.sh"
|
source "addins/${addin}.sh"
|
||||||
done
|
done
|
||||||
|
|
||||||
export FFBUILD_PREFIX="$(docker run --rm "$IMAGE" bash -c 'echo $FFBUILD_PREFIX')"
|
|
||||||
|
|
||||||
for script in scripts.d/**/*.sh; do
|
|
||||||
FF_CONFIGURE+=" $(get_output $script configure)"
|
|
||||||
FF_CFLAGS+=" $(get_output $script cflags)"
|
|
||||||
FF_CXXFLAGS+=" $(get_output $script cxxflags)"
|
|
||||||
FF_LDFLAGS+=" $(get_output $script ldflags)"
|
|
||||||
FF_LDEXEFLAGS+=" $(get_output $script ldexeflags)"
|
|
||||||
FF_LIBS+=" $(get_output $script libs)"
|
|
||||||
done
|
|
||||||
|
|
||||||
FF_CONFIGURE="$(xargs <<< "$FF_CONFIGURE")"
|
|
||||||
FF_CFLAGS="$(xargs <<< "$FF_CFLAGS")"
|
|
||||||
FF_CXXFLAGS="$(xargs <<< "$FF_CXXFLAGS")"
|
|
||||||
FF_LDFLAGS="$(xargs <<< "$FF_LDFLAGS")"
|
|
||||||
FF_LDEXEFLAGS="$(xargs <<< "$FF_LDEXEFLAGS")"
|
|
||||||
FF_LIBS="$(xargs <<< "$FF_LIBS")"
|
|
||||||
|
|
||||||
TESTFILE="uidtestfile"
|
TESTFILE="uidtestfile"
|
||||||
rm -f "$TESTFILE"
|
rm -f "$TESTFILE"
|
||||||
docker run --rm -v "$PWD:/uidtestdir" "$IMAGE" touch "/uidtestdir/$TESTFILE"
|
docker run --rm -v "$PWD:/uidtestdir" "$IMAGE" touch "/uidtestdir/$TESTFILE"
|
||||||
@ -67,9 +37,9 @@ cat <<EOF >"$BUILD_SCRIPT"
|
|||||||
git clone --filter=blob:none --branch='$GIT_BRANCH' '$FFMPEG_REPO' ffmpeg
|
git clone --filter=blob:none --branch='$GIT_BRANCH' '$FFMPEG_REPO' ffmpeg
|
||||||
cd ffmpeg
|
cd ffmpeg
|
||||||
|
|
||||||
./configure --prefix=/ffbuild/prefix --pkg-config-flags="--static" \$FFBUILD_TARGET_FLAGS $FF_CONFIGURE \
|
./configure --prefix=/ffbuild/prefix --pkg-config-flags="--static" \$FFBUILD_TARGET_FLAGS \$FF_CONFIGURE \
|
||||||
--extra-cflags='$FF_CFLAGS' --extra-cxxflags='$FF_CXXFLAGS' \
|
--extra-cflags='\$FF_CFLAGS' --extra-cxxflags='\$FF_CXXFLAGS' \
|
||||||
--extra-ldflags='$FF_LDFLAGS' --extra-ldexeflags='$FF_LDEXEFLAGS' --extra-libs='$FF_LIBS' \
|
--extra-ldflags='\$FF_LDFLAGS' --extra-ldexeflags='\$FF_LDEXEFLAGS' --extra-libs='\$FF_LIBS' \
|
||||||
--extra-version="\$(date +%Y%m%d)"
|
--extra-version="\$(date +%Y%m%d)"
|
||||||
make -j\$(nproc) V=1
|
make -j\$(nproc) V=1
|
||||||
make install install-doc
|
make install install-doc
|
||||||
|
51
generate.sh
51
generate.sh
@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
shopt -s globstar
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
source util/vars.sh
|
source util/vars.sh
|
||||||
|
|
||||||
@ -34,8 +35,6 @@ exec_dockerstage() {
|
|||||||
|
|
||||||
to_df "ENV SELF=\"$SELF\" STAGENAME=\"$STAGENAME\""
|
to_df "ENV SELF=\"$SELF\" STAGENAME=\"$STAGENAME\""
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
STG="$(ffbuild_dockerdl)"
|
STG="$(ffbuild_dockerdl)"
|
||||||
if [[ -n "$STG" ]]; then
|
if [[ -n "$STG" ]]; then
|
||||||
HASH="$(sha256sum <<<"$STG" | cut -d" " -f1)"
|
HASH="$(sha256sum <<<"$STG" | cut -d" " -f1)"
|
||||||
@ -101,3 +100,51 @@ done
|
|||||||
to_df "FROM base"
|
to_df "FROM base"
|
||||||
sed "s/__PREVLAYER__/$PREVLAYER/g" Dockerfile.final | sort -u >> Dockerfile
|
sed "s/__PREVLAYER__/$PREVLAYER/g" Dockerfile.final | sort -u >> Dockerfile
|
||||||
rm Dockerfile.final
|
rm Dockerfile.final
|
||||||
|
|
||||||
|
###
|
||||||
|
### Compile list of configure arguments and add them to the final Dockerfile
|
||||||
|
###
|
||||||
|
|
||||||
|
get_output() {
|
||||||
|
(
|
||||||
|
SELF="$1"
|
||||||
|
source $1
|
||||||
|
if ffbuild_enabled; then
|
||||||
|
ffbuild_$2 || exit 0
|
||||||
|
else
|
||||||
|
ffbuild_un$2 || exit 0
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
source "variants/${TARGET}-${VARIANT}.sh"
|
||||||
|
|
||||||
|
for addin in ${ADDINS[*]}; do
|
||||||
|
source "addins/${addin}.sh"
|
||||||
|
done
|
||||||
|
|
||||||
|
export FFBUILD_PREFIX="$(docker run --rm "$IMAGE" bash -c 'echo $FFBUILD_PREFIX')"
|
||||||
|
|
||||||
|
for script in scripts.d/**/*.sh; do
|
||||||
|
FF_CONFIGURE+=" $(get_output $script configure)"
|
||||||
|
FF_CFLAGS+=" $(get_output $script cflags)"
|
||||||
|
FF_CXXFLAGS+=" $(get_output $script cxxflags)"
|
||||||
|
FF_LDFLAGS+=" $(get_output $script ldflags)"
|
||||||
|
FF_LDEXEFLAGS+=" $(get_output $script ldexeflags)"
|
||||||
|
FF_LIBS+=" $(get_output $script libs)"
|
||||||
|
done
|
||||||
|
|
||||||
|
FF_CONFIGURE="$(xargs <<< "$FF_CONFIGURE")"
|
||||||
|
FF_CFLAGS="$(xargs <<< "$FF_CFLAGS")"
|
||||||
|
FF_CXXFLAGS="$(xargs <<< "$FF_CXXFLAGS")"
|
||||||
|
FF_LDFLAGS="$(xargs <<< "$FF_LDFLAGS")"
|
||||||
|
FF_LDEXEFLAGS="$(xargs <<< "$FF_LDEXEFLAGS")"
|
||||||
|
FF_LIBS="$(xargs <<< "$FF_LIBS")"
|
||||||
|
|
||||||
|
to_df "ENV \\"
|
||||||
|
to_df " FF_CONFIGURE=\"$FF_CONFIGURE\" \\"
|
||||||
|
to_df " FF_CFLAGS=\"$FF_CFLAGS\" \\"
|
||||||
|
to_df " FF_CXXFLAGS=\"$FF_CXXFLAGS\" \\"
|
||||||
|
to_df " FF_LDFLAGS=\"$FF_LDFLAGS\" \\"
|
||||||
|
to_df " FF_LDEXEFLAGS=\"$FF_LDEXEFLAGS\" \\"
|
||||||
|
to_df " FF_LIBS=\"$FF_LIBS\""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user