From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 744811584AD for ; Sun, 04 May 2025 07:12:52 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 60173343164 for ; Sun, 04 May 2025 07:12:52 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 08B561104BD; Sun, 04 May 2025 07:12:23 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id F2AE81104BC for ; Sun, 04 May 2025 07:12:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A3A7D343145 for ; Sun, 04 May 2025 07:12:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 450882817 for ; Sun, 04 May 2025 07:12:19 +0000 (UTC) From: "Haelwenn Monnier" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Haelwenn Monnier" Message-ID: <1746315983.9fce85b66c3e827cfcd6c15f9240a6e2e2fa6e2f.lanodan@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: games-emulation/dosbox-x/ X-VCS-Repository: repo/proj/guru X-VCS-Files: games-emulation/dosbox-x/Manifest games-emulation/dosbox-x/dosbox-x-2025.05.03.ebuild X-VCS-Directories: games-emulation/dosbox-x/ X-VCS-Committer: lanodan X-VCS-Committer-Name: Haelwenn Monnier X-VCS-Revision: 9fce85b66c3e827cfcd6c15f9240a6e2e2fa6e2f X-VCS-Branch: master Date: Sun, 04 May 2025 07:12:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9057646d-ce78-44a7-b9e1-95d1d90f7ab8 X-Archives-Hash: f21d82edebadcc4a5bacfef6e39f356c commit: 9fce85b66c3e827cfcd6c15f9240a6e2e2fa6e2f Author: Yuan Liao gmail com> AuthorDate: Sat May 3 23:46:23 2025 +0000 Commit: Haelwenn Monnier hacktivis me> CommitDate: Sat May 3 23:46:23 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=9fce85b6 games-emulation/dosbox-x: Add 2025.05.03 Signed-off-by: Yuan Liao gmail.com> games-emulation/dosbox-x/Manifest | 1 + .../dosbox-x/dosbox-x-2025.05.03.ebuild | 216 +++++++++++++++++++++ 2 files changed, 217 insertions(+) diff --git a/games-emulation/dosbox-x/Manifest b/games-emulation/dosbox-x/Manifest index aaf6d36e5..e6714bdec 100644 --- a/games-emulation/dosbox-x/Manifest +++ b/games-emulation/dosbox-x/Manifest @@ -1 +1,2 @@ DIST dosbox-x-v2025.02.01.tar.gz 122016342 BLAKE2B 83fa9c39bb554e6c6e9079ee45ee1b0cbb61ca62291ca503690a86400f60dbdfbf1cd91955002676bce423198dab03ef9d8cc947b633266e0f70882d97c5ed96 SHA512 6832525ae08ce49a13ba277d5a26f16c2ba49331b7341b7e7bbfe330f4a082facc2e9fe8123b8bc0a6444111c947e975a1d6410f4b1fa0373eec15adf074c7c8 +DIST dosbox-x-v2025.05.03.tar.gz 122834930 BLAKE2B a153370032d8c3e8e203ac50f2c25076b017133a484af9e63f86e1f02ff7298ee6455d7a73863725e9d82c9ea3ea1ae3bf16481f6c165d2f5410d67605969fd1 SHA512 5ff487f58b0c0672bfca7f2f37a8a64635d0e55a94b2659bde845a0c6fae64558946328d854a837b51f375f4504d3fc8f76218fba199f00e2ee2f3fed6faef18 diff --git a/games-emulation/dosbox-x/dosbox-x-2025.05.03.ebuild b/games-emulation/dosbox-x/dosbox-x-2025.05.03.ebuild new file mode 100644 index 000000000..4bcf296be --- /dev/null +++ b/games-emulation/dosbox-x/dosbox-x-2025.05.03.ebuild @@ -0,0 +1,216 @@ +# Copyright 2022-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools toolchain-funcs xdg + +if [[ "${PV}" == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/joncampbell123/dosbox-x.git" +else + SRC_URI="https://github.com/joncampbell123/dosbox-x/archive/dosbox-x-v${PV}.tar.gz" + S="${WORKDIR}/${PN}-${PN}-v${PV}" + KEYWORDS="~amd64" +fi + +DESCRIPTION="Complete, accurate DOS emulator forked from DOSBox" +HOMEPAGE="https://dosbox-x.com/" + +# Stay consistent with games-emulation/dosbox::gentoo even though source file +# headers specify the GPL version to be "either version 2 of the License, or +# (at your option) any later version." The same header is used in both the +# DOSBox source tree and the DOSBox-X source tree. +LICENSE="GPL-2" +SLOT="0" + +IUSE="X debug ffmpeg fluidsynth opengl png slirp truetype" +# Unit tests are only available in debug builds +RESTRICT="!debug? ( test )" + +BDEPEND=" + dev-lang/nasm + sys-libs/libcap +" + +# Unconditionally pulling in automagically-enabled optional dependencies: +# - media-libs/alsa-lib +# - media-libs/sdl2-net +# - net-libs/libpcap +# +# With media-libs/libsdl2[-X,wayland], this package does work on a Wayland +# desktop, but (at least on GNOME) the program does not launch in a movable +# and resizable window; whereas with media-libs/libsdl2[X], it does. Thus, +# unconditionally require media-libs/libsdl2[X] for better user experience. +# +# DOSBox-X works with multiple audio backends of SDL 2 but requires at least +# one available backend (https://bugs.gentoo.org/901303). Unconditionally +# depending on media-libs/libsdl2[alsa] to satisfy this requirement since +# this ebuild already unconditionally pulls in media-libs/alsa-lib. +COMMON_DEPEND=" + media-libs/alsa-lib + media-libs/libsdl2[X,alsa,opengl?,sound,threads(+),video] + media-libs/sdl2-net + net-libs/libpcap + sys-libs/zlib + X? ( + x11-libs/libX11 + x11-libs/libXrandr + x11-libs/libxkbfile + ) + debug? ( sys-libs/ncurses:= ) + ffmpeg? ( media-video/ffmpeg:= ) + fluidsynth? ( media-sound/fluidsynth:= ) + opengl? ( media-libs/libglvnd[X] ) + png? ( media-libs/libpng:= ) + slirp? ( net-libs/libslirp ) + truetype? ( media-libs/freetype ) +" + +DEPEND=" + ${COMMON_DEPEND} +" + +# DOSBox-X can still run normally without any of these dependencies -- +# it just cannot show a file dialog. However, upon the initial launch, +# DOSBox-X will try to show a file dialog to let the user choose the +# working directory; without one of these dependencies, the user would +# see nothing when they launch DOSBox-X for the first time. +FILE_DIALOG_DEPEND=" + || ( + gnome-extra/zenity + kde-apps/kdialog + x11-misc/xdialog + ) +" + +RDEPEND=" + ${COMMON_DEPEND} + ${FILE_DIALOG_DEPEND} +" + +pkg_pretend() { + if use ffmpeg && use !png; then + ewarn "Setting the 'ffmpeg' USE flag when the 'png' USE flag is" + ewarn "unset does not have any effect. Unsetting the 'png' USE" + ewarn "flag disables the video capture feature, so additional" + ewarn "video capture formats enabled by the 'ffmpeg' USE flag" + ewarn "will end up being unused." + fi +} + +src_prepare() { + default + + # https://bugs.gentoo.org/887669 + # Mask lines touching '-O*', and avoid creating an empty command + # list as a result to not break 'if', 'for', or functions + sed -i -E -e 's/((C|CXX)FLAGS=.*-O)/: \1/' configure.ac || + die "Failed to stop configure.ac from touching '-O*' compiler flags" + + eautoreconf +} + +src_configure() { + local myconf=( + # Always use SDL 2, even though the package provides the option to + # build with SDL 1.x, because this package is expected to be built + # with the bundled, heavily-modified version of SDL 1.x if that + # branch is used. Compiler errors are likely to occur if the + # bundled version of SDL 1.x is not used. Bundled dependencies + # should be avoided on Gentoo, so SDL 2 is more preferable. + --enable-sdl2 + + # Explicitly enable ALSA MIDI support, same as default. As of + # v2022.08.0, even when it is disabled, media-libs/alsa-lib will + # still be automagically linked if it is present in the build + # environment (presumably for other components of this package), + # so the dependency cannot be made optional by disabling this + # option. Plus, disabling this option has no observable effect + # on build time, build size, or the program's functionality, as + # 'mididevice=alsa' still works with '--disable-alsa-midi'. + --enable-alsa-midi + + $(use_enable debug '' heavy) + + $(use_enable X x11) + $(use_enable ffmpeg avcodec) + $(use_enable fluidsynth libfluidsynth) + $(use_enable opengl) + $(use_enable png screenshots) + $(use_enable slirp libslirp) + $(use_enable truetype freetype) + ) + + econf "${myconf[@]}" +} + +src_compile() { + # https://bugs.gentoo.org/856352 + emake AR="$(tc-getAR)" +} + +src_test() { + xdg_environment_reset # Tests may create config files in XDG_CONFIG_HOME + set -- src/dosbox-x -tests + echo "${@}" >&2 + "${@}" || die "Unit tests failed" +} + +pkg_preinst() { + xdg_pkg_preinst + + # Returns whether or not the USE flag specified with the first positional + # argument is newly enabled for this installation of the package. + newuse() { + local flag="${1}" + + # The 'has_version' call tests if any USE flags are newly enabled. + # It is to extract information about any existing copy of this + # package installed on the system, which is why it should be made + # before the new copy of this package just built is merged. + use "${flag}" && ! has_version "${CATEGORY}/${PN}[${flag}]" + } + + newuse debug && PRINT_NOTES_FOR_DEBUGGER=1 + newuse fluidsynth && PRINT_NOTES_FOR_FLUIDSYNTH=1 +} + +pkg_postinst() { + xdg_pkg_postinst + + if [[ "${PRINT_NOTES_FOR_DEBUGGER}" ]]; then + elog + elog "Note on the Debugger" + elog + elog "The debugger can only be started when DOSBox-X is launched" + elog "from a terminal. Otherwise, the \"Start DOSBox-X Debugger\"" + elog "option in the \"Debug\" drop-down menu would be unavailable." + elog + elog "For more information about the debugger, please consult:" + elog " ${EPREFIX}/usr/share/doc/${PF}/README.debugger*" + fi + + if [[ "${PRINT_NOTES_FOR_FLUIDSYNTH}" ]]; then + elog + elog "Note on FluidSynth" + elog + elog "To use FluidSynth as the MIDI device for DOSBox-X, a soundfont" + elog "is required. If no existing soundfont is available, a new one" + elog "can be installed and configured for DOSBox-X very easily:" + elog + elog "1. Install the following package:" + elog " media-sound/fluid-soundfont" + elog "2. Add the following lines to DOSBox-X's configuration file:" + elog " [midi]" + elog " mididevice=fluidsynth" + elog + elog "Usually, there is no need to explicitly specify the soundfont" + elog "file's path because the package mentioned in step 1 installs" + elog "soundfont files to a standard location, allowing them to be" + elog "detected and selected automatically." + elog + elog "For advanced FluidSynth configuration, please consult:" + elog " https://dosbox-x.com/wiki/Guide%3ASetting-up-MIDI-in-DOSBox%E2%80%90X#_fluidsynth" + fi +}