From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1278670-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 99F3C1382C5
	for <garchives@archives.gentoo.org>; Wed,  5 May 2021 11:40:32 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id DC872E07B3;
	Wed,  5 May 2021 11:40:31 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 3C0D8E07B3
	for <gentoo-commits@lists.gentoo.org>; Wed,  5 May 2021 11:40:31 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id D5EE8335D60
	for <gentoo-commits@lists.gentoo.org>; Wed,  5 May 2021 11:40:29 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 3BA1D4D2
	for <gentoo-commits@lists.gentoo.org>; Wed,  5 May 2021 11:40:28 +0000 (UTC)
From: "Lars Wendler" <polynomial-c@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" <polynomial-c@gentoo.org>
Message-ID: <1620214817.409c40a112b1df7dbe5fec8e7370247e56632b37.polynomial-c@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libsdl2/
X-VCS-Repository: repo/gentoo
X-VCS-Files: media-libs/libsdl2/libsdl2-2.0.14-r2.ebuild media-libs/libsdl2/metadata.xml
X-VCS-Directories: media-libs/libsdl2/
X-VCS-Committer: polynomial-c
X-VCS-Committer-Name: Lars Wendler
X-VCS-Revision: 409c40a112b1df7dbe5fec8e7370247e56632b37
X-VCS-Branch: master
Date: Wed,  5 May 2021 11:40:28 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 69328422-de59-4544-8c95-2f789561492c
X-Archives-Hash: 6cd463ffa6718aedde1679e005561c2a

commit:     409c40a112b1df7dbe5fec8e7370247e56632b37
Author:     Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
AuthorDate: Wed May  5 07:05:21 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed May  5 11:40:17 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=409c40a1

media-libs/libsdl2: Add support for GLES1

Related: https://github.com/adoptware/pinball/issues/28#issuecomment-831935835
Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>
Closes: https://github.com/gentoo/gentoo/pull/20690
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 media-libs/libsdl2/libsdl2-2.0.14-r2.ebuild | 215 ++++++++++++++++++++++++++++
 media-libs/libsdl2/metadata.xml             |   1 +
 2 files changed, 216 insertions(+)

diff --git a/media-libs/libsdl2/libsdl2-2.0.14-r2.ebuild b/media-libs/libsdl2/libsdl2-2.0.14-r2.ebuild
new file mode 100644
index 00000000000..ed96babe187
--- /dev/null
+++ b/media-libs/libsdl2/libsdl2-2.0.14-r2.ebuild
@@ -0,0 +1,215 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic toolchain-funcs multilib-minimal
+
+MY_P="SDL2-${PV}"
+DESCRIPTION="Simple Direct Media Layer"
+HOMEPAGE="https://www.libsdl.org/"
+SRC_URI="https://www.libsdl.org/release/${MY_P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+IUSE="alsa aqua cpu_flags_ppc_altivec cpu_flags_x86_3dnow cpu_flags_x86_mmx cpu_flags_x86_sse cpu_flags_x86_sse2 custom-cflags dbus fcitx4 gles1 gles2 haptic ibus jack +joystick kms libsamplerate nas opengl oss pulseaudio +sound static-libs +threads udev +video video_cards_vc4 vulkan wayland X xinerama xscreensaver"
+REQUIRED_USE="
+	alsa? ( sound )
+	fcitx4? ( dbus )
+	gles1? ( video )
+	gles2? ( video )
+	ibus? ( dbus )
+	jack? ( sound )
+	nas? ( sound )
+	opengl? ( video )
+	pulseaudio? ( sound )
+	vulkan? ( video )
+	wayland? ( gles2 )
+	xinerama? ( X )
+	xscreensaver? ( X )"
+
+CDEPEND="
+	alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
+	dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
+	fcitx4? ( app-i18n/fcitx:4 )
+	gles1? ( media-libs/mesa[${MULTILIB_USEDEP},gles1] )
+	gles2? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] )
+	ibus? ( app-i18n/ibus )
+	jack? ( virtual/jack[${MULTILIB_USEDEP}] )
+	kms? (
+		>=x11-libs/libdrm-2.4.82[${MULTILIB_USEDEP}]
+		>=media-libs/mesa-9.0.0[${MULTILIB_USEDEP},gbm]
+	)
+	libsamplerate? ( media-libs/libsamplerate[${MULTILIB_USEDEP}] )
+	nas? (
+		>=media-libs/nas-1.9.4[${MULTILIB_USEDEP}]
+		>=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}]
+	)
+	opengl? (
+		>=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
+		>=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
+	)
+	pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
+	udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )
+	wayland? (
+		>=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}]
+		>=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl,gles2,wayland]
+		>=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}]
+	)
+	X? (
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
+		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
+		xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
+		xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] )
+	)"
+RDEPEND="${CDEPEND}
+	vulkan? ( media-libs/vulkan-loader )"
+DEPEND="${CDEPEND}
+	ibus? ( dev-libs/glib:2[${MULTILIB_USEDEP}] )
+	vulkan? ( dev-util/vulkan-headers )
+	X? ( x11-base/xorg-proto )
+"
+BDEPEND="
+	virtual/pkgconfig
+"
+
+MULTILIB_WRAPPED_HEADERS=(
+	/usr/include/SDL2/SDL_config.h
+	/usr/include/SDL2/SDL_platform.h
+	/usr/include/SDL2/begin_code.h
+	/usr/include/SDL2/close_code.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.0.14-static-libs.patch
+	"${FILESDIR}"/${PN}-2.0.14-vulkan.patch
+)
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+	default
+
+	# Unbundle some headers.
+	rm -r src/video/khronos || die
+	ln -s "${ESYSROOT}/usr/include" src/video/khronos || die
+
+	# SDL seems to customize SDL_config.h.in to remove macros like
+	# PACKAGE_NAME. Add AT_NOEAUTOHEADER="yes" to prevent those macros from
+	# being reintroduced.
+	# https://bugs.gentoo.org/764959
+	AT_NOEAUTOHEADER="yes" AT_M4DIR="/usr/share/aclocal acinclude" \
+		eautoreconf
+
+	# libsdl2-2.0.14 build regression. Please check if still needed
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	use custom-cflags || strip-flags
+
+	# libsdl2-2.0.14 build regression. Please check if still needed
+	append-flags -D__LINUX__
+
+	if use ibus; then
+		local -x IBUS_CFLAGS="-I${ESYSROOT}/usr/include/ibus-1.0 -I${ESYSROOT}/usr/include/glib-2.0 -I${ESYSROOT}/usr/$(get_libdir)/glib-2.0/include"
+	fi
+
+	# sorted by `./configure --help`
+	local myeconfargs=(
+		$(use_enable static-libs static)
+		--enable-atomic
+		$(use_enable sound audio)
+		$(use_enable video)
+		--enable-render
+		--enable-events
+		$(use_enable joystick)
+		$(use_enable haptic)
+		--enable-power
+		--enable-filesystem
+		$(use_enable threads)
+		--enable-timers
+		--enable-file
+		--enable-loadso
+		--enable-cpuinfo
+		--enable-assembly
+		$(use_enable cpu_flags_ppc_altivec altivec)
+		$(use_enable cpu_flags_x86_sse ssemath)
+		$(use_enable cpu_flags_x86_mmx mmx)
+		$(use_enable cpu_flags_x86_3dnow 3dnow)
+		$(use_enable cpu_flags_x86_sse sse)
+		$(use_enable cpu_flags_x86_sse2 sse2)
+		$(use_enable oss)
+		$(use_enable alsa)
+		--disable-alsa-shared
+		$(use_enable jack)
+		--disable-jack-shared
+		--disable-esd
+		$(use_enable pulseaudio)
+		--disable-pulseaudio-shared
+		--disable-arts
+		$(use_enable libsamplerate)
+		$(use_enable nas)
+		--disable-nas-shared
+		--disable-sndio
+		--disable-sndio-shared
+		$(use_enable sound diskaudio)
+		$(use_enable sound dummyaudio)
+		$(use_enable wayland video-wayland)
+		--disable-wayland-shared
+		$(use_enable video_cards_vc4 video-rpi)
+		$(use_enable X video-x11)
+		--disable-x11-shared
+		$(use_enable X video-x11-xcursor)
+		$(use_enable X video-x11-xdbe)
+		$(use_enable xinerama video-x11-xinerama)
+		$(use_enable X video-x11-xinput)
+		$(use_enable X video-x11-xrandr)
+		$(use_enable xscreensaver video-x11-scrnsaver)
+		$(use_enable X video-x11-xshape)
+		$(use_enable X video-x11-vm)
+		$(use_enable aqua video-cocoa)
+		--disable-video-directfb
+		--disable-fusionsound
+		--disable-fusionsound-shared
+		$(use_enable kms video-kmsdrm)
+		--disable-kmsdrm-shared
+		$(use_enable video video-dummy)
+		$(use_enable opengl video-opengl)
+		$(use_enable gles1 video-opengles1)
+		$(use_enable gles2 video-opengles2)
+		$(use_enable vulkan video-vulkan)
+		$(use_enable udev libudev)
+		$(use_enable dbus)
+		$(use_enable fcitx4 fcitx)
+		$(use_enable ibus)
+		--disable-directx
+		--disable-rpath
+		--disable-render-d3d
+		$(use_with X x)
+	)
+
+	#ECONF_SOURCE="${S}"
+	econf "${myeconfargs[@]}"
+}
+
+multilib_src_compile() {
+	emake V=1
+}
+
+multilib_src_install() {
+	emake DESTDIR="${D}" install
+}
+
+multilib_src_install_all() {
+	# Do not delete the static .a libraries here as some are
+	# mandatory. They may be needed even when linking dynamically.
+	find "${ED}" -type f -name "*.la" -delete || die
+	dodoc {BUGS,CREDITS,README,README-SDL,TODO,WhatsNew}.txt docs/README*.md
+}

diff --git a/media-libs/libsdl2/metadata.xml b/media-libs/libsdl2/metadata.xml
index fb417beddc0..a35fb97837a 100644
--- a/media-libs/libsdl2/metadata.xml
+++ b/media-libs/libsdl2/metadata.xml
@@ -25,6 +25,7 @@
 	</longdescription>
 	<use>
 		<flag name="fcitx4">Enable support for <pkg>app-i18n/fcitx</pkg> 4</flag>
+		<flag name="gles1">include OpenGL ES 1.0 support</flag>
 		<flag name="gles2">include OpenGL ES 2.0 support</flag>
 		<flag name="haptic">Enable the haptic (force feedback) subsystem</flag>
 		<flag name="ibus">Enable support for <pkg>app-i18n/ibus</pkg></flag>