diff mbox series

[bug#48632] gnu: Add eq10q. * gnu/packages/audio.scm (eq10q): New variable. * gnu/packages/patches/eq10q-lv2-descriptor.patch. * gnu/packages/patches/eq10q-exp10.patch.

Message ID 20210524194310.13378-1-t_w_@freenet.de
State New
Headers show
Series [bug#48632] gnu: Add eq10q. * gnu/packages/audio.scm (eq10q): New variable. * gnu/packages/patches/eq10q-lv2-descriptor.patch. * gnu/packages/patches/eq10q-exp10.patch. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Thorsten Wilms May 24, 2021, 7:43 p.m. UTC
---
 gnu/packages/audio.scm                        | 44 ++++++++++-
 gnu/packages/patches/eq10q-exp10.patch        | 73 +++++++++++++++++++
 .../patches/eq10q-lv2-descriptor.patch        | 50 +++++++++++++
 3 files changed, 166 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/eq10q-exp10.patch
 create mode 100644 gnu/packages/patches/eq10q-lv2-descriptor.patch
diff mbox series

Patch

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 2afb37175d..4a40242204 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -15,7 +15,7 @@ 
 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2018 Brett Gilio <brettg@gnu.org>
 ;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2018 Thorsten Wilms <t_w_@freenet.de>
+;;; Copyright © 2018, 2021 Thorsten Wilms <t_w_@freenet.de>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2019, 2021 Pierre Langlois <pierre.langlois@gmx.com>
@@ -5220,3 +5220,45 @@  while still staying in time.")
     (description "Butt is a tool to stream audio to a ShoutCast or
 Icecast server.")
     (license license:gpl2+)))
+
+(define-public eq10q
+  (package
+    (name "eq10q")
+    (version "2.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/eq10q/eq10q-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "16mhcav8gwkp29k9ki4dlkajlcgh1i2wvldabxb046d37dq4qzrk"))
+	      (patches
+	       (search-patches "eq10q-lv2-descriptor.patch"
+			       "eq10q-exp10.patch"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f ; No target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'override-target-directory
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* (find-files "CMakeLists.txt")
+               (("/usr/local")(assoc-ref outputs "out")))
+             #t)))))
+    (inputs
+     `(("gtkmm" ,gtkmm-2)
+       ("lv2" ,lv2)
+       ("fftw" ,fftw)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "LV2_PATH")
+            (files '("lib/lv2")))))
+    (home-page "http://eq10q.sourceforge.net")
+    (synopsis "Audio plug-in pack for LV2")
+    (description
+     "EQ10Q is an audio plug-in pack for LV2. It contains equalizers with 1, 4, 
+6 or 10 bands, all in mono and stereo variants. Plus a noise-gate, compressor, 
+bass-booster and stereo-mode converters.")
+    (license (list license:gpl3+ license:gpl3+))))
diff --git a/gnu/packages/patches/eq10q-exp10.patch b/gnu/packages/patches/eq10q-exp10.patch
new file mode 100644
index 0000000000..678009a700
--- /dev/null
+++ b/gnu/packages/patches/eq10q-exp10.patch
@@ -0,0 +1,73 @@ 
+Fix "‘pow10’ was not declared in this scope" error.
+Taken from https://build.opensuse.org/package/view_file/home:geekositalia:daw/lv2-EQ10Q-plugins/lv2-EQ10Q-plugins-exp10.patch?expand=1
+
+diff -rupN eq10q-2.2.org/gui/widgets/bandctl.cpp eq10q-2.2/gui/widgets/bandctl.cpp
+--- eq10q-2.2.org/gui/widgets/bandctl.cpp	2016-12-11 07:07:50.000000000 -0500
++++ eq10q-2.2/gui/widgets/bandctl.cpp	2018-03-10 16:29:14.026996405 -0500
+@@ -949,7 +949,7 @@ bool BandCtl::parseBtnString(BandCtl::Bu
+   if(str_k.length() > 0)
+   {
+     val_k = atof(str_k.c_str()) * 1e3;
+-    val *= pow10(3.0 - str.length());
++    val *= exp10(3.0 - str.length());
+     if(str.length() > 3)
+     {
+       //throw an error, imposible to match str > 3 with k
+@@ -960,7 +960,7 @@ bool BandCtl::parseBtnString(BandCtl::Bu
+   }
+   if(str_d.length() > 0)
+   {
+-    val_d = atof(str_d.c_str())/ pow10((double)str_d.length());
++    val_d = atof(str_d.c_str())/ exp10((double)str_d.length());
+   }
+    
+   btn->value = val + val_k + val_d;
+diff -rupN eq10q-2.2.org/gui/widgets/bodeplot.cpp eq10q-2.2/gui/widgets/bodeplot.cpp
+--- eq10q-2.2.org/gui/widgets/bodeplot.cpp	2016-12-11 07:07:50.000000000 -0500
++++ eq10q-2.2/gui/widgets/bodeplot.cpp	2018-03-10 16:27:06.222494049 -0500
+@@ -194,14 +194,14 @@ void PlotEQCurve::resetCenterSpan()
+ {
+   //Compute center and span for the full range spectrum
+   double sp = log10(MAX_FREQ/MIN_FREQ);
+-  double cn = MIN_FREQ * sqrt(pow10(sp));
++  double cn = MIN_FREQ * sqrt(exp10(sp));
+   setCenterSpan(cn, sp);
+ }
+ 
+ void PlotEQCurve::setCenterSpan(double center, double span)
+ { 
+-  m_minFreq = center / sqrt(pow10(span));
+-  m_maxFreq = center * sqrt(pow10(span));
++  m_minFreq = center / sqrt(exp10(span));
++  m_maxFreq = center * sqrt(exp10(span));
+     
+   //Initalize the grid
+   const double f_grid[GRID_VERTICAL_LINES] = {20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0,
+@@ -246,8 +246,8 @@ void PlotEQCurve::setCenter(double cente
+ {
+   //Limit center to the possible range according the current span
+   double sp = log10(m_maxFreq/m_minFreq);
+-  double cmin = MIN_FREQ * sqrt(pow10(sp));
+-  double cmax = MAX_FREQ / sqrt(pow10(sp));
++  double cmin = MIN_FREQ * sqrt(exp10(sp));
++  double cmax = MAX_FREQ / sqrt(exp10(sp));
+   
+   double cn = center;
+   cn = cn > cmax ? cmax : cn;
+@@ -259,7 +259,7 @@ void PlotEQCurve::setSpan(double span)
+ {
+   //Limit center to the possible range according the current span
+   double sp_act = log10(m_maxFreq/m_minFreq);
+-  double cn = m_minFreq * sqrt(pow10(sp_act));
++  double cn = m_minFreq * sqrt(exp10(sp_act));
+   double smax1 = 2.0*log10(cn/MIN_FREQ);
+   double smax2= 2.0*log10(MAX_FREQ/cn);
+   double smax = smax1 < smax2 ? smax1 : smax2;
+@@ -306,7 +306,7 @@ void PlotEQCurve::recomputeCenterFreq(do
+   double fmax = MIN_FREQ*pow((MAX_FREQ/MIN_FREQ),((local_x2 + 3.5)/((double)m_zoom_surface_ptr->get_width())));
+   
+   double sp_act = log10(fmax/fmin);
+-  double cn = fmin * sqrt(pow10(sp_act));
++  double cn = fmin * sqrt(exp10(sp_act));
+   setCenter(cn);
+ }
diff --git a/gnu/packages/patches/eq10q-lv2-descriptor.patch b/gnu/packages/patches/eq10q-lv2-descriptor.patch
new file mode 100644
index 0000000000..aabd078356
--- /dev/null
+++ b/gnu/packages/patches/eq10q-lv2-descriptor.patch
@@ -0,0 +1,50 @@ 
+Replace _LV2UI_Descriptor with LV2UI_Descriptor
+
+diff -rupN eq10q-2.2_original/gui/bassup_ui.cpp eq10q-2.2_patched/gui/bassup_ui.cpp
+--- eq10q-2.2_original/gui/bassup_ui.cpp	2016-12-11 13:07:52.000000000 +0100
++++ eq10q-2.2_patched/gui/bassup_ui.cpp	2021-05-24 19:24:34.363536592 +0200
+@@ -38,7 +38,7 @@ using namespace std;
+ #define BASSUP_GUI_URI "http://eq10q.sourceforge.net/bassup/gui"
+ 
+ 
+-static LV2UI_Handle instantiateBassUp_gui(const _LV2UI_Descriptor *descriptor, const char *plugin_uri, const char *bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features)
++static LV2UI_Handle instantiateBassUp_gui(const LV2UI_Descriptor *descriptor, const char *plugin_uri, const char *bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features)
+ {
+   #ifdef TESTING_EQ10Q
+   cout<<"instantiateEq10q_gui Entring... ";
+diff -rupN eq10q-2.2_original/gui/dyn_ui.cpp eq10q-2.2_patched/gui/dyn_ui.cpp
+--- eq10q-2.2_original/gui/dyn_ui.cpp	2016-12-11 13:07:50.000000000 +0100
++++ eq10q-2.2_patched/gui/dyn_ui.cpp	2021-05-24 19:24:34.363536592 +0200
+@@ -37,7 +37,7 @@ This plugin is inside the Sapista Plugin
+ using namespace std;
+ #endif
+ 
+-static LV2UI_Handle instantiateDyn_gui(const _LV2UI_Descriptor *descriptor, const char *plugin_uri, const char *bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features)
++static LV2UI_Handle instantiateDyn_gui(const LV2UI_Descriptor *descriptor, const char *plugin_uri, const char *bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features)
+ {
+   #ifdef TESTING_EQ10Q
+   cout<<"instantiateDyn_gui Entring... ";
+diff -rupN eq10q-2.2_original/gui/eq10q_ui.cpp eq10q-2.2_patched/gui/eq10q_ui.cpp
+--- eq10q-2.2_original/gui/eq10q_ui.cpp	2016-12-11 13:07:50.000000000 +0100
++++ eq10q-2.2_patched/gui/eq10q_ui.cpp	2021-05-24 19:24:34.363536592 +0200
+@@ -38,7 +38,7 @@ using namespace std;
+ #endif
+ 
+ 
+-static LV2UI_Handle instantiateEq10q_gui(const _LV2UI_Descriptor *descriptor, const char *plugin_uri, const char *bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features)
++static LV2UI_Handle instantiateEq10q_gui(const LV2UI_Descriptor *descriptor, const char *plugin_uri, const char *bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features)
+ {
+   #ifdef TESTING_EQ10Q
+   cout<<"instantiateEq10q_gui Entring... ";
+diff -rupN eq10q-2.2_original/gui/midside_ui.cpp eq10q-2.2_patched/gui/midside_ui.cpp
+--- eq10q-2.2_original/gui/midside_ui.cpp	2016-12-11 13:07:53.000000000 +0100
++++ eq10q-2.2_patched/gui/midside_ui.cpp	2021-05-24 19:24:34.367536562 +0200
+@@ -37,7 +37,7 @@ This plugin is inside the Sapista Plugin
+ using namespace std;
+ #endif
+ 
+-static LV2UI_Handle instantiateMidSide_gui(const _LV2UI_Descriptor *descriptor, const char *plugin_uri, const char *bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features)
++static LV2UI_Handle instantiateMidSide_gui(const LV2UI_Descriptor *descriptor, const char *plugin_uri, const char *bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features)
+ {
+   #ifdef TESTING_EQ10Q
+   cout<<"instantiateEq10q_gui Entring... ";