diff --git a/scripts.d/50-mbedtls.sh b/scripts.d/50-librist/40-mbedtls.sh similarity index 92% rename from scripts.d/50-mbedtls.sh rename to scripts.d/50-librist/40-mbedtls.sh index 2a04125..5ee6bed 100755 --- a/scripts.d/50-mbedtls.sh +++ b/scripts.d/50-librist/40-mbedtls.sh @@ -2,10 +2,9 @@ MBEDTLS_REPO="https://github.com/ARMmbed/mbedtls.git" # HEAD of development_2.x -MBEDTLS_COMMIT="d599dc7f1bd26889d85092b9774cdef37e62e3c0" +MBEDTLS_COMMIT="1d7f7a7c6e625e48a4996bc751c39fb16a8be868" ffbuild_enabled() { - [[ $TARGET == win* ]] && return -1 return 0 } @@ -24,5 +23,6 @@ ffbuild_dockerbuild() { } ffbuild_configure() { + [[ $TARGET == win* ]] && return -1 echo --enable-mbedtls } diff --git a/scripts.d/50-librist/50-librist.sh b/scripts.d/50-librist/50-librist.sh new file mode 100755 index 0000000..eb3bc8b --- /dev/null +++ b/scripts.d/50-librist/50-librist.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +LIBRIST_REPO="https://code.videolan.org/rist/librist.git" +LIBRIST_COMMIT="0b1aaf995c4cad83d562ec7887180cc6ee132c84" + +ffbuild_enabled() { + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBRIST_REPO" "$LIBRIST_COMMIT" librist + cd librist + + mkdir build && cd build + + local myconf=( + --prefix="$FFBUILD_PREFIX" + --buildtype=release + --default-library=static + -Duse_mbedtls=true + -Dbuiltin_mbedtls=false + -Dbuilt_tools=false + -Dtest=false + ) + + if [[ $TARGET == win* ]]; then + myconf+=( + -Dhave_mingw_pthreads=true + ) + fi + + if [[ $TARGET == win* || $TARGET == linux* ]]; then + myconf+=( + --cross-file=/cross.meson + ) + else + echo "Unknown target" + return -1 + fi + + meson "${myconf[@]}" .. + ninja -j"$(nproc)" + ninja install +} + +ffbuild_configure() { + echo --enable-librist +} + +ffbuild_unconfigure() { + echo --disable-librist +}