summaryrefslogtreecommitdiff
path: root/media-sound/seq24/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-03-19 11:37:34 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-03-19 11:37:34 +0000
commitb7b97785ebbb2f11d24d14dab8b81ed274f4ce6a (patch)
tree9fd110f9fc996e8a4213eeda994a8c112491b86d /media-sound/seq24/files
parent066d27181e9a797ad9f8fc43b49fc9a10ff2f707 (diff)
gentoo resync : 19.03.2019
Diffstat (limited to 'media-sound/seq24/files')
-rw-r--r--media-sound/seq24/files/seq24-0.9.2-lash-fix.patch248
-rw-r--r--media-sound/seq24/files/seq24-0.9.3-std-mutex.patch331
2 files changed, 331 insertions, 248 deletions
diff --git a/media-sound/seq24/files/seq24-0.9.2-lash-fix.patch b/media-sound/seq24/files/seq24-0.9.2-lash-fix.patch
deleted file mode 100644
index 8b0efadb7b55..000000000000
--- a/media-sound/seq24/files/seq24-0.9.2-lash-fix.patch
+++ /dev/null
@@ -1,248 +0,0 @@
-Upstream fix for segfault when built with lash support.
-https://bugs.launchpad.net/seq24/+bug/696371
-
-=== modified file 'src/lash.cpp'
---- old/src/lash.cpp
-+++ new/src/lash.cpp
-@@ -29,17 +29,9 @@
- lash::lash(int *argc, char ***argv)
- {
- #ifdef LASH_SUPPORT
-- m_lash_args = lash_extract_args(argc, argv);
--#endif // LASH_SUPPORT
--}
--
--
--void lash::init(perform* perform)
--{
--#ifdef LASH_SUPPORT
-- m_perform = perform;
--
-- m_client = lash_init(m_lash_args, PACKAGE_NAME,
-+ m_perform = NULL;
-+
-+ m_client = lash_init(lash_extract_args(argc, argv), PACKAGE_NAME,
- LASH_Config_File, LASH_PROTOCOL(2, 0));
-
- if (m_client == NULL) {
-@@ -65,9 +57,10 @@
-
-
- void
--lash::start()
-+lash::start(perform* perform)
- {
- #ifdef LASH_SUPPORT
-+ m_perform = perform;
- /* Process any LASH events every 250 msec (arbitrarily chosen interval) */
- Glib::signal_timeout().connect(sigc::mem_fun(*this, &lash::process_events), 250);
- #endif // LASH_SUPPORT
-
-=== modified file 'src/lash.h'
---- old/src/lash.h
-+++ new/src/lash.h
-@@ -43,7 +43,6 @@
- #ifdef LASH_SUPPORT
- perform *m_perform;
- lash_client_t *m_client;
-- lash_args_t *m_lash_args;
-
- bool process_events();
- void handle_event(lash_event_t* conf);
-@@ -54,13 +53,12 @@
- public:
- lash(int *argc, char ***argv);
-
-- void init(perform* perform);
- void set_alsa_client_id(int id);
-- void start();
-+ void start(perform* perform);
- };
-
-
--/* global lash driver, defined in seq24.cpp */
-+/* global lash driver, defined in seq24.cpp and used in midibus.cpp*/
- extern lash *lash_driver;
-
-
-
-=== modified file 'src/midibus.cpp'
---- old/src/midibus.cpp
-+++ new/src/midibus.cpp
-@@ -877,11 +877,11 @@
-
- /* set up our clients queue */
- m_queue = snd_seq_alloc_queue( m_alsa_seq );
--#endif
- #ifdef LASH_SUPPORT
- /* notify lash of our client ID so it can restore connections */
- lash_driver->set_alsa_client_id(snd_seq_client_id(m_alsa_seq));
- #endif
-+#endif
- }
-
-
-
-=== modified file 'src/perform.cpp'
---- old/src/perform.cpp
-+++ new/src/perform.cpp
-@@ -1342,6 +1342,7 @@
- stats_last_clock_us= (last.tv_sec * 1000000) + (last.tv_nsec / 1000);
- #else
- /* get start time position */
-+ /* timeGetTime() returns a "DWORD" type (= unsigned long)*/
- last = timeGetTime();
-
- if ( global_stats )
-
-=== modified file 'src/seq24.cpp'
---- old/src/seq24.cpp
-+++ new/src/seq24.cpp
-@@ -108,12 +108,66 @@
- * GTK+. */
- Gtk::Main kit(argc, argv);
-
-- /* Init the lash driver (strips lash specific command line
-- * arguments, but does not connect to daemon) */
-+ /*prepare global MIDI definitions*/
-+ for ( int i=0; i<c_maxBuses; i++ )
-+ {
-+ for ( int j=0; j<16; j++ )
-+ global_user_midi_bus_definitions[i].instrument[j] = -1;
-+ }
-+
-+ for ( int i=0; i<c_max_instruments; i++ )
-+ {
-+ for ( int j=0; j<128; j++ )
-+ global_user_instrument_definitions[i].controllers_active[j] = false;
-+ }
-+
-+
-+ /* Init the lash driver (strip lash specific command line
-+ * arguments and connect to daemon) */
- #ifdef LASH_SUPPORT
- lash_driver = new lash(&argc, &argv);
- #endif
-
-+ /* the main performance object */
-+ /* lash must be initialized here because mastermidibus uses the global
-+ * lash_driver variable*/
-+ perform p;
-+
-+ /* read user preferences files */
-+ if ( getenv( HOME ) != NULL )
-+ {
-+ Glib::ustring home( getenv( HOME ));
-+ last_used_dir = home;
-+ Glib::ustring total_file = home + SLASH + config_filename;
-+
-+ if (Glib::file_test(total_file, Glib::FILE_TEST_EXISTS))
-+ {
-+ printf( "Reading [%s]\n", total_file.c_str());
-+
-+ optionsfile options( total_file );
-+
-+ if ( !options.parse( &p ) ){
-+ printf( "Error Reading [%s]\n", total_file.c_str());
-+ }
-+ }
-+
-+ total_file = home + SLASH + user_filename;
-+ if (Glib::file_test(total_file, Glib::FILE_TEST_EXISTS))
-+ {
-+ printf( "Reading [%s]\n", total_file.c_str());
-+
-+ userfile user( total_file );
-+
-+ if ( !user.parse( &p ) ){
-+ printf( "Error Reading [%s]\n", total_file.c_str());
-+ }
-+ }
-+
-+ }
-+ else
-+ printf( "Error calling getenv( \"%s\" )\n", HOME );
-+
-+
- /* parse parameters */
- int c;
-
-@@ -229,65 +283,14 @@
- } /* end while */
-
-
-- /*prepare global MIDI definitions*/
-- for ( int i=0; i<c_maxBuses; i++ )
-- {
-- for ( int j=0; j<16; j++ )
-- global_user_midi_bus_definitions[i].instrument[j] = -1;
-- }
--
-- for ( int i=0; i<c_max_instruments; i++ )
-- {
-- for ( int j=0; j<128; j++ )
-- global_user_instrument_definitions[i].controllers_active[j] = false;
-- }
--
--
-- /* the main performance object */
-- perform p;
--
-- p_font_renderer = new font();
--
--
-- if ( getenv( HOME ) != NULL )
-- {
-- Glib::ustring home( getenv( HOME ));
-- last_used_dir = home;
-- Glib::ustring total_file = home + SLASH + config_filename;
--
-- if (Glib::file_test(total_file, Glib::FILE_TEST_EXISTS))
-- {
-- printf( "Reading [%s]\n", total_file.c_str());
--
-- optionsfile options( total_file );
--
-- if ( !options.parse( &p ) ){
-- printf( "Error Reading [%s]\n", total_file.c_str());
-- }
-- }
--
-- total_file = home + SLASH + user_filename;
-- if (Glib::file_test(total_file, Glib::FILE_TEST_EXISTS))
-- {
-- printf( "Reading [%s]\n", total_file.c_str());
--
-- userfile user( total_file );
--
-- if ( !user.parse( &p ) ){
-- printf( "Error Reading [%s]\n", total_file.c_str());
-- }
-- }
--
-- }
-- else
-- printf( "Error calling getenv( \"%s\" )\n", HOME );
--
- p.init();
- p.launch_input_thread();
- p.launch_output_thread();
- p.init_jack();
-
-
-+ p_font_renderer = new font();
-+
- mainwnd seq24_window( &p );
- if (optind < argc)
- {
-@@ -299,8 +302,7 @@
-
- /* connect to lash daemon and poll events*/
- #ifdef LASH_SUPPORT
-- lash_driver->init(&p);
-- lash_driver->start();
-+ lash_driver->start(&p);
- #endif
- kit.run(seq24_window);
-
-
diff --git a/media-sound/seq24/files/seq24-0.9.3-std-mutex.patch b/media-sound/seq24/files/seq24-0.9.3-std-mutex.patch
new file mode 100644
index 000000000000..4e8585a94491
--- /dev/null
+++ b/media-sound/seq24/files/seq24-0.9.3-std-mutex.patch
@@ -0,0 +1,331 @@
+Description: Use standard mutex and condition variable classes
+ Use std::recursive_mutex and std::condition_variable instead of custom classes
+ based on pthread.
+ .
+ Fixes FTBFS with recent GCC versions which defines the "mutex" class which
+ conflicts with seq24's version of "mutex".
+Author: James Cowgill <jcowgill@debian.org>
+Bug: https://bugs.launchpad.net/seq24/+bug/1647614
+Bug-Debian: https://bugs.debian.org/822394
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/Module.am
++++ b/src/Module.am
+@@ -31,8 +31,6 @@ bin_PROGRAMS = %D%/seq24
+ %D%/midibus_portmidi.h \
+ %D%/midifile.cpp \
+ %D%/midifile.h \
+- %D%/mutex.cpp \
+- %D%/mutex.h \
+ %D%/options.cpp \
+ %D%/options.h \
+ %D%/optionsfile.cpp \
+--- a/src/midibus.h
++++ b/src/midibus.h
+@@ -35,11 +35,11 @@ class midibus;
+ # include <alsa/seq_midi_event.h>
+ #endif
+
++#include <mutex>
+ #include <string>
+
+ #include "event.h"
+ #include "sequence.h"
+-#include "mutex.h"
+ #include "globals.h"
+
+ const int c_midibus_output_size = 0x100000;
+@@ -90,7 +90,7 @@ class midibus
+
+
+ /* locking */
+- mutex m_mutex;
++ std::recursive_mutex m_mutex;
+
+ /* mutex */
+ void lock();
+@@ -208,7 +208,7 @@ class mastermidibus
+ sequence *m_seq;
+
+ /* locking */
+- mutex m_mutex;
++ std::recursive_mutex m_mutex;
+
+ /* mutex */
+ void lock();
+--- a/src/midibus_portmidi.h
++++ b/src/midibus_portmidi.h
+@@ -25,12 +25,12 @@ class mastermidibus;
+
+ #ifdef __WIN32__
+
++#include <mutex>
+ #include <string>
+
+ #include "portmidi.h"
+ #include "event.h"
+ #include "sequence.h"
+-#include "mutex.h"
+ #include "globals.h"
+
+ const int c_midibus_output_size = 0x100000;
+@@ -65,7 +65,7 @@ class midibus
+ long m_lasttick;
+
+ /* locking */
+- mutex m_mutex;
++ std::recursive_mutex m_mutex;
+
+ /* mutex */
+ void lock();
+@@ -164,7 +164,7 @@ class mastermidibus
+ sequence *m_seq;
+
+ /* locking */
+- mutex m_mutex;
++ std::recursive_mutex m_mutex;
+
+ /* mutex */
+ void lock();
+--- a/src/mutex.cpp
++++ /dev/null
+@@ -1,62 +0,0 @@
+-//----------------------------------------------------------------------------
+-//
+-// This file is part of seq24.
+-//
+-// seq24 is free software; you can redistribute it and/or modify
+-// it under the terms of the GNU General Public License as published by
+-// the Free Software Foundation; either version 2 of the License, or
+-// (at your option) any later version.
+-//
+-// seq24 is distributed in the hope that it will be useful,
+-// but WITHOUT ANY WARRANTY; without even the implied warranty of
+-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-// GNU General Public License for more details.
+-//
+-// You should have received a copy of the GNU General Public License
+-// along with seq24; if not, write to the Free Software
+-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-//
+-//-----------------------------------------------------------------------------
+-
+-#include "mutex.h"
+-
+-const pthread_mutex_t mutex::recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+-const pthread_cond_t condition_var::cond = PTHREAD_COND_INITIALIZER;
+-
+-mutex::mutex( )
+-{
+- m_mutex_lock = recmutex;
+-}
+-
+-void
+-mutex::lock( )
+-{
+- pthread_mutex_lock( &m_mutex_lock );
+-}
+-
+-
+-void
+-mutex::unlock( )
+-{
+- pthread_mutex_unlock( &m_mutex_lock );
+-}
+-
+-condition_var::condition_var( )
+-{
+- m_cond = cond;
+-}
+-
+-
+-void
+-condition_var::signal( )
+-{
+- pthread_cond_signal( &m_cond );
+-}
+-
+-void
+-condition_var::wait( )
+-{
+- pthread_cond_wait( &m_cond, &m_mutex_lock );
+-}
+-
+-
+--- a/src/mutex.h
++++ /dev/null
+@@ -1,63 +0,0 @@
+-//----------------------------------------------------------------------------
+-//
+-// This file is part of seq24.
+-//
+-// seq24 is free software; you can redistribute it and/or modify
+-// it under the terms of the GNU General Public License as published by
+-// the Free Software Foundation; either version 2 of the License, or
+-// (at your option) any later version.
+-//
+-// seq24 is distributed in the hope that it will be useful,
+-// but WITHOUT ANY WARRANTY; without even the implied warranty of
+-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-// GNU General Public License for more details.
+-//
+-// You should have received a copy of the GNU General Public License
+-// along with seq24; if not, write to the Free Software
+-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-//
+-//-----------------------------------------------------------------------------
+-
+-#pragma once
+-
+-#include "globals.h"
+-
+-#include <pthread.h>
+-
+-class mutex {
+-
+-private:
+-
+- static const pthread_mutex_t recmutex;
+-
+-protected:
+-
+- /* mutex lock */
+- pthread_mutex_t m_mutex_lock;
+-
+-public:
+-
+- mutex();
+-
+- void lock();
+- void unlock();
+-
+-};
+-
+-class condition_var : public mutex {
+-
+-private:
+-
+- static const pthread_cond_t cond;
+-
+- pthread_cond_t m_cond;
+-
+-public:
+-
+- condition_var();
+-
+- void wait();
+- void signal();
+-
+-};
+-
+--- a/src/perform.cpp
++++ b/src/perform.cpp
+@@ -426,7 +426,7 @@ perform::~perform()
+ m_outputing = false;
+ m_running = false;
+
+- m_condition_var.signal();
++ m_condition_var.notify_one();
+
+ if (m_out_thread_launched )
+ pthread_join( m_out_thread, NULL );
+@@ -1005,7 +1005,7 @@ void perform::stop()
+
+ void perform::inner_start(bool a_state)
+ {
+- m_condition_var.lock();
++ std::lock_guard<std::mutex> lock(m_mutex);
+
+ if (!is_running()) {
+
+@@ -1015,10 +1015,8 @@ void perform::inner_start(bool a_state)
+ off_sequences();
+
+ set_running(true);
+- m_condition_var.signal();
++ m_condition_var.notify_one();
+ }
+-
+- m_condition_var.unlock();
+ }
+
+
+@@ -1262,18 +1260,18 @@ void perform::output_func()
+
+ //printf ("waiting for signal\n");
+
+- m_condition_var.lock();
++ std::unique_lock<std::mutex> lock(m_mutex);
+
+ while (!m_running) {
+
+- m_condition_var.wait();
++ m_condition_var.wait(lock);
+
+ /* if stopping, then kill thread */
+ if (!m_outputing)
+ break;
+ }
+
+- m_condition_var.unlock();
++ lock.unlock();
+
+ //printf( "signaled [%d]\n", m_playback_mode );
+
+--- a/src/perform.h
++++ b/src/perform.h
+@@ -32,6 +32,9 @@ class perform;
+ #endif
+ #include <pthread.h>
+
++#include <condition_variable>
++#include <mutex>
++
+
+ /* if we have jack, include the jack headers */
+ #ifdef JACK_SUPPORT
+@@ -152,7 +155,8 @@ class perform
+ int m_control_status;
+ int m_screen_set;
+
+- condition_var m_condition_var;
++ std::condition_variable m_condition_var;
++ std::mutex m_mutex;
+
+ // do not access these directly, use set/lookup below
+ std::map<unsigned int,long> key_events;
+--- a/src/perfroll.h
++++ b/src/perfroll.h
+@@ -39,8 +39,6 @@
+
+ #include "globals.h"
+ #include "perform.h"
+-#include "mutex.h"
+-
+
+ using namespace Gtk;
+
+--- a/src/sequence.h
++++ b/src/sequence.h
+@@ -26,11 +26,11 @@ class sequence;
+ #include <string>
+ #include <list>
+ #include <stack>
++#include <mutex>
+
+ #include "event.h"
+ #include "midibus.h"
+ #include "globals.h"
+-#include "mutex.h"
+
+ enum draw_type
+ {
+@@ -153,7 +153,7 @@ class sequence
+ long m_rec_vol;
+
+ /* locking */
+- mutex m_mutex;
++ std::recursive_mutex m_mutex;
+
+ /* used to idenfity which events are ours in the out queue */
+ //unsigned char m_tag;