Add x264 test script
This commit is contained in:
parent
dd5ed8066e
commit
cbb86a4d0e
4 changed files with 74 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/Dockerfile
|
|
@ -9,3 +9,4 @@ RUN \
|
|||
apt-get -y clean
|
||||
|
||||
RUN mkdir -p /opt/ffbuild/{lib,bin,include}
|
||||
ENV FFBUILD_PREFIX /opt/ffbuild
|
||||
|
|
36
generate.sh
36
generate.sh
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
rm -f Dockerfile
|
||||
|
||||
if [[ $# -lt 1 || $# -gt 2 ]]; then
|
||||
echo "Invalid Arguments"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
TARGET="$1"
|
||||
VARIANT="${2:-gpl}"
|
||||
REPO="${GITHUB_REPOSITORY:-btbn/ffmpeg-builds}"
|
||||
|
||||
to_df() {
|
||||
printf "$@" >> Dockerfile
|
||||
echo >> Dockerfile
|
||||
}
|
||||
|
||||
REPO="${REPO,,}"
|
||||
|
||||
to_df "FROM $REPO/base-$TARGET:latest"
|
||||
to_df "ENV TARGET $TARGET"
|
||||
to_df "ENV VARIANT $VARIANT"
|
||||
to_df "ENV REPO $REPO"
|
||||
to_df "ENV FFPREFIX /opt/ffbuild"
|
||||
|
||||
for script in scripts.d/*.sh; do
|
||||
(
|
||||
SELF="$script"
|
||||
source $script
|
||||
ffbuild_relevant || exit 0
|
||||
ffbuild_dockerstage || exit $?
|
||||
)
|
||||
done
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
|
||||
X264_REPO="https://code.videolan.org/videolan/x264.git"
|
||||
X264_COMMIT="db0d417728460c647ed4a847222a535b00d3dbcb"
|
||||
|
||||
ffbuild_relevant() {
|
||||
[[ $VARIANT == gpl ]] || return -1
|
||||
return 0
|
||||
}
|
||||
|
||||
ffbuild_dockerstage() {
|
||||
to_df "ADD $SELF /root/x264.sh"
|
||||
to_df "RUN bash -c 'source /root/x264.sh && ffbuild_dockerbuild'"
|
||||
}
|
||||
|
||||
ffbuild_dockerbuild() {
|
||||
git clone "$X264_REPO" x264 || return -1
|
||||
pushd x264
|
||||
git checkout "$X264_COMMIT" || return -1
|
||||
|
||||
if [[ $TARGET == win64 ]]; then
|
||||
./configure --disable-cli --enable-static --enable-pic \
|
||||
--disable-lavf --disable-swscale \
|
||||
--host=x86_64-w64-mingw32 --cross-prefix=x86_64-w64-mingw32- \
|
||||
--prefix="$FFPREFIX" || return -1
|
||||
else
|
||||
echo "Unknown target"
|
||||
return -1
|
||||
fi
|
||||
|
||||
make -j$(nproc) || return -1
|
||||
make install || return -1
|
||||
|
||||
popd
|
||||
rm -rf x264
|
||||
}
|
Loading…
Reference in a new issue