134 lines
3.6 KiB
Bash
134 lines
3.6 KiB
Bash
# Template file for 'SDL2'
|
|
pkgname=SDL2
|
|
version=2.26.3
|
|
revision=1
|
|
build_style=cmake
|
|
configure_args="-DSDL_ALSA=ON -DSDL_ESD=OFF -DSDL_RPATH=OFF
|
|
-DSDL_CLOCK_GETTIME=ON -DSDL_PULSEAUDIO_SHARED=OFF
|
|
-DSDL_ALSA_SHARED=OFF -DSDL_DBUS=ON"
|
|
hostmakedepends="pkg-config nasm"
|
|
makedepends="alsa-lib-devel dbus-devel eudev-libudev-devel libusb-compat-devel
|
|
libsamplerate-devel"
|
|
short_desc="Simple DirectMedia Layer (version 2)"
|
|
maintainer="André Cerqueira <acerqueira021@gmail.com>"
|
|
license="Zlib"
|
|
homepage="https://www.libsdl.org/"
|
|
changelog="https://raw.githubusercontent.com/libsdl-org/SDL/SDL2/WhatsNew.txt"
|
|
distfiles="https://www.libsdl.org/release/SDL2-${version}.tar.gz"
|
|
checksum=c661205a553b7d252425f4b751ff13209e5e020b876bbfa1598494af61790057
|
|
|
|
# Package build options
|
|
build_options="gles opengl pulseaudio pipewire sndio vulkan wayland x11"
|
|
build_options_default="gles opengl pulseaudio sndio vulkan wayland x11"
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
arm*)
|
|
build_options+=" rpi"
|
|
;;
|
|
esac
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
ppcle*) ;;
|
|
*) build_options_default+=" pipewire";;
|
|
esac
|
|
|
|
# SDL_cpuinfo includes altivec.h, which breaks C++ programs with vector keyword
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
ppc*) configure_args+=" -DSDL_ALTIVEC=OFF";;
|
|
*) ;;
|
|
esac
|
|
|
|
unset depends
|
|
|
|
if [ "$build_option_gles" ]; then
|
|
configure_args+=" -DSDL_OPENGLES=ON"
|
|
# libGLESv2.so.2 is dynamically loaded with dlopen.
|
|
shlib_requires="libGLESv2.so.2"
|
|
depends+=" virtual?libGLES"
|
|
else
|
|
configure_args+=" -DSDL_OPENGLES=OFF"
|
|
fi
|
|
|
|
if [ "$build_option_rpi" ]; then
|
|
# RaspberryPi, use Videocore IV
|
|
configure_args+=" -DSDL_OPENGLES=ON"
|
|
makedepends+=" rpi-userland-devel"
|
|
CFLAGS="-I${XBPS_CROSS_BASE}/opt/vc/include -I${XBPS_CROSS_BASE}/opt/vc/include/interface/vcos/pthreads"
|
|
LDFLAGS="-L${XBPS_CROSS_BASE}/opt/vc/lib -Wl,-rpath=/opt/vc/lib"
|
|
fi
|
|
|
|
if [ "$build_option_opengl" ]; then
|
|
# libGL.so.1 is dynamically loaded with dlopen.
|
|
shlib_requires+=" libGL.so.1"
|
|
depends+=" virtual?libGL"
|
|
configure_args+=" -DSDL_OPENGL=ON"
|
|
else
|
|
configure_args+=" -DSDL_OPENGL=OFF"
|
|
fi
|
|
|
|
if [ "$build_option_opengl" -o "$build_option_gles" ]; then
|
|
makedepends+=" glu-devel"
|
|
fi
|
|
|
|
if [ "$build_option_pulseaudio" ]; then
|
|
configure_args+=" -DSDL_PULSEAUDIO=ON"
|
|
makedepends+=" pulseaudio-devel"
|
|
else
|
|
configure_args+=" -DSDL_PULSEAUDIO=OFF"
|
|
fi
|
|
|
|
if [ "$build_option_pipewire" ]; then
|
|
configure_args+=" -DSDL_PIPEWIRE=ON"
|
|
makedepends+=" pipewire-devel"
|
|
else
|
|
configure_args+=" -DSDL_PIPEWIRE=OFF"
|
|
fi
|
|
|
|
if [ "$build_option_sndio" ]; then
|
|
configure_args+=" -DSDL_SNDIO=ON"
|
|
makedepends+=" sndio-devel"
|
|
else
|
|
configure_args+=" -DSDL_SNDIO=OFF"
|
|
fi
|
|
|
|
if [ "$build_option_wayland" ]; then
|
|
if [ -z "$build_option_gles" ]; then
|
|
msg_error "$pkgname: wayland option requires gles.\n"
|
|
fi
|
|
configure_args+=" -DSDL_WAYLAND=ON -DSDL_WAYLAND_SHARED=OFF -DSDL_WAYLAND_LIBDECOR=ON"
|
|
makedepends+=" libxkbcommon-devel libdecor-devel wayland-devel wayland-protocols"
|
|
if [ "$CROSS_BUILD" ]; then
|
|
hostmakedepends+=" wayland-devel"
|
|
fi
|
|
else
|
|
configure_args+=" -DSDL_WAYLAND=OFF"
|
|
fi
|
|
|
|
if [ "$build_option_x11" ]; then
|
|
configure_args+=" -DSDL_X11=ON -DSDL_X11_SHARED=OFF"
|
|
makedepends+=" libSM-devel libXcursor-devel libXScrnSaver-devel libXrandr-devel"
|
|
else
|
|
configure_args+=" -DSDL_X11=OFF"
|
|
fi
|
|
|
|
if [ "$build_option_vulkan" ]; then
|
|
configure_args+=" -DSDL_VULKAN=ON"
|
|
makedepends+=" Vulkan-Headers vulkan-loader"
|
|
else
|
|
configure_args+=" -DSDL_VULKAN=OFF"
|
|
fi
|
|
|
|
SDL2-devel_package() {
|
|
short_desc+=" - development files"
|
|
depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
|
|
pkg_install() {
|
|
vmove usr/bin
|
|
vmove usr/include
|
|
vmove usr/lib/cmake
|
|
vmove usr/lib/pkgconfig
|
|
vmove "usr/lib/*.a"
|
|
vmove "usr/lib/*.so"
|
|
vmove usr/share
|
|
}
|
|
}
|