From f48d93e4708bd8df3b8fb92d276c83cf15d7e2fe Mon Sep 17 00:00:00 2001 From: BtbN Date: Wed, 14 Jul 2021 23:44:25 +0200 Subject: [PATCH] Add X11 and all of its friends --- .../00-xorg-macros.sh => 10-xorg-macros.sh} | 7 ++- scripts.d/45-x11/10-xcbproto.sh | 33 +++++++++++++ scripts.d/45-x11/10-xproto.sh | 33 +++++++++++++ scripts.d/45-x11/10-xtrans.sh | 38 +++++++++++++++ scripts.d/45-x11/20-libxau.sh | 36 ++++++++++++++ scripts.d/45-x11/30-libxcb.sh | 45 ++++++++++++++++++ scripts.d/45-x11/40-libx11.sh | 42 +++++++++++++++++ scripts.d/45-x11/50-libxext.sh | 40 ++++++++++++++++ scripts.d/45-x11/50-libxfixes.sh | 36 ++++++++++++++ scripts.d/45-x11/60-libxv.sh | 47 +++++++++++++++++++ scripts.d/50-vaapi/50-libva.sh | 2 +- 11 files changed, 357 insertions(+), 2 deletions(-) rename scripts.d/{50-vaapi/00-xorg-macros.sh => 10-xorg-macros.sh} (63%) create mode 100755 scripts.d/45-x11/10-xcbproto.sh create mode 100755 scripts.d/45-x11/10-xproto.sh create mode 100755 scripts.d/45-x11/10-xtrans.sh create mode 100755 scripts.d/45-x11/20-libxau.sh create mode 100755 scripts.d/45-x11/30-libxcb.sh create mode 100755 scripts.d/45-x11/40-libx11.sh create mode 100755 scripts.d/45-x11/50-libxext.sh create mode 100755 scripts.d/45-x11/50-libxfixes.sh create mode 100755 scripts.d/45-x11/60-libxv.sh diff --git a/scripts.d/50-vaapi/00-xorg-macros.sh b/scripts.d/10-xorg-macros.sh similarity index 63% rename from scripts.d/50-vaapi/00-xorg-macros.sh rename to scripts.d/10-xorg-macros.sh index 4978323..328b9e5 100755 --- a/scripts.d/50-vaapi/00-xorg-macros.sh +++ b/scripts.d/10-xorg-macros.sh @@ -8,12 +8,17 @@ ffbuild_enabled() { return 0 } +ffbuild_dockerlayer() { + to_df "COPY --from=${SELFLAYER} \$FFBUILD_PREFIX/. \$FFBUILD_PREFIX" + to_df "COPY --from=${SELFLAYER} \$FFBUILD_PREFIX/share/aclocal/. /usr/share/aclocal" +} + ffbuild_dockerbuild() { git-mini-clone "$XORGMACROS_REPO" "$XORGMACROS_COMMIT" xorg-macros cd xorg-macros autoreconf -i - ./configure --prefix="/usr" + ./configure --prefix="$FFBUILD_PREFIX" make -j"$(nproc)" make install } diff --git a/scripts.d/45-x11/10-xcbproto.sh b/scripts.d/45-x11/10-xcbproto.sh new file mode 100755 index 0000000..5dfecf8 --- /dev/null +++ b/scripts.d/45-x11/10-xcbproto.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +XCBPROTO_REPO="https://gitlab.freedesktop.org/xorg/proto/xcbproto.git" +XCBPROTO_COMMIT="496e3ce329c3cc9b32af4054c30fa0f306deb007" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$XCBPROTO_REPO" "$XCBPROTO_COMMIT" xcbproto + cd xcbproto + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + ) + + if [[ $TARGET == linux* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install +} diff --git a/scripts.d/45-x11/10-xproto.sh b/scripts.d/45-x11/10-xproto.sh new file mode 100755 index 0000000..b398f35 --- /dev/null +++ b/scripts.d/45-x11/10-xproto.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +XPROTO_REPO="https://gitlab.freedesktop.org/xorg/proto/xorgproto.git" +XPROTO_COMMIT="a0ed054ee2c334941dfe9eaa7bcfdbbe6907e1b5" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$XPROTO_REPO" "$XPROTO_COMMIT" xproto + cd xproto + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + ) + + if [[ $TARGET == linux* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install +} diff --git a/scripts.d/45-x11/10-xtrans.sh b/scripts.d/45-x11/10-xtrans.sh new file mode 100755 index 0000000..bb72f3f --- /dev/null +++ b/scripts.d/45-x11/10-xtrans.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +LIBXTRANS_REPO="https://gitlab.freedesktop.org/xorg/lib/libxtrans.git" +LIBXTRANS_COMMIT="3b5df889f58a99980a35a7b4a18eb4e7d2abeac4" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXTRANS_REPO" "$LIBXTRANS_COMMIT" libxtrans + cd libxtrans + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + --without-xmlto + --without-fop + --without-xsltproc + ) + + if [[ $TARGET == linux* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install + + cp -r "$FFBUILD_PREFIX"/share/aclocal/. /usr/share/aclocal +} diff --git a/scripts.d/45-x11/20-libxau.sh b/scripts.d/45-x11/20-libxau.sh new file mode 100755 index 0000000..8d75b7a --- /dev/null +++ b/scripts.d/45-x11/20-libxau.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIBXAU_REPO="https://gitlab.freedesktop.org/xorg/lib/libxau.git" +LIBXAU_COMMIT="d9443b2c57b512cfb250b35707378654d86c7dea" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXAU_REPO" "$LIBXAU_COMMIT" libxau + cd libxau + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + --disable-shared + --enable-static + --with-pic + ) + + if [[ $TARGET == linux* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install +} diff --git a/scripts.d/45-x11/30-libxcb.sh b/scripts.d/45-x11/30-libxcb.sh new file mode 100755 index 0000000..0c897e4 --- /dev/null +++ b/scripts.d/45-x11/30-libxcb.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +LIBXCB_REPO="https://gitlab.freedesktop.org/xorg/lib/libxcb.git" +LIBXCB_COMMIT="21414e7c447f18224c577ed5e32bd5d6e45c44f9" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXCB_REPO" "$LIBXCB_COMMIT" libxcb + cd libxcb + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + --disable-shared + --enable-static + --with-pic + --disable-devel-docs + ) + + if [[ $TARGET == linux* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install +} + +ffbuild_configure() { + echo --enable-libxcb +} + +ffbuild_unconfigure() { + echo --disable-libxcb +} diff --git a/scripts.d/45-x11/40-libx11.sh b/scripts.d/45-x11/40-libx11.sh new file mode 100755 index 0000000..f6a24fb --- /dev/null +++ b/scripts.d/45-x11/40-libx11.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +LIBX11_REPO="https://gitlab.freedesktop.org/xorg/lib/libx11.git" +LIBX11_COMMIT="d01d23374107f6fc55511f02559cf75be7bdf448" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBX11_REPO" "$LIBX11_COMMIT" libx11 + cd libx11 + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + --disable-shared + --enable-static + --with-pic + --without-xmlto + --without-fop + --without-xsltproc + --without-lint + --disable-specs + --enable-ipv6 + ) + + if [[ $TARGET == linux* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install +} diff --git a/scripts.d/45-x11/50-libxext.sh b/scripts.d/45-x11/50-libxext.sh new file mode 100755 index 0000000..fdbed2f --- /dev/null +++ b/scripts.d/45-x11/50-libxext.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +LIBXEXT_REPO="https://gitlab.freedesktop.org/xorg/lib/libxext.git" +LIBXEXT_COMMIT="47904063048fa6ef6e8e16219ddef4d14d5d9a4b" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXEXT_REPO" "$LIBXEXT_COMMIT" libxext + cd libxext + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + --disable-shared + --enable-static + --with-pic + --without-xmlto + --without-fop + --without-xsltproc + --without-lint + ) + + if [[ $TARGET == linux* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install +} diff --git a/scripts.d/45-x11/50-libxfixes.sh b/scripts.d/45-x11/50-libxfixes.sh new file mode 100755 index 0000000..a7236e4 --- /dev/null +++ b/scripts.d/45-x11/50-libxfixes.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIBXFIXES_REPO="https://gitlab.freedesktop.org/xorg/lib/libxfixes.git" +LIBXFIXES_COMMIT="6fe3bd64dd82f704ed91478acb4c99ab5c00be16" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXFIXES_REPO" "$LIBXFIXES_COMMIT" libxfixes + cd libxfixes + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + --disable-shared + --enable-static + --with-pic + ) + + if [[ $TARGET == linux* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install +} diff --git a/scripts.d/45-x11/60-libxv.sh b/scripts.d/45-x11/60-libxv.sh new file mode 100755 index 0000000..3f30548 --- /dev/null +++ b/scripts.d/45-x11/60-libxv.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +LIBXV_REPO="https://gitlab.freedesktop.org/xorg/lib/libxv.git" +LIBXV_COMMIT="03a6f599d060591a9a7cd8558bd2143a1c7c70d7" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + [[ $ADDINS_STR == *4.4* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXV_REPO" "$LIBXV_COMMIT" libxv + cd libxv + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + --disable-shared + --enable-static + --with-pic + --without-lint + ) + + if [[ $TARGET == linux* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install +} + +ffbuild_configure() { + # Needs a patch to FFmpeg to fix static linking first + echo #--enable-xlib +} + +ffbuild_unconfigure() { + echo --disable-xlib +} diff --git a/scripts.d/50-vaapi/50-libva.sh b/scripts.d/50-vaapi/50-libva.sh index ff9c770..54bf69b 100755 --- a/scripts.d/50-vaapi/50-libva.sh +++ b/scripts.d/50-vaapi/50-libva.sh @@ -21,7 +21,7 @@ ffbuild_dockerbuild() { --with-pic --disable-docs --enable-drm - --disable-x11 + --enable-x11 --disable-glx --disable-wayland )