commit:     c848ff5a127daa5cf601b5ea47b0dd6945749bdb
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Thu Jun 26 08:20:29 2025 +0000
Commit:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
CommitDate: Thu Jun 26 08:35:24 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c848ff5a

media-sound/drumgizmo: multiple fixes

* Fix build.
* Fix dependencies.
* Fix and enable tests.
* Remove sse* USE-flags. All SSE conditionals were removed from the
  code and these USE-flags only controls the addiion of -msse* compiler
  flags.
* Remove vst USE-flag. It equires proprietary VST2 SDK and currently
  results in a build failure.
* Enable lv2 by default, as this is likely the most common use case for
  drumgizmo.
* Disable cli by default.

Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>

 media-sound/drumgizmo/drumgizmo-0.9.20-r1.ebuild   | 105 ++++++++++++++++++
 media-sound/drumgizmo/drumgizmo-9999.ebuild        | 122 +++++++++++++++------
 ...drumgizmo-0.9.20-configure-portable-shell.patch |  24 ++++
 .../files/drumgizmo-0.9.20-disable-lv2-test.patch  |  20 ++++
 ...drumgizmo-0.9.20-disable-translation-test.patch |  21 ++++
 .../files/drumgizmo-0.9.20-fix-painter-test.patch  |  15 +++
 .../files/drumgizmo-0.9.20-include-cstdint.patch   |  14 +++
 media-sound/drumgizmo/metadata.xml                 |   3 +
 8 files changed, 293 insertions(+), 31 deletions(-)

diff --git a/media-sound/drumgizmo/drumgizmo-0.9.20-r1.ebuild 
b/media-sound/drumgizmo/drumgizmo-0.9.20-r1.ebuild
new file mode 100644
index 0000000000..da8771ed62
--- /dev/null
+++ b/media-sound/drumgizmo/drumgizmo-0.9.20-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 2020-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+if [[ "${PV}" == "9999" ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="git://git.drumgizmo.org/${PN}.git"
+else
+       SRC_URI="https://www.drumgizmo.org/releases/${P}/${P}.tar.gz";
+       KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Audio sampler plugin and stand-alone app that simulates a real 
drum kit"
+HOMEPAGE="https://drumgizmo.org/";
+
+inherit autotools
+
+LICENSE="LGPL-3+"
+SLOT="0"
+IUSE="alsa cli jack +lv2 midi nls test"
+REQUIRED_USE="|| ( cli lv2 )"
+RESTRICT="!test? ( test )"
+
+# TODO:
+# Unbundle media-libs/zita-resampler. This requires a massive patch for build 
system.
+
+RDEPEND="
+       media-libs/libsndfile
+       cli? (
+               alsa? ( media-libs/alsa-lib )
+               jack? ( virtual/jack )
+               midi? ( media-libs/libsmf )
+       )
+       lv2? (
+               media-libs/lv2
+               x11-libs/libX11
+               x11-libs/libXext
+       )
+"
+DEPEND="${RDEPEND}
+       test? (
+               dev-libs/serd
+               media-libs/lilv
+       )
+"
+BDEPEND="
+       virtual/pkgconfig
+       nls? ( sys-devel/gettext )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.9.20-configure-portable-shell.patch
+       "${FILESDIR}"/${PN}-0.9.20-include-cstdint.patch
+       "${FILESDIR}"/${PN}-0.9.20-disable-lv2-test.patch
+       "${FILESDIR}"/${PN}-0.9.20-disable-translation-test.patch
+       "${FILESDIR}"/${PN}-0.9.20-fix-painter-test.patch
+)
+
+pkg_pretend() {
+       if ! use cli; then
+               use alsa && ewarn "Ignoring USE=alsa since cli is disabled"
+               use jack && ewarn "Ignoring USE=jack since cli is disabled"
+               use midi && ewarn "Ignoring USE=midi since cli is disabled"
+       fi
+}
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_configure() {
+       local myeconfargs=(
+               --enable-gui=x11
+               # requres VST2 SDK
+               --disable-vst
+               # all SSE conditionals were removed in 0.9.16
+               --enable-sse=no
+               $(use_enable cli)
+               $(use_enable lv2)
+               $(use_with nls)
+               $(use_with test)
+       )
+
+       if use cli; then
+               myeconfargs+=(
+                       $(use_enable alsa input-alsamidi)
+                       $(use_enable alsa output-alsa)
+                       $(use_enable jack input-jackmidi)
+                       $(use_enable jack output-jackaudio)
+                       $(use_enable midi input-midifile)
+               )
+       else
+               myeconfargs+=(
+                       --disable-input-alsamidi
+                       --disable-output-alsa
+                       --disable-input-jackmidi
+                       --disable-output-jackaudio
+                       --disable-input-midifile
+               )
+       fi
+
+       econf "${myeconfargs[@]}"
+}

diff --git a/media-sound/drumgizmo/drumgizmo-9999.ebuild 
b/media-sound/drumgizmo/drumgizmo-9999.ebuild
index 5e13072b4a..da8771ed62 100644
--- a/media-sound/drumgizmo/drumgizmo-9999.ebuild
+++ b/media-sound/drumgizmo/drumgizmo-9999.ebuild
@@ -1,45 +1,105 @@
-# Copyright 2020-2022 Gentoo Authors
+# Copyright 2020-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-inherit git-r3
+if [[ "${PV}" == "9999" ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="git://git.drumgizmo.org/${PN}.git"
+else
+       SRC_URI="https://www.drumgizmo.org/releases/${P}/${P}.tar.gz";
+       KEYWORDS="~amd64"
+fi
 
-DESCRIPTION="Cross-platform drum plugin and stand-alone application"
-HOMEPAGE="https://www.drumgizmo.org/wiki";
-EGIT_REPO_URI="https://git.drumgizmo.org/${PN}.git";
+DESCRIPTION="Audio sampler plugin and stand-alone app that simulates a real 
drum kit"
+HOMEPAGE="https://drumgizmo.org/";
 
-LICENSE="LGPL-3"
+inherit autotools
+
+LICENSE="LGPL-3+"
 SLOT="0"
-IUSE="alsa jack lv2 vst cpu_flags_x86_sse cpu_flags_x86_sse2 
cpu_flags_x86_sse3"
+IUSE="alsa cli jack +lv2 midi nls test"
+REQUIRED_USE="|| ( cli lv2 )"
+RESTRICT="!test? ( test )"
+
+# TODO:
+# Unbundle media-libs/zita-resampler. This requires a massive patch for build 
system.
 
-DEPEND="
-       alsa? ( media-libs/alsa-lib )
-       lv2? ( media-libs/lv2 )
-       media-libs/libsmf
+RDEPEND="
        media-libs/libsndfile
-       media-libs/zita-resampler
-       x11-libs/libX11
+       cli? (
+               alsa? ( media-libs/alsa-lib )
+               jack? ( virtual/jack )
+               midi? ( media-libs/libsmf )
+       )
+       lv2? (
+               media-libs/lv2
+               x11-libs/libX11
+               x11-libs/libXext
+       )
+"
+DEPEND="${RDEPEND}
+       test? (
+               dev-libs/serd
+               media-libs/lilv
+       )
 "
-RDEPEND="${DEPEND}"
+BDEPEND="
+       virtual/pkgconfig
+       nls? ( sys-devel/gettext )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.9.20-configure-portable-shell.patch
+       "${FILESDIR}"/${PN}-0.9.20-include-cstdint.patch
+       "${FILESDIR}"/${PN}-0.9.20-disable-lv2-test.patch
+       "${FILESDIR}"/${PN}-0.9.20-disable-translation-test.patch
+       "${FILESDIR}"/${PN}-0.9.20-fix-painter-test.patch
+)
 
-REQUIRED_USE="|| ( alsa jack )"
+pkg_pretend() {
+       if ! use cli; then
+               use alsa && ewarn "Ignoring USE=alsa since cli is disabled"
+               use jack && ewarn "Ignoring USE=jack since cli is disabled"
+               use midi && ewarn "Ignoring USE=midi since cli is disabled"
+       fi
+}
+
+src_prepare() {
+       default
+       eautoreconf
+}
 
 src_configure() {
-       local sse=0
-       use cpu_flags_x86_sse  && sse=1
-       use cpu_flags_x86_sse2 && sse=2
-       use cpu_flags_x86_sse3 && sse=3
-
-       econf --enable-cli=yes \
-               --enable-static=no \
-               $(usex alsa '' '--disable-output-alsa') \
-               $(usex jack '' '--disable-input-jackmidi') \
-               $(usex jack '' '--disable-output-jackaudio') \
-               --enable-gui=x11 \
-               --enable-lv2=$(usex lv2) \
-               --enable-sse=${sse} \
-               --enable-vst=$(usex vst) \
-               --with-debug=no \
-               --with-test=no
+       local myeconfargs=(
+               --enable-gui=x11
+               # requres VST2 SDK
+               --disable-vst
+               # all SSE conditionals were removed in 0.9.16
+               --enable-sse=no
+               $(use_enable cli)
+               $(use_enable lv2)
+               $(use_with nls)
+               $(use_with test)
+       )
+
+       if use cli; then
+               myeconfargs+=(
+                       $(use_enable alsa input-alsamidi)
+                       $(use_enable alsa output-alsa)
+                       $(use_enable jack input-jackmidi)
+                       $(use_enable jack output-jackaudio)
+                       $(use_enable midi input-midifile)
+               )
+       else
+               myeconfargs+=(
+                       --disable-input-alsamidi
+                       --disable-output-alsa
+                       --disable-input-jackmidi
+                       --disable-output-jackaudio
+                       --disable-input-midifile
+               )
+       fi
+
+       econf "${myeconfargs[@]}"
 }

diff --git 
a/media-sound/drumgizmo/files/drumgizmo-0.9.20-configure-portable-shell.patch 
b/media-sound/drumgizmo/files/drumgizmo-0.9.20-configure-portable-shell.patch
new file mode 100644
index 0000000000..513c21d5cc
--- /dev/null
+++ 
b/media-sound/drumgizmo/files/drumgizmo-0.9.20-configure-portable-shell.patch
@@ -0,0 +1,24 @@
+From: Alexander Tsoy <[email protected]>
+Subject: Use portable shell in configure
+Upstream-Status: Pending
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -146,7 +146,7 @@ AC_ARG_WITH([nls],
+                            [Build with nls support (default nls enabled)]),
+             [],
+             [with_nls=yes])
+-            AS_IF([test "x$with_nls" == "xyes"],
++            AS_IF([test "x$with_nls" = "xyes"],
+                   [AC_MSG_RESULT([*** Building with nls support!])
+                    AC_CHECK_PROGS([XGETTEXT], [xgettext])
+                    AS_IF([test "x$XGETTEXT" = "x"],
+@@ -601,7 +601,7 @@ AS_IF(
+    enable_cli=no]
+ )
+ 
+-AM_CONDITIONAL([ENABLE_CLI], [test "x$enable_cli" == "xyes"])
++AM_CONDITIONAL([ENABLE_CLI], [test "x$enable_cli" = "xyes"])
+ AM_CONDITIONAL([HAVE_INPUT_DUMMY], [test "x$have_input_dummy" = "xyes"])
+ AM_CONDITIONAL([HAVE_INPUT_TEST], [test "x$have_input_test" = "xyes"])
+ AM_CONDITIONAL([HAVE_INPUT_JACKMIDI], [test "x$have_input_jackmidi" = "xyes"])

diff --git 
a/media-sound/drumgizmo/files/drumgizmo-0.9.20-disable-lv2-test.patch 
b/media-sound/drumgizmo/files/drumgizmo-0.9.20-disable-lv2-test.patch
new file mode 100644
index 0000000000..89fbd3c082
--- /dev/null
+++ b/media-sound/drumgizmo/files/drumgizmo-0.9.20-disable-lv2-test.patch
@@ -0,0 +1,20 @@
+Subject: disable LV2 test
+
+Disable lv2 test, as it runs against an installed drumgizmo lv2
+
+Upstream-Status: Inappropriate [Gentoo-specific]
+
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 4a5a050..f78d563 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -15,9 +15,6 @@ EXTRA_DIST = \
+       lv2_test_host.h \
+       scopedfile.h
+ 
+-if ENABLE_LV2
+-TESTS += lv2
+-endif
+ 
+ check_PROGRAMS = $(TESTS)
+ 

diff --git 
a/media-sound/drumgizmo/files/drumgizmo-0.9.20-disable-translation-test.patch 
b/media-sound/drumgizmo/files/drumgizmo-0.9.20-disable-translation-test.patch
new file mode 100644
index 0000000000..e9373a5211
--- /dev/null
+++ 
b/media-sound/drumgizmo/files/drumgizmo-0.9.20-disable-translation-test.patch
@@ -0,0 +1,21 @@
+Subject: disable translation test
+
+Disable translation test, as it requires da_DK.UTF-8 locale to be present on 
the system.
+
+Upstream-Status: Inappropriate [Gentoo-specific]
+
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 8337f4b..a707eed 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -10,10 +10,6 @@ TESTS = resource enginetest paintertest configfile 
audiocache \
+       dgxmlparsertest domloadertest configparsertest midimapparsertest \
+       eventsdstest powermaptest midimappertest
+ 
+-if WITH_NLS
+-TESTS += translationtest
+-endif
+-
+ EXTRA_DIST = \
+       drumkit_creator.h \
+       lv2_test_host.h \

diff --git 
a/media-sound/drumgizmo/files/drumgizmo-0.9.20-fix-painter-test.patch 
b/media-sound/drumgizmo/files/drumgizmo-0.9.20-fix-painter-test.patch
new file mode 100644
index 0000000000..359e8963ee
--- /dev/null
+++ b/media-sound/drumgizmo/files/drumgizmo-0.9.20-fix-painter-test.patch
@@ -0,0 +1,15 @@
+From: Alexander Tsoy <[email protected]>
+Subject: Fix vector size in painter test.
+Upstream-Status: Submitted
+
+--- a/test/paintertest.cc
++++ b/test/paintertest.cc
+@@ -91,7 +91,7 @@ public:
+               has_alpha = alpha;
+ 
+               image_data.resize(_width * _height);
+-              image_data_raw.resize(_width * _height);
++              image_data_raw.resize(4 * _width * _height);
+ 
+               // Store x and y coordinates as red and green colour components
+               for(std::uint8_t x = 0; x < _width; ++x)

diff --git a/media-sound/drumgizmo/files/drumgizmo-0.9.20-include-cstdint.patch 
b/media-sound/drumgizmo/files/drumgizmo-0.9.20-include-cstdint.patch
new file mode 100644
index 0000000000..9c0551027f
--- /dev/null
+++ b/media-sound/drumgizmo/files/drumgizmo-0.9.20-include-cstdint.patch
@@ -0,0 +1,14 @@
+Upstream patch
+Link: 
http://git.drumgizmo.org/plugingizmo.git/patch/?id=a88c76afd8fbfe31b76010bac34c1437b1927245
+
+--- a/plugin/plugingizmo/plugin.h
++++ b/plugin/plugingizmo/plugin.h
+@@ -30,7 +30,7 @@
+ #include <string>
+ 
+ #include <cstdlib>
+-
++#include <cstdint>
+ 
+ #if defined(WIN32)
+ #define PG_EXPORT extern "C" __declspec(dllexport)

diff --git a/media-sound/drumgizmo/metadata.xml 
b/media-sound/drumgizmo/metadata.xml
index b92a348195..71a06368f3 100644
--- a/media-sound/drumgizmo/metadata.xml
+++ b/media-sound/drumgizmo/metadata.xml
@@ -6,7 +6,10 @@
                <email>[email protected]</email>
        </maintainer>
        <use>
+               <flag name="cli">Build stand-alone CLI application</flag>
+               <flag name="jack">Enable jack output and jackmidi input (CLI 
only)</flag>
                <flag name="lv2">Build LV2 plugin</flag>
+               <flag name="midi">Enable midifile input via 
<pkg>media-libs/libsmf</pkg> (CLI only)</flag>
                <flag name="vst">Build VST plugin</flag>
        </use>
 </pkgmetadata>

Reply via email to