FFmpeg-Builds/scripts.d/45-vulkan.sh

53 lines
1.3 KiB
Bash
Raw Normal View History

2020-09-07 15:40:37 +00:00
#!/bin/bash
2020-09-07 19:32:38 +00:00
LOADER_REPO="https://github.com/BtbN/Vulkan-Loader.git"
2021-02-19 16:08:32 +00:00
LOADER_COMMIT="8697146b15fe9accbd38527687e2059eebbab495"
2020-09-07 15:40:37 +00:00
ffbuild_enabled() {
2020-09-27 21:15:17 +00:00
[[ $ADDINS_STR != *vulkan* ]] && return -1
2020-09-07 15:40:37 +00:00
return 0
}
ffbuild_dockerstage() {
to_df "ADD $SELF /stage.sh"
to_df "RUN run_stage"
}
ffbuild_dockerbuild() {
mkdir vulkan && cd vulkan
2020-09-27 14:17:47 +00:00
git-mini-clone "$LOADER_REPO" "$LOADER_COMMIT" loader
2020-09-07 19:32:38 +00:00
HEADERS_REPO="$(grep -A10 'name.*:.*Vulkan-Headers' loader/scripts/known_good.json | grep url | head -n1 | cut -d'"' -f4)"
HEADERS_COMMIT="$(grep -A10 'name.*:.*Vulkan-Headers' loader/scripts/known_good.json | grep commit | head -n1 | cut -d'"' -f4)"
git-mini-clone "$HEADERS_REPO" "$HEADERS_COMMIT" headers
cd headers
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" ..
make -j$(nproc)
make install
cd ../../loader
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DBUILD_TESTS=OFF ..
make -j$(nproc)
make install
2020-09-07 15:40:37 +00:00
cd ..
rm -rf vulkan
}
ffbuild_configure() {
echo --enable-vulkan
}
ffbuild_unconfigure() {
echo --disable-vulkan
}