2020-09-03 20:49:43 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
X265_REPO="https://github.com/videolan/x265.git"
|
|
|
|
X265_COMMIT="ac186359c3706f63579b2291cd2dc84f6e17a336"
|
|
|
|
|
|
|
|
ffbuild_enabled() {
|
|
|
|
[[ $VARIANT == gpl* ]] || return -1
|
|
|
|
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-03 20:49:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_dockerbuild() {
|
|
|
|
git clone "$X265_REPO" x265 || return -1
|
|
|
|
cd x265
|
|
|
|
git checkout "$X265_COMMIT" || return -1
|
|
|
|
|
|
|
|
mkdir 8bit 10bit 12bit
|
|
|
|
|
|
|
|
cd 12bit
|
2020-09-05 14:38:11 +00:00
|
|
|
cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON ../source || return -1
|
2020-09-03 20:49:43 +00:00
|
|
|
make -j$(nproc) || return -1
|
|
|
|
cp libx265.a ../8bit/libx265_main12.a
|
|
|
|
|
|
|
|
cd ../10bit
|
2020-09-05 14:38:11 +00:00
|
|
|
cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF ../source || return -1
|
2020-09-03 20:49:43 +00:00
|
|
|
make -j$(nproc) || return -1
|
|
|
|
cp libx265.a ../8bit/libx265_main10.a
|
|
|
|
|
|
|
|
cd ../8bit
|
2020-09-05 14:38:11 +00:00
|
|
|
cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON -DENABLE_SHARED=OFF -DENABLE_CLI=OFF ../source || return -1
|
2020-09-03 20:49:43 +00:00
|
|
|
make -j$(nproc) || return -1
|
|
|
|
mv libx265.a libx265_main.a
|
|
|
|
|
|
|
|
${FFBUILD_CROSS_PREFIX}ar -M <<EOF
|
|
|
|
CREATE libx265.a
|
|
|
|
ADDLIB libx265_main.a
|
|
|
|
ADDLIB libx265_main10.a
|
|
|
|
ADDLIB libx265_main12.a
|
|
|
|
SAVE
|
|
|
|
END
|
|
|
|
EOF
|
|
|
|
|
|
|
|
make install || return -1
|
|
|
|
|
|
|
|
cd ../..
|
|
|
|
rm -rf x265
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_configure() {
|
|
|
|
echo --enable-libx265
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_unconfigure() {
|
|
|
|
echo --disable-libx265
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_cflags() {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_ldflags() {
|
|
|
|
return 0
|
|
|
|
}
|