diff --git a/scripts.d/45-x11/50-libxi.sh b/scripts.d/45-x11/50-libxi.sh new file mode 100755 index 0000000..9c28679 --- /dev/null +++ b/scripts.d/45-x11/50-libxi.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIBXI_REPO="https://gitlab.freedesktop.org/xorg/lib/libxi.git" +LIBXI_COMMIT="f24d7f43ab4d97203e60677a3d42e11dbc80c8b4" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXI_REPO" "$LIBXI_COMMIT" libxi + cd libxi + + 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/50-libxinerama.sh b/scripts.d/45-x11/50-libxinerama.sh new file mode 100755 index 0000000..2e80a09 --- /dev/null +++ b/scripts.d/45-x11/50-libxinerama.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIBXINERAMA_REPO="https://gitlab.freedesktop.org/xorg/lib/libxinerama.git" +LIBXINERAMA_COMMIT="c5187f076d16601c15c59c5a2f05c0513d9f042b" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXINERAMA_REPO" "$LIBXINERAMA_COMMIT" libxinerama + cd libxinerama + + 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/50-libxrender.sh b/scripts.d/45-x11/50-libxrender.sh new file mode 100755 index 0000000..fd957ef --- /dev/null +++ b/scripts.d/45-x11/50-libxrender.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIBXRENDER_REPO="https://gitlab.freedesktop.org/xorg/lib/libxrender.git" +LIBXRENDER_COMMIT="bce0618839fc33f44edd8b5498b8e33d167806ff" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXRENDER_REPO" "$LIBXRENDER_COMMIT" libxrender + cd libxrender + + 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/50-libxscrnsaver.sh b/scripts.d/45-x11/50-libxscrnsaver.sh new file mode 100755 index 0000000..b041b52 --- /dev/null +++ b/scripts.d/45-x11/50-libxscrnsaver.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIBXSCRNSAVER_REPO="https://gitlab.freedesktop.org/xorg/lib/libxscrnsaver.git" +LIBXSCRNSAVER_COMMIT="aa9fd5061d0a8832480ad0c1acc9d2e864e807f4" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXSCRNSAVER_REPO" "$LIBXSCRNSAVER_COMMIT" libxscrnsaver + cd libxscrnsaver + + 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/50-libxxf86vm.sh b/scripts.d/45-x11/50-libxxf86vm.sh new file mode 100755 index 0000000..c7e07b0 --- /dev/null +++ b/scripts.d/45-x11/50-libxxf86vm.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIBXXF86VM_REPO="https://gitlab.freedesktop.org/xorg/lib/libxxf86vm.git" +LIBXXF86VM_COMMIT="7f43cd2a905e7b93b83c9ce81dabb768f6fa2bc7" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXXF86VM_REPO" "$LIBXXF86VM_COMMIT" libxxf86vm + cd libxxf86vm + + 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-libxcursor.sh b/scripts.d/45-x11/60-libxcursor.sh new file mode 100755 index 0000000..6d52930 --- /dev/null +++ b/scripts.d/45-x11/60-libxcursor.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIBXCURSOR_REPO="https://gitlab.freedesktop.org/xorg/lib/libxcursor.git" +LIBXCURSOR_COMMIT="801925839d26e7c8d942c5e02c4897652ead26c8" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXCURSOR_REPO" "$LIBXCURSOR_COMMIT" libxcursor + cd libxcursor + + 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-libxrandr.sh b/scripts.d/45-x11/60-libxrandr.sh new file mode 100755 index 0000000..20c0c25 --- /dev/null +++ b/scripts.d/45-x11/60-libxrandr.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +LIBXRANDR_REPO="https://gitlab.freedesktop.org/xorg/lib/libxrandr.git" +LIBXRANDR_COMMIT="55dcda4518eda8ae03ef25ea29d3c994ad71eb0a" + +ffbuild_enabled() { + [[ $TARGET != linux* ]] && return -1 + return 0 +} + +ffbuild_dockerbuild() { + git-mini-clone "$LIBXRANDR_REPO" "$LIBXRANDR_COMMIT" libxrandr + cd libxrandr + + 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/50-sdl.sh b/scripts.d/50-sdl.sh index 6f834b0..ac6cae1 100755 --- a/scripts.d/50-sdl.sh +++ b/scripts.d/50-sdl.sh @@ -1,40 +1,33 @@ #!/bin/bash -SDL_SRC="https://libsdl.org/release/SDL2-2.0.18.tar.gz" +SDL_REPO="https://github.com/libsdl-org/SDL.git" +SDL_COMMIT="615f7b4453864d9475e8b20faa78ec67be357f1e" ffbuild_enabled() { return 0 } ffbuild_dockerbuild() { - mkdir sdl + git-mini-clone "$SDL_REPO" "$SDL_COMMIT" sdl cd sdl - wget "$SDL_SRC" -O SDL.tar.gz - tar xaf SDL.tar.gz - rm SDL.tar.gz - cd SDL* + mkdir build && cd build - ./autogen.sh + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" \ + -DSDL_SHARED=OFF -DSDL_STATIC=ON -DSDL_STATIC_PIC=ON -DSDL_X11_SHARED=OFF \ + -DHAVE_XGENERICEVENT=TRUE -DSDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM=1 \ + .. - local myconf=( - --prefix="$FFBUILD_PREFIX" - --disable-shared - --enable-static - ) + exit 1 - if [[ $TARGET == win* || $TARGET == linux* ]]; then - myconf+=( - --host="$FFBUILD_TOOLCHAIN" - ) - else - echo "Unknown target" - return -1 + ninja -j$(nproc) + ninja install + + if [[ $TARGET == linux* ]]; then + sed -ri -e 's/ \-l\/.+?\.a//g' \ + "$FFBUILD_PREFIX"/lib/pkgconfig/sdl2.pc + echo 'Requires: xxf86vm xscrnsaver xrandr xfixes xi xinerama xcursor' >> "$FFBUILD_PREFIX"/lib/pkgconfig/sdl2.pc fi - - ./configure "${myconf[@]}" - make -j$(nproc) - make install } ffbuild_configure() { @@ -44,11 +37,3 @@ ffbuild_configure() { ffbuild_unconfigure() { echo --disable-sdl2 } - -ffbuild_cflags() { - return 0 -} - -ffbuild_ldflags() { - return 0 -}