void-packages/srcpkgs/SDL2/template

125 lines
3.5 KiB
Bash

# Template file for 'SDL2'
pkgname=SDL2
version=2.0.9
revision=2
build_style=gnu-configure
configure_args="--enable-alsa --disable-esd --disable-rpath --enable-libudev
--enable-clock_gettime --disable-nas --disable-arts --disable-x11-shared
--disable-alsa-shared --disable-pulseaudio-shared --enable-dbus"
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="Juan RP <xtraeme@voidlinux.org>"
license="Zlib"
homepage="http://www.libsdl.org/"
distfiles="http://www.libsdl.org/release/${pkgname}-${version}.tar.gz"
checksum=255186dc676ecd0c1dbf10ec8a2cc5d6869b5079d8a38194c2aecdff54b324b1
# Package build options
build_options="gles opengl pulseaudio sndio wayland x11 vulkan"
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*|ppc*)
build_options_default="opengl pulseaudio x11 vulkan sndio"
;;
aarch64*)
build_options_default="gles opengl pulseaudio x11 sndio"
;;
arm*)
# Enable OpenGL/ES on rpi platforms
build_options_default="gles sndio"
;;
esac
# SDL_cpuinfo includes altivec.h, which breaks C++ programs with vector keyword
case "$XBPS_TARGET_MACHINE" in
ppc*) configure_args+=" --disable-altivec";;
*) ;;
esac
if [ "$build_option_gles" ]; then
configure_args+=" --enable-video-opengles"
case "$XBPS_TARGET_MACHINE" in
armv[67]*)
# RaspberryPi, use Videocore IV
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"
;;
*)
# libGLESv2.so.2 is dynamically loaded with dlopen.
shlib_requires="libGLESv2.so.2"
makedepends+=" glu-devel"
depends="libGLES"
;;
esac
else
configure_args+=" --disable-video-opengles"
fi
if [ "$build_option_opengl" ]; then
# libGL.so.1 is dynamically loaded with dlopen.
shlib_requires="libGL.so.1"
depends="libGL"
configure_args+=" --enable-video-opengl"
makedepends+=" glu-devel"
else
configure_args+=" --disable-video-opengl"
fi
if [ "$build_option_pulseaudio" ]; then
configure_args+=" --enable-pulseaudio"
makedepends+=" pulseaudio-devel"
else
configure_args+=" --disable-pulseaudio"
fi
if [ "$build_option_sndio" ]; then
configure_args+=" --enable-sndio"
makedepends+=" sndio-devel"
else
configure_args+=" --disable-sndio"
fi
if [ "$build_option_wayland" ]; then
if [ "$build_option_opengl" ]; then
msg_error "$pkgname: wayland option requires gles and not opengl.\n"
fi
configure_args+=" --enable-video-wayland --disable-wayland-shared"
makedepends+=" libxkbcommon-devel wayland-devel wayland-protocols"
else
configure_args+=" --disable-video-wayland"
fi
if [ "$build_option_x11" ]; then
configure_args+=" --enable-video-x11-xcursor --enable-video-x11-xrandr
--enable-video-x11-xinerama --enable-video-x11-vm
--enable-video-x11-xinput --enable-video-x11-scrnsaver
--enable-video-x11-xshape"
makedepends+=" libSM-devel libXcursor-devel libXinerama-devel libXScrnSaver-devel libXrandr-devel"
else
configure_args+=" --without-x"
fi
if [ "$build_option_vulkan" ]; then
configure_args+=" --enable-video-vulkan"
makedepends+=" Vulkan-Headers vulkan-loader"
else
configure_args+=" --disable-video-vulkan"
fi
SDL2-devel_package() {
short_desc+=" - development files"
depends="alsa-lib-devel ${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
}
}