commit:     a6ddf200495ecf8471d05797fbe13b1f171091cb
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Thu Mar 27 04:42:19 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Apr 28 04:28:05 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6ddf200

media-sound/mixxx: add 2.5.1

deps :
* add dev-cpp/abseil-cpp, for its embarrassing proximity with protobuf
* drop support for gles2-only on 2.5.X
* dev-cpp/gtest :
  add subslot for RDEP
  set unconditionnaly in DEPEND for FRIEND_TEST header
* media-libs/taglib-2 support
* virtual/glu is not required
* dev-util/spirv-tools, only required with <QT-6.6, otherwise
   qtshadertools is sufficient.

options :
* experimental-UI (QML) is off. Not functionnal at all on 2.5.X

patch for X11-dep :
  use FindWrapOpenGL instead of FindOpenGL, allowing system without GL.
  libX11 is only required for screensaver

Close an old bug for 2.3.6

Closes: https://bugs.gentoo.org/947101
Closes: https://bugs.gentoo.org/949587
Closes: https://bugs.gentoo.org/953216
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/41307
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-sound/mixxx/Manifest                        |   1 +
 media-sound/mixxx/files/mixxx-2.5.1-x11_opt.patch |  79 ++++++++++
 media-sound/mixxx/mixxx-2.5.1.ebuild              | 173 ++++++++++++++++++++++
 3 files changed, 253 insertions(+)

diff --git a/media-sound/mixxx/Manifest b/media-sound/mixxx/Manifest
index 5218e44640b7..52a65cc3eb2c 100644
--- a/media-sound/mixxx/Manifest
+++ b/media-sound/mixxx/Manifest
@@ -1 +1,2 @@
 DIST mixxx-2.5.0.tar.gz 39580922 BLAKE2B 
e5c5aa02a4b13228857eb620ad174144562d7b4675a40565fda1e641138e0e65dbb2bbe8c7fb32ead242a5bdf8581368ea604c93afbfc5c991ac92065e7bdae7
 SHA512 
ee3c682d40267358025aba5bfdc378fee1cb6691dc899280132f7e69d315b9ce3d8568ca182752bac96a38310c2f2d71ddc80eea4448b8b32bf6ec6a61a9d608
+DIST mixxx-2.5.1.tar.gz 39957616 BLAKE2B 
a1541e74753ba97aa5faf0785f987619b60e061faf21500723568eb599fd72cc03b3948a1a8012dcfeb111a2e2e20256aa39dbeb15e49355830bb94aeef7d625
 SHA512 
14ca19b58e5f3bb2502a3a79125c2e4f149d002ff6e89bd3bad61a6bb268cfcecaaf1ee31eac3eb39bfdcdf77bae38ea6ef0ad3cdb8df9bfb842070b642b3ffc

diff --git a/media-sound/mixxx/files/mixxx-2.5.1-x11_opt.patch 
b/media-sound/mixxx/files/mixxx-2.5.1-x11_opt.patch
new file mode 100644
index 000000000000..16a311325862
--- /dev/null
+++ b/media-sound/mixxx/files/mixxx-2.5.1-x11_opt.patch
@@ -0,0 +1,79 @@
+https://github.com/mixxxdj/mixxx/pull/14574
+From 1f78615d0079c8949cd68dea5a28bdf69aed2bd3 Mon Sep 17 00:00:00 2001
+From: Nicolas PARLANT <[email protected]>
+Date: Mon, 31 Mar 2025 13:33:13 +0000
+Subject: [PATCH] X11-less - Use FindWrapOpenGL
+
+Use FindWrapOpenGL.cmake. It allows X11-less system.
+Set link_target to OpenGL::OpenGL, GLVND-basede. If not found, use
+OpenGL:GL.
+
+Furthermore, adding a NOQX11 definition so that the screensaver that
+requires Xlib is now optional.
+
+Signed-off-by: Nicolas PARLANT <[email protected]>
+---
+ CMakeLists.txt           | 11 +++++++++--
+ src/util/screensaver.cpp |  5 +++--
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b7a48247f97..91b83a5cd35 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3187,8 +3187,8 @@ else()
+     set(CMAKE_FIND_FRAMEWORK FIRST)
+   endif()
+   set(OpenGL_GL_PREFERENCE "GLVND")
+-  find_package(OpenGL REQUIRED)
+   if(EMSCRIPTEN)
++    find_package(OpenGL REQUIRED)
+     # Emscripten's FindOpenGL.cmake does not create OpenGL::GL
+     target_link_libraries(mixxx-lib PRIVATE ${OPENGL_gl_LIBRARY})
+     target_compile_definitions(mixxx-lib PUBLIC QT_OPENGL_ES_2)
+@@ -3200,7 +3200,12 @@ else()
+       PUBLIC -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 -sFULL_ES2=1
+     )
+   else()
+-    target_link_libraries(mixxx-lib PRIVATE OpenGL::GL)
++    find_package(WrapOpenGL REQUIRED)
++    if(OpenGL::OpenGL)
++      target_link_libraries(mixxx-lib PRIVATE OpenGL::OpenGL)
++    else()
++      target_link_libraries(mixxx-lib PRIVATE OpenGL::GL)
++    endif()
+   endif()
+   if(UNIX AND QGLES2)
+     target_compile_definitions(mixxx-lib PUBLIC QT_OPENGL_ES_2)
+@@ -3841,6 +3846,8 @@ elseif(UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
+   if(${X11_FOUND})
+     target_include_directories(mixxx-lib SYSTEM PUBLIC "${X11_INCLUDE_DIR}")
+     target_link_libraries(mixxx-lib PRIVATE "${X11_LIBRARIES}")
++  else()
++    target_compile_definitions(mixxx-lib PUBLIC QNOX11)
+   endif()
+   find_package(Qt${QT_VERSION_MAJOR} COMPONENTS DBus REQUIRED)
+   target_link_libraries(mixxx-lib PUBLIC Qt${QT_VERSION_MAJOR}::DBus)
+diff --git a/src/util/screensaver.cpp b/src/util/screensaver.cpp
+index 9eae4a1b4cd..68f70518429 100644
+--- a/src/util/screensaver.cpp
++++ b/src/util/screensaver.cpp
+@@ -36,7 +36,8 @@ With the help of the following source codes:
+ #  include <X11/extensions/scrnsaver.h>
+ #endif
+ 
+-#if defined(__LINUX__) || (defined(HAVE_XSCREENSAVER_SUSPEND) && 
HAVE_XSCREENSAVER_SUSPEND)
++#if (defined(__LINUX__) && !defined(QNOX11)) || \
++        (defined(HAVE_XSCREENSAVER_SUSPEND) && HAVE_XSCREENSAVER_SUSPEND)
+ #  define None XNone
+ #  define Window XWindow
+ #  include <X11/Xlib.h>
+@@ -146,7 +147,7 @@ void ScreenSaverHelper::uninhibitInternal()
+     s_enabled = false;
+ }
+ 
+-#elif defined(Q_OS_LINUX)
++#elif (defined(Q_OS_LINUX) && !defined(QNOX11))
+ const char *SCREENSAVERS[][4] = {
+     // org.freedesktop.ScreenSaver is the standard. should work for gnome and 
kde too, 
+     // but I add their specific names too

diff --git a/media-sound/mixxx/mixxx-2.5.1.ebuild 
b/media-sound/mixxx/mixxx-2.5.1.ebuild
new file mode 100644
index 000000000000..ccd7a1fa52a5
--- /dev/null
+++ b/media-sound/mixxx/mixxx-2.5.1.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake flag-o-matic toolchain-funcs udev xdg
+
+DESCRIPTION="Advanced Digital DJ tool based on Qt"
+HOMEPAGE="https://mixxx.org/";
+if [[ ${PV} == *9999 ]] ; then
+       inherit git-r3
+       if [[ ${PV} == ?.?.9999 ]] ; then
+               EGIT_BRANCH=${PV%.9999}
+       fi
+       EGIT_REPO_URI="https://github.com/mixxxdj/${PN}.git";
+else
+       SRC_URI="https://github.com/mixxxdj/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64 ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+# gles2-only: at least not before 2.6 for keyworded ebuild
+IUSE="aac benchmark ffmpeg keyfinder lv2 midi modplug mp3 mp4 opus"
+IUSE+=" qtkeychain rubberband shout test upower wavpack +X"
+REQUIRED_USE="
+       benchmark? ( test )
+       qtkeychain? ( shout )
+       test? ( aac ffmpeg midi mp3 opus rubberband )
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       dev-db/sqlite:3
+       dev-cpp/abseil-cpp:=
+       dev-libs/hidapi
+       dev-libs/protobuf:=
+       dev-qt/qt5compat:6
+       
dev-qt/qtbase:6[concurrent,dbus,-gles2-only,gui,icu,network,opengl,sql,sqlite,ssl,widgets,xml,X?]
+       dev-qt/qtdeclarative:6
+       dev-qt/qtshadertools:6
+       dev-qt/qtsvg:6
+       media-libs/chromaprint:=
+       media-libs/flac:=
+       media-libs/libebur128:=
+       media-libs/libglvnd[X?]
+       media-libs/libogg
+       media-libs/libsndfile
+       media-libs/libsoundtouch:=
+       media-libs/libvorbis
+       media-libs/portaudio
+       media-libs/taglib:=
+       media-sound/lame
+       virtual/libusb:1
+       virtual/udev
+       aac? (
+               media-libs/faad2
+               media-libs/libmp4v2
+       )
+       benchmark? (
+               dev-cpp/benchmark:=
+               dev-cpp/gtest:=
+               dev-util/google-perftools:=
+       )
+       ffmpeg? ( media-video/ffmpeg:= )
+       keyfinder? ( media-libs/libkeyfinder )
+       lv2? ( media-libs/lilv )
+       midi? ( media-libs/portmidi )
+       modplug? ( media-libs/libmodplug )
+       mp3? (
+               media-libs/libid3tag:=
+               media-libs/libmad
+       )
+       mp4? ( media-libs/libmp4v2 )
+       opus? (
+               media-libs/opus
+               media-libs/opusfile
+       )
+       qtkeychain? ( >=dev-libs/qtkeychain-0.14.2:=[qt6(+)] )
+       rubberband? ( media-libs/rubberband:= )
+       shout? ( dev-libs/openssl:= )
+       upower? (
+               dev-libs/glib:2
+               sys-power/upower:=
+       )
+       wavpack? ( media-sound/wavpack )
+       X? ( x11-libs/libX11 )
+"
+DEPEND="${RDEPEND}
+       dev-cpp/gtest
+       dev-cpp/ms-gsl
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       # Fix strict-aliasing violations in vendored katai_cpp_stl_runtime
+       # 
https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime/commit/c01f530.patch
+       "${FILESDIR}"/${PN}-2.5.0-fix-strict-aliasing-kaitai.patch
+       # Try OpenGL::OpenGL first for X11-less system
+       # Make libX11 optional as it's only required for screensaver.
+       "${FILESDIR}"/${PN}-2.5.1-x11_opt.patch
+)
+
+CMAKE_SKIP_TESTS=(
+       # need HID controller
+       LegacyControllerMappingValidationTest.HidMappingsValid
+       # randomly fails
+       # https://github.com/mixxxdj/mixxx/issues/12554
+       EngineBufferE2ETest
+)
+
+src_configure() {
+       # prevent ld error as package builds static libs.
+       tc-is-lto && append-flags $(test-flags -ffat-lto-objects)
+
+       local mycmakeargs=(
+               -DBATTERY="$(usex upower)"
+               -DBROADCAST="$(usex shout)"
+               -DBUILD_SHARED_LIBS=ON
+               -DBUILD_TESTING="$(usex test)"
+               -DBUILD_BENCH="$(usex benchmark)"
+               # prevent duplicate call
+               -DCCACHE_SUPPORT=OFF
+               -DCMAKE_DISABLE_FIND_PACKAGE_X11=$(usex !X)
+               -DENGINEPRIME=OFF
+               -DFAAD="$(usex aac)"
+               -DFFMPEG="$(usex ffmpeg)"
+               -DGPERFTOOLS="$(usex benchmark)"
+               -DGPERFTOOLSPROFILER="$(usex benchmark)"
+               -DHID=ON
+               -DINSTALL_USER_UDEV_RULES=OFF
+               -DKEYFINDER="$(usex keyfinder)"
+               -DLILV="$(usex lv2)"
+               -DMAD="$(usex mp3)"
+               -DMODPLUG="$(usex modplug)"
+               -DOPTIMIZE=OFF
+               -DOPUS="$(usex opus)"
+               -DPORTMIDI="$(usex midi)"
+               # new QML-UI, experimental and not functionnal for now
+               -DQML=OFF
+               -DQTKEYCHAIN="$(usex qtkeychain)"
+               -DRUBBERBAND="$(usex rubberband)"
+               -DVINYLCONTROL=ON
+               -DWAVPACK="$(usex wavpack)"
+       )
+
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+       use benchmark && dobin "${BUILD_DIR}"/mixxx-test
+       udev_newrules "${S}"/res/linux/mixxx-usb-uaccess.rules 
69-mixxx-usb-uaccess.rules
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+       udev_reload
+
+       elog "Manuals are no longer part of the package."
+       elog "Please refer to https://downloads.mixxx.org/manual/ for 
up-to-date manuals."
+       if use benchmark; then
+               elog ""
+               elog "Launch benchmark : ${EROOT}/usr/bin/mixxx-test 
--benchmark"
+               elog "Launch Unittests : ${EROOT}/usr/bin/mixxx-test"
+               elog "Some test suites may not be available without source 
files."
+       fi
+}
+
+pkg_postrm() {
+       xdg_pkg_postrm
+       udev_reload
+}

Reply via email to