Closed mumbaicat closed 3 years ago
Hi @mumbaicat! Have you tried compiling SDL2 from source? I have provided instructions below.
Create a workspace directory and go to that directory.
mkdir sdl2-builds
cd sdl2-builds
Download SDL2 and extract it.
wget https://libsdl.org/release/SDL2-2.0.14.zip
unzip SDL2-2.0.14.zip
Install build tools
apt install -y make {gcc,g++}-mipsel-linux-gnu
build-SDL2-linux-mipsel.sh
) using the content below. I adapted this from our current build script for ARM static libraries so perhaps you may want to tweak it. After the script is created, run it with sh build-SDL2-linux-mipsel.sh
.
#!/usr/bin/env bash
TARGET="mipsel-linux-gnu" SDL2_VERSION=2.0.14 LIBDIR=build/.libs
cd SDL2-${SDL2_VERSION} rm -r build-linux-mipsel 2> /dev/null
export CC="${TARGET}-gcc" export CXX="${TARGET}-g++"
mkdir -p build-linux-mipsel && cd build-linux-mipsel ../configure --prefix="$HOME/.${TARGET}" --host="${TARGET}" --disable-video-wayland --disable-video-vivante --disable-video-rpi --enable-video-x11 --enable-video-opengl --disable-video-kmsdrm --disable-pulseaudio --enable-video-opengles make -j$(nproc) make install cp ${LIBDIR}/libSDL2.a ${LIBDIR}/libSDL2.a.debug ${TARGET}-strip ${LIBDIR}/libSDL2.a ${TARGET}-ranlib ${LIBDIR}/libSDL2.a
cd ..
5. Update `PKG_CONFIG_PATH` to include the path to the mipsel version of SDL2 in `~/.profile` using the following content. Then activate it with `source ~/.profile`
export PKG_CONFIG_PATH="$HOME/.mipsel-linux-gnu/lib/pkgconfig:$PKG_CONFIG_PATH"
6. Try building go-sdl2 again!
It's running successfully. It's a perfect help. Thank you.
WSL2 ubuntu Ubuntu 20.04.2 LTS go version go1.16.4 linux/amd64
run it