public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/libsdl3/
@ 2025-03-05  4:50 Ionen Wolkens
  0 siblings, 0 replies; only message in thread
From: Ionen Wolkens @ 2025-03-05  4:50 UTC (permalink / raw
  To: gentoo-commits

commit:     4685f8150932d2c04cfc8c415b567c7a6e550c15
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  3 16:43:24 2025 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Mar  5 04:48:46 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4685f815

media-libs/libsdl3: new package, add 3.2.8

Notable changes compared to libsdl2's ebuild:
* drop USE=video/sound/joystick (enabled), very little sense in
  disabling support entirely incl. dummy outputs without deps,
  and it is annoying for revdeps to need [joystick,sound,video]
  everywhere (flipping these can also drop symbols and breaks
  packages, while with the dummy ones it stays the same)
* drop USE=haptic (enabled), not *that* common of a requirement but
  is trivial and has no dependencies
* drop USE=fcitx (ignored), fcitx does not need to be present at
  build time, and support works through USE=dbus (feels redundant,
  and ebuild does not need to pull/optfeature fcitx for fcitx users)
* drop USE=xscreensaver (enabled), like other optional X libs it
  feels hardly worth a USE and being disabled by default felt subpar
* drop MULTILIB_WRAPPED_HEADERS, unless missing something, this
  seems no longer seems needed
* "tentatively" drop USE=custom-cflags, until recently there was still
  issues with flags but I believe most of these are resolved (not to
  mention most were LTO-related and strip-flags no longer filtered it
  anyway)
* merge gles1/gles2/gles3/opengl into USE=opengl, they all have the
  same dependency and it saves very little to disable unused ones
* to add to the above, drop dependency on mesa except for libgbm,
  it's not the job of the ebuild to check if drivers have support
  for each, unknown if user is even using mesa or nvidia

There are more differences but only listing those due to choices
and not due to e.g. SDL3 adding/dropping support for something.

Other notes:
* The [X?] in libglvnd[X?] is not *required* but it prevents automagic
  for the GLX support bits
* Considered dropping multilib given modern SDL3-only prebuilt games
  would not be 32bit, but there's the sdl2->3 compat lib to consider
  when we'll want it in the future and Wine may also end up needing it
  until the ebuild drops multilib support in favour of USE=wow64
* Hoping have not overlooked cases where libglvnd+vulkan-headers
  are needed (due to the unbundling inherited from libsdl2), seems
  to be always needed to build tests for one

Some changes may be worth backporting to libsdl2, but not planning
to look at that, or at least not right now.

Closes: https://bugs.gentoo.org/949110
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-libs/libsdl3/Manifest             |   1 +
 media-libs/libsdl3/libsdl3-3.2.8.ebuild | 184 ++++++++++++++++++++++++++++++++
 media-libs/libsdl3/metadata.xml         |  17 +++
 3 files changed, 202 insertions(+)

diff --git a/media-libs/libsdl3/Manifest b/media-libs/libsdl3/Manifest
new file mode 100644
index 000000000000..74fc405b5272
--- /dev/null
+++ b/media-libs/libsdl3/Manifest
@@ -0,0 +1 @@
+DIST SDL3-3.2.8.tar.gz 15866007 BLAKE2B e89f240f9643305fb191049b9162f8adfe2f59b07464df28d08437130f8724b8ac8ab22075a6548cb6d8203ec289f3a8a917c08697047f3d39377af267d8187b SHA512 741550120f26fe983fa829d38d37ff4caeded31e899e4ded99ebb5b084eecebaa4081454b8e176e0103fa7faa6a230ad3f23f8c2453c6babfe59fab981cac6db

diff --git a/media-libs/libsdl3/libsdl3-3.2.8.ebuild b/media-libs/libsdl3/libsdl3-3.2.8.ebuild
new file mode 100644
index 000000000000..401240306f28
--- /dev/null
+++ b/media-libs/libsdl3/libsdl3-3.2.8.ebuild
@@ -0,0 +1,184 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib
+
+DESCRIPTION="Simple Direct Media Layer"
+HOMEPAGE="https://www.libsdl.org/"
+SRC_URI="https://www.libsdl.org/release/SDL3-${PV}.tar.gz"
+S=${WORKDIR}/SDL3-${PV}
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="
+	X alsa aqua dbus doc ibus io-uring jack kms opengl oss pipewire
+	pulseaudio sndio static-libs test udev usb vulkan wayland
+	cpu_flags_ppc_altivec cpu_flags_x86_avx cpu_flags_x86_avx2
+	cpu_flags_x86_avx512f cpu_flags_x86_mmx cpu_flags_x86_sse
+	cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_sse4_1
+	cpu_flags_x86_sse4_2
+"
+REQUIRED_USE="
+	ibus? ( dbus )
+	kms? ( opengl )
+	wayland? ( opengl )
+"
+RESTRICT="!test? ( test )"
+
+# dlopen/dbus-only: dbus, ibus, libudev, liburing, vulkan-loader
+RDEPEND="
+	virtual/libiconv[${MULTILIB_USEDEP}]
+	X? (
+		x11-libs/libX11[${MULTILIB_USEDEP}]
+		x11-libs/libXScrnSaver[${MULTILIB_USEDEP}]
+		x11-libs/libXcursor[${MULTILIB_USEDEP}]
+		x11-libs/libXext[${MULTILIB_USEDEP}]
+		x11-libs/libXfixes[${MULTILIB_USEDEP}]
+		x11-libs/libXi[${MULTILIB_USEDEP}]
+		x11-libs/libXrandr[${MULTILIB_USEDEP}]
+	)
+	alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+	dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+	ibus? ( app-i18n/ibus )
+	io-uring? ( sys-libs/liburing:=[${MULTILIB_USEDEP}] )
+	jack? ( virtual/jack[${MULTILIB_USEDEP}] )
+	kms? (
+		media-libs/mesa[gbm(+),${MULTILIB_USEDEP}]
+		x11-libs/libdrm[${MULTILIB_USEDEP}]
+	)
+	opengl? ( media-libs/libglvnd[X?,${MULTILIB_USEDEP}] )
+	pipewire? ( media-video/pipewire:=[${MULTILIB_USEDEP}] )
+	pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
+	sndio? ( media-sound/sndio:=[${MULTILIB_USEDEP}] )
+	udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
+	usb? ( virtual/libusb:1[${MULTILIB_USEDEP}] )
+	wayland? (
+		dev-libs/wayland[${MULTILIB_USEDEP}]
+		gui-libs/libdecor[${MULTILIB_USEDEP}]
+		x11-libs/libxkbcommon[${MULTILIB_USEDEP}]
+	)
+	vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+	${RDEPEND}
+	X? ( x11-base/xorg-proto )
+	test? (
+		dev-util/vulkan-headers
+		media-libs/libglvnd
+	)
+	vulkan? ( dev-util/vulkan-headers )
+"
+BDEPEND="
+	doc? (
+		app-text/doxygen
+		media-gfx/graphviz
+	)
+	wayland? ( dev-util/wayland-scanner )
+"
+
+src_prepare() {
+	cmake_src_prepare
+
+	# unbundle libglvnd and vulkan headers
+	rm -r src/video/khronos || die
+	ln -s -- "${ESYSROOT}"/usr/include src/video/khronos || die
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DSDL_ASSERTIONS=disabled
+		-DSDL_DBUS=$(usex dbus)
+		-DSDL_DEPS_SHARED=no # link rather than dlopen() where possible
+		-DSDL_LIBURING=$(usex io-uring)
+		-DSDL_RPATH=no
+		-DSDL_STATIC=$(usex static-libs)
+		-DSDL_TESTS=$(usex test)
+
+		# audio
+		-DSDL_ALSA=$(usex alsa)
+		-DSDL_JACK=$(usex jack)
+		-DSDL_OSS=$(usex oss)
+		-DSDL_PIPEWIRE=$(usex pipewire)
+		-DSDL_PULSEAUDIO=$(usex pulseaudio)
+		-DSDL_SNDIO=$(usex sndio)
+
+		# input
+		-DSDL_HIDAPI_LIBUSB=$(usex usb)
+		-DSDL_IBUS=$(use ibus)
+		-DSDL_LIBUDEV=$(usex udev)
+
+		# video
+		-DSDL_COCOA=$(usex aqua)
+		-DSDL_DIRECTX=no
+		-DSDL_KMSDRM=$(usex kms)
+		-DSDL_OPENGL=$(usex opengl)
+		-DSDL_OPENGLES=$(usex opengl)
+		-DSDL_OPENVR=$(usex opengl) # only dependency is libglvnd
+		-DSDL_ROCKCHIP=no
+		-DSDL_RPI=no
+		-DSDL_VIVANTE=no
+		-DSDL_VULKAN=$(usex vulkan)
+		-DSDL_WAYLAND=$(usex wayland)
+		-DSDL_X11=$(usex X)
+		# SDL disallows this by default, allow it but warn in pkg_postinst
+		$(use !X && use !wayland && echo -DSDL_UNIX_CONSOLE_BUILD=yes)
+
+		# cpu instruction sets
+		-DSDL_ALTIVEC=$(usex cpu_flags_ppc_altivec)
+		-DSDL_AVX=$(usex cpu_flags_x86_avx)
+		-DSDL_AVX2=$(usex cpu_flags_x86_avx2)
+		-DSDL_AVX512F=$(usex cpu_flags_x86_avx512f)
+		-DSDL_MMX=$(usex cpu_flags_x86_mmx)
+		-DSDL_SSE=$(usex cpu_flags_x86_sse)
+		-DSDL_SSE2=$(usex cpu_flags_x86_sse2)
+		-DSDL_SSE3=$(usex cpu_flags_x86_sse3)
+		-DSDL_SSE4_1=$(usex cpu_flags_x86_sse4_1)
+		-DSDL_SSE4_2=$(usex cpu_flags_x86_sse4_2)
+	)
+
+	cmake-multilib_src_configure
+}
+
+src_compile() {
+	cmake-multilib_src_compile
+
+	if use doc; then
+		cd docs && doxygen || die
+	fi
+}
+
+src_test() {
+	unset "${!SDL_@}" # ignore users' preferences for tests
+
+	cmake-multilib_src_test
+}
+
+src_install() {
+	local DOCS=( {BUGS,WhatsNew}.txt {CREDITS,README}.md docs/*.md )
+	cmake-multilib_src_install
+
+	rm -r -- "${ED}"/usr/share/licenses || die
+
+	use doc && dodoc -r docs/output/html/
+}
+
+pkg_postinst() {
+	# skipping audio/video can make sense given many packages only use SDL
+	# for input, but still warn given off-by-default and may be unexpected
+	if use !X && use !aqua && use !kms && use !wayland; then
+		ewarn
+		ewarn "All typical display drivers (e.g. USE=wayland) are disabled,"
+		ewarn "applications using SDL for display may not function properly."
+	fi
+
+	if use !alsa && use !jack && use !oss && use !pipewire &&
+		use !pulseaudio && use !sndio; then
+		ewarn
+		ewarn "All typical audio drivers (e.g. USE=pipewire) are disabled,"
+		ewarn "applications using SDL for audio may not function properly."
+	fi
+}

diff --git a/media-libs/libsdl3/metadata.xml b/media-libs/libsdl3/metadata.xml
new file mode 100644
index 000000000000..2cea33e852d7
--- /dev/null
+++ b/media-libs/libsdl3/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>games@gentoo.org</email>
+		<name>Gentoo Games Project</name>
+	</maintainer>
+	<use>
+		<flag name="ibus">Enable support for <pkg>app-i18n/ibus</pkg></flag>
+		<flag name="kms">Enable support for direct Kernel Mode Setting video output</flag>
+		<flag name="sndio">Enable support for <pkg>media-sound/sndio</pkg></flag>
+		<flag name="pipewire">Enable support for <pkg>media-video/pipewire</pkg></flag>
+	</use>
+	<upstream>
+		<remote-id type="github">libsdl-org/SDL</remote-id>
+	</upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-05  4:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-05  4:50 [gentoo-commits] repo/gentoo:master commit in: media-libs/libsdl3/ Ionen Wolkens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox