2013-10-09 09:56:49 +00:00
|
|
|
# Template file for 'SDL2'
|
|
|
|
pkgname=SDL2
|
2014-03-17 07:43:04 +00:00
|
|
|
version=2.0.3
|
2015-05-27 10:16:17 +00:00
|
|
|
revision=6
|
2013-10-09 09:56:49 +00:00
|
|
|
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 libudev-devel libusb-compat-devel"
|
|
|
|
short_desc="Simple DirectMedia Layer (version 2)"
|
2015-04-10 07:16:30 +00:00
|
|
|
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
2013-10-09 09:56:49 +00:00
|
|
|
homepage="http://www.libsdl.org/"
|
|
|
|
license="zlib"
|
|
|
|
distfiles="http://www.libsdl.org/release/${pkgname}-$version.tar.gz"
|
2014-03-17 07:43:04 +00:00
|
|
|
checksum=a5a69a6abf80bcce713fa873607735fe712f44276a7f048d60a61bb2f6b3c90c
|
2013-10-09 09:56:49 +00:00
|
|
|
|
|
|
|
# Package build options
|
2014-05-23 07:44:32 +00:00
|
|
|
build_options="gles opengl pulseaudio wayland x11"
|
2013-10-09 09:56:49 +00:00
|
|
|
|
2015-05-27 10:16:17 +00:00
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
i686*|x86_64*)
|
|
|
|
# Enable OpenGL, pulseaudio and x11
|
|
|
|
build_options_default="opengl pulseaudio x11"
|
|
|
|
;;
|
|
|
|
arm*)
|
|
|
|
# Enable OpenGL/ES on rpi platforms
|
|
|
|
build_options_default="gles"
|
|
|
|
;;
|
|
|
|
esac
|
2013-10-09 09:56:49 +00:00
|
|
|
|
2014-05-23 07:44:32 +00:00
|
|
|
if [ "$build_option_gles" ]; then
|
|
|
|
configure_args+=" --enable-video-opengles"
|
2015-05-27 10:16:17 +00:00
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
armv[67]*)
|
2014-05-23 07:44:32 +00:00
|
|
|
# RaspberryPi, use Videocore IV
|
|
|
|
makedepends+=" rpi-firmware"
|
|
|
|
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"
|
2015-05-27 10:16:17 +00:00
|
|
|
;;
|
|
|
|
*)
|
2015-03-20 15:40:12 +00:00
|
|
|
# libGLESv2.so.1 is dynamically loaded with dlopen.
|
2015-03-20 15:30:40 +00:00
|
|
|
shlib_requires="libGLESv2.so.1"
|
2014-05-23 07:44:32 +00:00
|
|
|
makedepends+=" glu-devel"
|
2015-03-20 15:40:12 +00:00
|
|
|
depends="libGLES"
|
2015-05-27 10:16:17 +00:00
|
|
|
;;
|
|
|
|
esac
|
2013-10-09 09:56:49 +00:00
|
|
|
else
|
2014-05-23 07:44:32 +00:00
|
|
|
configure_args+=" --disable-video-opengles"
|
2013-10-09 09:56:49 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$build_option_opengl" ]; then
|
2014-05-23 07:44:32 +00:00
|
|
|
# libGL.so.1 is dynamically loaded with dlopen.
|
2015-01-19 10:38:43 +00:00
|
|
|
shlib_requires="libGL.so.1"
|
2015-03-20 15:40:12 +00:00
|
|
|
depends="libGL"
|
2013-10-09 09:56:49 +00:00
|
|
|
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
|
|
|
|
|
2014-05-23 07:44:32 +00:00
|
|
|
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"
|
|
|
|
else
|
|
|
|
configure_args+=" --disable-video-wayland"
|
2014-01-01 15:10:11 +00:00
|
|
|
fi
|
2014-05-23 07:44:32 +00:00
|
|
|
|
|
|
|
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"
|
2014-01-01 15:10:11 +00:00
|
|
|
fi
|
|
|
|
|
2013-10-09 09:56:49 +00:00
|
|
|
SDL2-devel_package() {
|
|
|
|
short_desc+=" - development files"
|
2015-01-19 10:38:43 +00:00
|
|
|
depends="alsa-lib-devel ${makedepends} ${sourcepkg}>=${version}_${revision}"
|
2013-10-09 09:56:49 +00:00
|
|
|
pkg_install() {
|
|
|
|
vmove usr/bin
|
|
|
|
vmove usr/include
|
|
|
|
vmove usr/lib/pkgconfig
|
|
|
|
vmove "usr/lib/*.a"
|
|
|
|
vmove "usr/lib/*.so"
|
|
|
|
vmove usr/share
|
|
|
|
}
|
|
|
|
}
|