2020-09-01 22:07:54 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
X264_REPO="https://code.videolan.org/videolan/x264.git"
|
2020-11-10 15:22:37 +00:00
|
|
|
X264_COMMIT="4121277b40a667665d4eea1726aefdc55d12d110"
|
2020-09-01 22:07:54 +00:00
|
|
|
|
2020-09-02 16:07:59 +00:00
|
|
|
ffbuild_enabled() {
|
2020-09-02 23:03:23 +00:00
|
|
|
[[ $VARIANT == gpl* ]] || return -1
|
2020-09-01 22:07:54 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_dockerstage() {
|
2020-09-05 14:38:11 +00:00
|
|
|
to_df "ADD $SELF /stage.sh"
|
|
|
|
to_df "RUN run_stage"
|
2020-09-01 22:07:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_dockerbuild() {
|
2020-09-05 20:34:23 +00:00
|
|
|
git-mini-clone "$X264_REPO" "$X264_COMMIT" x264
|
2020-09-01 22:07:54 +00:00
|
|
|
pushd x264
|
2020-09-03 14:56:24 +00:00
|
|
|
|
|
|
|
local myconf=(
|
|
|
|
--disable-cli
|
|
|
|
--enable-static
|
|
|
|
--enable-pic
|
|
|
|
--disable-lavf
|
|
|
|
--disable-swscale
|
|
|
|
--prefix="$FFBUILD_PREFIX"
|
|
|
|
)
|
|
|
|
|
|
|
|
if [[ $TARGET == win* ]]; then
|
|
|
|
myconf+=(
|
|
|
|
--host="$FFBUILD_TOOLCHAIN"
|
|
|
|
--cross-prefix="$FFBUILD_CROSS_PREFIX"
|
|
|
|
)
|
2020-09-01 22:07:54 +00:00
|
|
|
else
|
|
|
|
echo "Unknown target"
|
|
|
|
return -1
|
|
|
|
fi
|
|
|
|
|
2020-09-03 14:56:24 +00:00
|
|
|
./configure "${myconf[@]}" || return -1
|
2020-09-01 22:07:54 +00:00
|
|
|
make -j$(nproc) || return -1
|
|
|
|
make install || return -1
|
|
|
|
|
|
|
|
popd
|
|
|
|
rm -rf x264
|
|
|
|
}
|
2020-09-02 16:07:59 +00:00
|
|
|
|
|
|
|
ffbuild_configure() {
|
|
|
|
echo --enable-libx264
|
|
|
|
}
|
|
|
|
|
2020-09-03 19:03:34 +00:00
|
|
|
ffbuild_unconfigure() {
|
2020-09-03 17:32:54 +00:00
|
|
|
echo --disable-libx264
|
|
|
|
}
|
|
|
|
|
2020-09-02 16:07:59 +00:00
|
|
|
ffbuild_cflags() {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_ldflags() {
|
|
|
|
return 0
|
|
|
|
}
|