Use cmake for SDL, add more X11 dependencies
This commit is contained in:
		
							parent
							
								
									3efcb24f50
								
							
						
					
					
						commit
						5aa01f37e3
					
				
					 8 changed files with 268 additions and 31 deletions
				
			
		
							
								
								
									
										36
									
								
								scripts.d/45-x11/50-libxi.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										36
									
								
								scripts.d/45-x11/50-libxi.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										36
									
								
								scripts.d/45-x11/50-libxinerama.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										36
									
								
								scripts.d/45-x11/50-libxinerama.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										36
									
								
								scripts.d/45-x11/50-libxrender.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										36
									
								
								scripts.d/45-x11/50-libxrender.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										36
									
								
								scripts.d/45-x11/50-libxscrnsaver.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										36
									
								
								scripts.d/45-x11/50-libxscrnsaver.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										36
									
								
								scripts.d/45-x11/50-libxxf86vm.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										36
									
								
								scripts.d/45-x11/50-libxxf86vm.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										36
									
								
								scripts.d/45-x11/60-libxcursor.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										36
									
								
								scripts.d/45-x11/60-libxcursor.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										36
									
								
								scripts.d/45-x11/60-libxrandr.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										36
									
								
								scripts.d/45-x11/60-libxrandr.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,40 +1,33 @@
 | 
				
			||||||
#!/bin/bash
 | 
					#!/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() {
 | 
					ffbuild_enabled() {
 | 
				
			||||||
    return 0
 | 
					    return 0
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ffbuild_dockerbuild() {
 | 
					ffbuild_dockerbuild() {
 | 
				
			||||||
    mkdir sdl
 | 
					    git-mini-clone "$SDL_REPO" "$SDL_COMMIT" sdl
 | 
				
			||||||
    cd sdl
 | 
					    cd sdl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wget "$SDL_SRC" -O SDL.tar.gz
 | 
					    mkdir build && cd build
 | 
				
			||||||
    tar xaf SDL.tar.gz
 | 
					 | 
				
			||||||
    rm SDL.tar.gz
 | 
					 | 
				
			||||||
    cd SDL*
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ./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=(
 | 
					    exit 1
 | 
				
			||||||
        --prefix="$FFBUILD_PREFIX"
 | 
					 | 
				
			||||||
        --disable-shared
 | 
					 | 
				
			||||||
        --enable-static
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [[ $TARGET == win* || $TARGET == linux* ]]; then
 | 
					    ninja -j$(nproc)
 | 
				
			||||||
        myconf+=(
 | 
					    ninja install
 | 
				
			||||||
            --host="$FFBUILD_TOOLCHAIN"
 | 
					
 | 
				
			||||||
        )
 | 
					    if [[ $TARGET == linux* ]]; then
 | 
				
			||||||
    else
 | 
					        sed -ri -e 's/ \-l\/.+?\.a//g' \
 | 
				
			||||||
        echo "Unknown target"
 | 
					            "$FFBUILD_PREFIX"/lib/pkgconfig/sdl2.pc
 | 
				
			||||||
        return -1
 | 
					        echo 'Requires: xxf86vm xscrnsaver xrandr xfixes xi xinerama xcursor' >> "$FFBUILD_PREFIX"/lib/pkgconfig/sdl2.pc
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					 | 
				
			||||||
    ./configure "${myconf[@]}"
 | 
					 | 
				
			||||||
    make -j$(nproc)
 | 
					 | 
				
			||||||
    make install
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ffbuild_configure() {
 | 
					ffbuild_configure() {
 | 
				
			||||||
| 
						 | 
					@ -44,11 +37,3 @@ ffbuild_configure() {
 | 
				
			||||||
ffbuild_unconfigure() {
 | 
					ffbuild_unconfigure() {
 | 
				
			||||||
    echo --disable-sdl2
 | 
					    echo --disable-sdl2
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
ffbuild_cflags() {
 | 
					 | 
				
			||||||
    return 0
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ffbuild_ldflags() {
 | 
					 | 
				
			||||||
    return 0
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue