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@tsoy.me>
This commit is contained in:
Alexander Tsoy
2025-06-26 11:20:29 +03:00
parent d8a6458197
commit c848ff5a12
8 changed files with 292 additions and 30 deletions

View File

@@ -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[@]}"
}

View File

@@ -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 )"
DEPEND="
alsa? ( media-libs/alsa-lib )
lv2? ( media-libs/lv2 )
media-libs/libsmf
# TODO:
# Unbundle media-libs/zita-resampler. This requires a massive patch for build system.
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
)
"
BDEPEND="
virtual/pkgconfig
nls? ( sys-devel/gettext )
"
RDEPEND="${DEPEND}"
REQUIRED_USE="|| ( alsa jack )"
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 sse=0
use cpu_flags_x86_sse && sse=1
use cpu_flags_x86_sse2 && sse=2
use cpu_flags_x86_sse3 && sse=3
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)
)
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
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[@]}"
}

View File

@@ -0,0 +1,24 @@
From: Alexander Tsoy <alexander@tsoy.me>
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"])

View File

@@ -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)

View File

@@ -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 \

View File

@@ -0,0 +1,15 @@
From: Alexander Tsoy <alexander@tsoy.me>
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)

View File

@@ -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)

View File

@@ -6,7 +6,10 @@
<email>samuel.bauer@yahoo.fr</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>