[SCM] sonic-pi/master: Remove patches that have been accepted upstream.

hanno-guest at users.alioth.debian.org hanno-guest at users.alioth.debian.org
Fri Apr 15 13:08:21 UTC 2016


The following commit has been merged in the master branch:
commit 4bb5369d6baef7590b9c6db98cc81e0a924b2c0d
Author: Hanno Zulla <hanno.zulla at epublica.de>
Date:   Fri Apr 15 14:58:28 2016 +0200

    Remove patches that have been accepted upstream.

diff --git a/debian/patches/01-qt5scintilla.patch b/debian/patches/01-qt5scintilla.patch
deleted file mode 100644
index 6b5b10f..0000000
--- a/debian/patches/01-qt5scintilla.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Description: use Qt5 QScintilla to build Sonic Pi GUI
- Upstream builds binaries of Sonic Pi with different settings, using
- Qt5 for Windows and OS X, Qt4 for Raspbian. This patch modifies the
- settings to use Qt5 (and the Qt5 QScintilla library) for building the
- binary. A modified version of this patch was sent upstream and has
- since been accepted to be included in a future release. 
-Forwarded: yes
-Author: Hanno Zulla <kontakt at hanno.de>
-Last-Update: 2016-01-11
-
-Index: pkg-sonic-pi/app/gui/qt/SonicPi.pro
-===================================================================
---- pkg-sonic-pi.orig/app/gui/qt/SonicPi.pro	2016-01-11 14:55:26.485843387 +0100
-+++ pkg-sonic-pi/app/gui/qt/SonicPi.pro	2016-01-11 14:55:26.481843422 +0100
-@@ -19,7 +19,7 @@
- 
- # -- Change to match the location of QScintilla on your system
- #
-- LIBS += -L/Users/sam/Downloads/tmp/QScintilla-gpl-2.9/Qt4Qt5 -lqscintilla2
-+ LIBS += -L/Users/sam/Downloads/tmp/QScintilla-gpl-2.9/Qt4Qt5 -lqt5scintilla2
-  INCLUDEPATH += /Users/sam/Downloads/tmp/QScintilla-gpl-2.9/Qt4Qt5
-  DEPENDPATH += /Users/sam/Downloads/tmp/QScintilla-gpl-2.9/Qt4Qt5
- # --
-@@ -108,7 +108,7 @@
- RC_FILE = SonicPi.rc
- 
- ICON = images/app.icns
--LIBS         += -lqscintilla2
-+LIBS         += -lqt5scintilla2
- 
- win32 {
- 	install_qsci.files = $$[QT_INSTALL_LIBS]\qscintilla2.dll
diff --git a/debian/patches/02-paths.patch b/debian/patches/02-paths.patch
deleted file mode 100644
index 1bf41a7..0000000
--- a/debian/patches/02-paths.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-Description: use fhs directory scheme
- Upstream expects to install Sonic Pi in a single directory
- (e.g. /opt/sonic-pi) and then uses a relative directory scheme to find
- binaries, libraries and assets in there. This patch modifies the path
- settings to follow the fhs guidelines. A modified version of this patch
- was sent upstream and has since been accepted to in be included in a
- future release.
- <URL: https://github.com/samaaron/sonic-pi/pull/916>
-Forwarded: yes
-Author: Hanno Zulla <kontakt at hanno.de>
-Last-Update: 2016-01-11
-
-Index: pkg-sonic-pi/app/gui/qt/mainwindow.cpp
-===================================================================
---- pkg-sonic-pi.orig/app/gui/qt/mainwindow.cpp	2016-01-11 14:57:34.012741792 +0100
-+++ pkg-sonic-pi/app/gui/qt/mainwindow.cpp	2016-01-11 14:57:33.984742032 +0100
-@@ -676,29 +676,44 @@
- 
- 
-     serverProcess = new QProcess();
-+    QString prg_path, prg_arg;
- 
--    QString root = rootPath();
-+    if (QCoreApplication::applicationDirPath().startsWith("/usr/bin")) {
- 
--  #if defined(Q_OS_WIN)
--    QString prg_path = root + "/app/server/native/windows/ruby/bin/ruby.exe";
--    QString prg_arg = root + "/app/server/bin/sonic-pi-server.rb";
--    sample_path = root + "/etc/samples";
--  #elif defined(Q_OS_MAC)
--    QString prg_path = root + "/server/native/osx/ruby/bin/ruby";
--    QString prg_arg = root + "/server/bin/sonic-pi-server.rb";
--    sample_path = root + "/etc/samples";
--  #else
--    //assuming Raspberry Pi
--    QString prg_path = root + "/app/server/native/raspberry/ruby/bin/ruby";
--    QFile file(prg_path);
--    if(!file.exists()) {
--      // use system ruby if bundled ruby doesn't exist
-+      // Sonic Pi is installed on desktop Linux from a binary package
-       prg_path = "/usr/bin/ruby";
--    }
-+      prg_arg = "/usr/lib/sonic-pi/server/bin/sonic-pi-server.rb";
-+      sample_path = "/usr/share/sonic-pi/samples";
-+
-+    } else {
-+      
-+      // Sonic Pi is running in the user's local dir or
-+      // is installed on Win/Mac/RPi
-+
-+      QString root = rootPath();
-+
-+     #if defined(Q_OS_WIN)
-+      QString prg_path = root + "/app/server/native/windows/ruby/bin/ruby.exe";
-+      QString prg_arg = root + "/app/server/bin/sonic-pi-server.rb";
-+      sample_path = root + "/etc/samples";
-+     #elif defined(Q_OS_MAC)
-+      QString prg_path = root + "/server/native/osx/ruby/bin/ruby";
-+      QString prg_arg = root + "/server/bin/sonic-pi-server.rb";
-+      sample_path = root + "/etc/samples";
-+     #else
-+      //assuming Raspberry Pi
-+      QString prg_path = root + "/app/server/native/raspberry/ruby/bin/ruby";
-+      QFile file(prg_path);
-+      if(!file.exists()) {
-+        // use system ruby if bundled ruby doesn't exist
-+        prg_path = "/usr/bin/ruby";
-+      }
-+      
-+      prg_arg = root + "/app/server/bin/sonic-pi-server.rb";
-+      sample_path = root + "/etc/samples";
-+     #endif
- 
--    QString prg_arg = root + "/app/server/bin/sonic-pi-server.rb";
--    sample_path = root + "/etc/samples";
--  #endif
-+    }
- 
-     prg_path = QDir::toNativeSeparators(prg_path);
-     prg_arg = QDir::toNativeSeparators(prg_arg);
-@@ -712,7 +727,6 @@
-     }
- 
- 
--
-     //    std::cout << "[GUI] - exec "<< prg_path.toStdString() << " " << prg_arg.toStdString() << std::endl;
- 
-     std::cout << "[GUI] - booting live coding server" << std::endl;
-Index: pkg-sonic-pi/app/server/core.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/core.rb	2016-01-11 14:57:34.012741792 +0100
-+++ pkg-sonic-pi/app/server/core.rb	2016-01-11 14:57:33.984742032 +0100
-@@ -53,7 +53,8 @@
-   module Core
-     module SPRand
-       # Read in same random numbers as server for random stream sync
--      @@random_numbers = ::WaveFile::Reader.new(File.expand_path("../../../etc/buffers/rand-stream.wav", __FILE__), ::WaveFile::Format.new(:mono, :float, 44100)).read(441000).samples.freeze
-+      random_numbers_path = File.dirname(__FILE__).start_with?("/usr/lib/sonic-pi") ? "/usr/share/sonic-pi" : "../../../etc"
-+      @@random_numbers = ::WaveFile::Reader.new(File.expand_path("#{random_numbers_path}/buffers/rand-stream.wav", __FILE__), ::WaveFile::Format.new(:mono, :float, 44100)).read(441000).samples.freeze
- 
-       def self.to_a
-         @@random_numbers
-Index: pkg-sonic-pi/app/server/sonicpi/lib/sonicpi/util.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/sonicpi/lib/sonicpi/util.rb	2016-01-11 14:57:34.012741792 +0100
-+++ pkg-sonic-pi/app/server/sonicpi/lib/sonicpi/util.rb	2016-01-11 14:57:33.984742032 +0100
-@@ -169,7 +169,9 @@
-     end
- 
-     def snippets_path
--      File.absolute_path("#{etc_path}/snippets")
-+      File.dirname(__FILE__).start_with?("/usr/lib/sonic-pi") ?
-+        File.absolute_path("/usr/share/sonic-pi/snippets") :
-+        File.absolute_path("#{etc_path}/snippets")
-     end
- 
-     def doc_path
-@@ -189,15 +191,21 @@
-     end
- 
-     def synthdef_path
--      File.absolute_path("#{etc_path}/synthdefs/compiled")
-+      File.dirname(__FILE__).start_with?("/usr/lib/sonic-pi") ?
-+        File.absolute_path("/usr/share/sonic-pi/synthdefs/compiled") :
-+        File.absolute_path("#{etc_path}/synthdefs/compiled")
-     end
- 
-     def samples_path
--      File.absolute_path("#{etc_path}/samples")
-+      File.dirname(__FILE__).start_with?("/usr/lib/sonic-pi") ?
-+        File.absolute_path("/usr/share/sonic-pi/samples") :
-+        File.absolute_path("#{etc_path}/samples")
-     end
- 
-     def buffers_path
--      File.absolute_path("#{etc_path}/buffers")
-+      File.dirname(__FILE__).start_with?("/usr/lib/sonic-pi") ?
-+        File.absolute_path("/usr/share/sonic-pi/buffers") :
-+        File.absolute_path("#{etc_path}/buffers")
-     end
- 
-     def app_path
-Index: pkg-sonic-pi/app/server/util.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/util.rb	2016-01-11 14:57:34.012741792 +0100
-+++ pkg-sonic-pi/app/server/util.rb	2016-01-11 14:57:34.008741826 +0100
-@@ -16,11 +16,15 @@
- end
- 
- def sp_scripts_path()
--  File.absolute_path("#{sp_sonic_pi_path}/app/scripts")
-+  File.dirname(__FILE__).start_with?("/usr/lib/sonic-pi") ?
-+    File.absolute_path("/usr/lib/sonic-pi/scripts") :
-+    File.absolute_path("#{sp_sonic_pi_path}/app/scripts")
- end
- 
- def sp_synthdefs_path()
--  File.absolute_path("#{sp_sonic_pi_path}/app/etc/synthdefs/compiled")
-+  File.dirname(__FILE__).start_with?("/usr/lib/sonic-pi") ?
-+    File.absolute_path("/usr/share/sonic-pi/synthdefs/compiled") :
-+    File.absolute_path("#{sp_sonic_pi_path}/app/etc/synthdefs/compiled")
- end
- 
- def spider_log(message)
diff --git a/debian/patches/03-remove-rpi-volume.patch b/debian/patches/03-remove-rpi-volume.patch
deleted file mode 100644
index 9c02128..0000000
--- a/debian/patches/03-remove-rpi-volume.patch
+++ /dev/null
@@ -1,358 +0,0 @@
-Description: show Raspberry Pi soundcard controls on RPi hardware, only
- Upstream develops mainly for Raspbian, but not for generic Linux.
- Qt's Q_OS_LINUX is used in the original source to activate the
- Raspberry Pi audio controls. This patch detects if the application is
- actually running on Raspberry Pi hardware and activates the controls
- accordingly. This patch was forwarded upstream with
- <URL: https://github.com/samaaron/sonic-pi/pull/842> but rejected,
- Sam wants to rethink the audio controls in the long term instead.
-Forwarded: yes
-Author: Hanno Zulla <kontakt at hanno.de>
-Last-Update: 2016-01-11
-
-Index: pkg-sonic-pi/app/gui/qt/mainwindow.cpp
-===================================================================
---- pkg-sonic-pi.orig/app/gui/qt/mainwindow.cpp	2016-01-11 15:00:35.171184925 +0100
-+++ pkg-sonic-pi/app/gui/qt/mainwindow.cpp	2016-01-11 15:00:35.147185131 +0100
-@@ -119,6 +119,10 @@
-   }
- 
-   this->i18n = i18n;
-+  
-+#if defined(Q_OS_LINUX)
-+  this->raspberryPiSoundcard = isRaspberryPiSoundcard();
-+#endif
- 
-   printAsciiArtLogo();
- 
-@@ -727,6 +731,7 @@
-     }
- 
- 
-+
-     //    std::cout << "[GUI] - exec "<< prg_path.toStdString() << " " << prg_arg.toStdString() << std::endl;
- 
-     std::cout << "[GUI] - booting live coding server" << std::endl;
-@@ -817,9 +822,44 @@
-   tabs->setTabPosition(QTabWidget::South);
- 
-   QGridLayout *grid = new QGridLayout;
--
--  QGroupBox *volBox = new QGroupBox(tr("Raspberry Pi System Volume"));
--  volBox->setToolTip(tr("Use this slider to change the system volume of your Raspberry Pi."));
-+  
-+#if defined(Q_OS_LINUX)
-+  if (raspberryPiSoundcard) {
-+    QGroupBox *volBox = new QGroupBox(tr("Raspberry Pi System Volume"));
-+    volBox->setToolTip(tr("Use this slider to change the system volume of your Raspberry Pi."));
-+
-+    QGroupBox *audioOutputBox = new QGroupBox(tr("Raspberry Pi Audio Output"));
-+    audioOutputBox->setToolTip(tr("Your Raspberry Pi has two forms of audio output.\nFirstly, there is the headphone jack of the Raspberry Pi itself.\nSecondly, some HDMI monitors/TVs support audio through the HDMI port.\nUse these buttons to force the output to the one you want."));
-+    rp_force_audio_default = new QRadioButton(tr("&Default"));
-+    rp_force_audio_headphones = new QRadioButton(tr("&Headphones"));
-+    rp_force_audio_hdmi = new QRadioButton(tr("&HDMI"));
-+
-+    connect(rp_force_audio_default, SIGNAL(clicked()), this, SLOT(setRPSystemAudioAuto()));
-+    connect(rp_force_audio_headphones, SIGNAL(clicked()), this, SLOT(setRPSystemAudioHeadphones()));
-+    connect(rp_force_audio_hdmi, SIGNAL(clicked()), this, SLOT(setRPSystemAudioHDMI()));
-+
-+    QVBoxLayout *audio_box = new QVBoxLayout;
-+    audio_box->addWidget(rp_force_audio_default);
-+    audio_box->addWidget(rp_force_audio_headphones);
-+    audio_box->addWidget(rp_force_audio_hdmi);
-+    audio_box->addStretch(1);
-+    audioOutputBox->setLayout(audio_box);
-+
-+    QHBoxLayout *vol_box = new QHBoxLayout;
-+    rp_system_vol = new QSlider(this);
-+    connect(rp_system_vol, SIGNAL(valueChanged(int)), this, SLOT(changeRPSystemVol(int)));
-+    vol_box->addWidget(rp_system_vol);
-+    volBox->setLayout(vol_box);
-+
-+    QGroupBox *audio_prefs_box = new QGroupBox();
-+    QGridLayout *audio_prefs_box_layout = new QGridLayout;
-+
-+    audio_prefs_box_layout->addWidget(audioOutputBox, 0, 0);
-+    audio_prefs_box_layout->addWidget(volBox, 0, 1);
-+    audio_prefs_box->setLayout(audio_prefs_box_layout);
-+    prefTabs->addTab(audio_prefs_box, tr("Audio"));
-+  }
-+#endif
- 
-   QGroupBox *advancedAudioBox = new QGroupBox(tr("Advanced Audio"));
-   advancedAudioBox->setToolTip(tr("Advanced audio settings for working with\nexternal PA systems when performing with Sonic Pi."));
-@@ -843,30 +883,6 @@
-   advancedAudioBox->setLayout(advanced_audio_box_layout);
- 
- 
--  QGroupBox *audioOutputBox = new QGroupBox(tr("Raspberry Pi Audio Output"));
--  audioOutputBox->setToolTip(tr("Your Raspberry Pi has two forms of audio output.\nFirstly, there is the headphone jack of the Raspberry Pi itself.\nSecondly, some HDMI monitors/TVs support audio through the HDMI port.\nUse these buttons to force the output to the one you want."));
--  rp_force_audio_default = new QRadioButton(tr("&Default"));
--  rp_force_audio_headphones = new QRadioButton(tr("&Headphones"));
--  rp_force_audio_hdmi = new QRadioButton(tr("&HDMI"));
--
--
--  connect(rp_force_audio_default, SIGNAL(clicked()), this, SLOT(setRPSystemAudioAuto()));
--  connect(rp_force_audio_headphones, SIGNAL(clicked()), this, SLOT(setRPSystemAudioHeadphones()));
--  connect(rp_force_audio_hdmi, SIGNAL(clicked()), this, SLOT(setRPSystemAudioHDMI()));
--
--  QVBoxLayout *audio_box = new QVBoxLayout;
--  audio_box->addWidget(rp_force_audio_default);
--  audio_box->addWidget(rp_force_audio_headphones);
--  audio_box->addWidget(rp_force_audio_hdmi);
--  audio_box->addStretch(1);
--  audioOutputBox->setLayout(audio_box);
--
--  QHBoxLayout *vol_box = new QHBoxLayout;
--  rp_system_vol = new QSlider(this);
--  connect(rp_system_vol, SIGNAL(valueChanged(int)), this, SLOT(changeRPSystemVol(int)));
--  vol_box->addWidget(rp_system_vol);
--  volBox->setLayout(vol_box);
--
-   QGroupBox *debug_box = new QGroupBox(tr("Logging"));
-   debug_box->setToolTip(tr("Configure debug behaviour"));
- 
-@@ -984,17 +1000,7 @@
-   editor_box->setLayout(gridEditorPrefs);
-   grid->addWidget(prefTabs, 0, 0);
- 
--#if defined(Q_OS_LINUX)
--  QGroupBox *audio_prefs_box = new QGroupBox();
--  QGridLayout *audio_prefs_box_layout = new QGridLayout;
--
--  audio_prefs_box_layout->addWidget(audioOutputBox, 0, 0);
--  audio_prefs_box_layout->addWidget(volBox, 0, 1);
--  audio_prefs_box->setLayout(audio_prefs_box_layout);
--  prefTabs->addTab(audio_prefs_box, tr("Audio"));
--#endif
--
--    QGroupBox *studio_prefs_box = new QGroupBox();
-+  QGroupBox *studio_prefs_box = new QGroupBox();
-   QGridLayout *studio_prefs_box_layout = new QGridLayout;
- 
-   studio_prefs_box_layout->addWidget(advancedAudioBox, 0, 0);
-@@ -1064,9 +1070,25 @@
-   mixer_force_mono->setChecked(settings.value("prefs/mixer-force-mono", false).toBool());
-   mixer_invert_stereo->setChecked(settings.value("prefs/mixer-invert-stereo", false).toBool());
- 
--  rp_force_audio_default->setChecked(settings.value("prefs/rp/force-audio-default", true).toBool());
--  rp_force_audio_headphones->setChecked(settings.value("prefs/rp/force-audio-headphones", false).toBool());
--  rp_force_audio_hdmi->setChecked(settings.value("prefs/rp/force-audio-hdmi", false).toBool());
-+#if defined(Q_OS_LINUX)
-+  if (raspberryPiSoundcard) {
-+    rp_force_audio_default->setChecked(settings.value("prefs/rp/force-audio-default", true).toBool());
-+    rp_force_audio_headphones->setChecked(settings.value("prefs/rp/force-audio-headphones", false).toBool());
-+    rp_force_audio_hdmi->setChecked(settings.value("prefs/rp/force-audio-hdmi", false).toBool());
-+    int stored_vol = settings.value("prefs/rp/system-vol", 50).toInt();
-+    rp_system_vol->setValue(stored_vol);
-+    changeRPSystemVol(stored_vol);
-+    if(settings.value("prefs/rp/force-audio-default", true).toBool()) {
-+      setRPSystemAudioAuto();
-+    }
-+    if(settings.value("prefs/rp/force-audio-headphones", false).toBool()) {
-+      setRPSystemAudioHeadphones();
-+    }
-+    if(settings.value("prefs/rp/force-audio-hdmi", false).toBool()) {
-+      setRPSystemAudioHDMI();
-+    }
-+  }
-+#endif
- 
-   check_updates->setChecked(settings.value("prefs/rp/check-updates", true).toBool());
- 
-@@ -1074,26 +1096,10 @@
- 
-   gui_transparency_slider->setValue(settings.value("prefs/gui_transparency", 0).toInt());
- 
--  int stored_vol = settings.value("prefs/rp/system-vol", 50).toInt();
--  rp_system_vol->setValue(stored_vol);
--
-   // Ensure prefs are honoured on boot
-   update_mixer_invert_stereo();
-   update_mixer_force_mono();
--  changeRPSystemVol(stored_vol);
-   update_check_updates();
--
--  if(settings.value("prefs/rp/force-audio-default", true).toBool()) {
--    setRPSystemAudioAuto();
--  }
--  if(settings.value("prefs/rp/force-audio-headphones", false).toBool()) {
--    setRPSystemAudioHeadphones();
--  }
--  if(settings.value("prefs/rp/force-audio-hdmi", false).toBool()) {
--    setRPSystemAudioHDMI();
--  }
--
--
- }
- 
- void MainWindow::invokeStartupError(QString msg) {
-@@ -1529,31 +1535,6 @@
- }
- 
- 
--#if defined(Q_OS_LINUX)
--void MainWindow::changeRPSystemVol(int val)
--#else
--void MainWindow::changeRPSystemVol(int)
--#endif
--{
--#if defined(Q_OS_WIN)
--  // do nothing
--#elif defined(Q_OS_MAC)
--  // do nothing
--#else
--  //assuming Raspberry Pi
--  QProcess *p = new QProcess();
--  float v = (float) val;
--  // handle the fact that the amixer percentage range isn't linear
--  float vol_float = std::pow(v/100.0, (float)1./3.) * 100.0;
--  std::ostringstream ss;
--  ss << vol_float;
--  statusBar()->showMessage(tr("Updating System Volume..."), 2000);
--  QString prog = "amixer cset numid=1 " + QString::fromStdString(ss.str()) + '%';
--  p->start(prog);
--#endif
--
--}
--
- void MainWindow::toggleDarkMode() {
-   dark_mode->toggle();
-   updateDarkMode();
-@@ -1761,51 +1742,54 @@
-   }
- }
- 
-+#if defined(Q_OS_LINUX)
-+bool MainWindow::isRaspberryPiSoundcard() {
-+  // look for the Raspberry Pi soundcard name in the kernel's audio info
-+  QString cardInfo = readFile("/proc/asound/card0/pcm0p/info");
-+  return cardInfo.contains("bcm2835");
-+}
-+
-+void MainWindow::changeRPSystemVol(int val)
-+{
-+  //assuming Raspberry Pi
-+  QProcess *p = new QProcess();
-+  float v = (float) val;
-+  // handle the fact that the amixer percentage range isn't linear
-+  float vol_float = std::pow(v/100.0, (float)1./3.) * 100.0;
-+  std::ostringstream ss;
-+  ss << vol_float;
-+  statusBar()->showMessage(tr("Updating System Volume..."), 2000);
-+  QString prog = "amixer cset numid=1 " + QString::fromStdString(ss.str()) + '%';
-+  p->start(prog);
-+}
-+
- void MainWindow::setRPSystemAudioHeadphones()
- {
--#if defined(Q_OS_WIN)
--  //do nothing
--#elif defined(Q_OS_MAC)
--  //do nothing
--#else
-   //assuming Raspberry Pi
-   statusBar()->showMessage(tr("Switching To Headphone Audio Output..."), 2000);
-   QProcess *p = new QProcess();
-   QString prog = "amixer cset numid=3 1";
-   p->start(prog);
--#endif
- }
- 
- void MainWindow::setRPSystemAudioHDMI()
- {
--
--#if defined(Q_OS_WIN)
--  //do nothing
--#elif defined(Q_OS_MAC)
--  //do nothing
--#else
-   //assuming Raspberry Pi
-   statusBar()->showMessage(tr("Switching To HDMI Audio Output..."), 2000);
-   QProcess *p = new QProcess();
-   QString prog = "amixer cset numid=3 2";
-   p->start(prog);
--#endif
- }
- 
- void MainWindow::setRPSystemAudioAuto()
- {
--#if defined(Q_OS_WIN)
--  //do nothing
--#elif defined(Q_OS_MAC)
--  //do nothing
--#else
-   //assuming Raspberry Pi
-   statusBar()->showMessage(tr("Switching To Default Audio Output..."), 2000);
-   QProcess *p = new QProcess();
-   QString prog = "amixer cset numid=3 0";
-   p->start(prog);
--#endif
- }
-+#endif
- 
- void MainWindow::showPrefsPane()
- {
-@@ -2177,11 +2161,15 @@
-   settings.setValue("prefs/dark-mode", dark_mode->isChecked());
-   settings.setValue("prefs/mixer-force-mono", mixer_force_mono->isChecked());
-   settings.setValue("prefs/mixer-invert-stereo", mixer_invert_stereo->isChecked());
--
--  settings.setValue("prefs/rp/force-audio-default", rp_force_audio_default->isChecked());
--  settings.setValue("prefs/rp/force-audio-headphones", rp_force_audio_headphones->isChecked());
--  settings.setValue("prefs/rp/force-audio-hdmi", rp_force_audio_hdmi->isChecked());
--  settings.setValue("prefs/rp/system-vol", rp_system_vol->value());
-+  
-+#if defined(Q_OS_LINUX)
-+  if (raspberryPiSoundcard) {
-+    settings.setValue("prefs/rp/force-audio-default", rp_force_audio_default->isChecked());
-+    settings.setValue("prefs/rp/force-audio-headphones", rp_force_audio_headphones->isChecked());
-+    settings.setValue("prefs/rp/force-audio-hdmi", rp_force_audio_hdmi->isChecked());
-+    settings.setValue("prefs/rp/system-vol", rp_system_vol->value());
-+  }
-+#endif
- 
-   settings.setValue("prefs/rp/check-updates", check_updates->isChecked());
-   settings.setValue("prefs/auto-indent-on-run", auto_indent_on_run->isChecked());
-Index: pkg-sonic-pi/app/gui/qt/mainwindow.h
-===================================================================
---- pkg-sonic-pi.orig/app/gui/qt/mainwindow.h	2016-01-11 15:00:35.171184925 +0100
-+++ pkg-sonic-pi/app/gui/qt/mainwindow.h	2016-01-11 15:00:35.171184925 +0100
-@@ -123,11 +123,7 @@
-     void onExitCleanup();
-     void toggleRecording();
-     void toggleRecordingOnIcon();
--    void changeRPSystemVol(int val);
-     void changeGUITransparency(int val);
--    void setRPSystemAudioAuto();
--    void setRPSystemAudioHeadphones();
--    void setRPSystemAudioHDMI();
-     void changeShowLineNumbers();
-     void toggleDarkMode();
-     void updateDarkMode();
-@@ -225,6 +221,17 @@
- #endif
- 
-     bool i18n;
-+
-+#if defined(Q_OS_LINUX)
-+    bool raspberryPiSoundcard;
-+    QSlider *rp_system_vol;
-+    bool isRaspberryPiSoundcard();
-+    void changeRPSystemVol(int val);
-+    void setRPSystemAudioAuto();
-+    void setRPSystemAudioHeadphones();
-+    void setRPSystemAudioHDMI();
-+#endif
-+
-     static const int workspace_max = 10;
-     SonicPiScintilla *workspaces[workspace_max];
-     QWidget *prefsCentral;
-@@ -274,7 +281,6 @@
-     QRadioButton *rp_force_audio_hdmi;
-     QRadioButton *rp_force_audio_default;
-     QRadioButton *rp_force_audio_headphones;
--    QSlider *rp_system_vol;
-     QSlider *gui_transparency_slider;
- 
-     QWidget *infoWidg;
diff --git a/debian/patches/04-do-no-require-unused-ruby-gems.patch b/debian/patches/04-do-no-require-unused-ruby-gems.patch
deleted file mode 100644
index 513a21c..0000000
--- a/debian/patches/04-do-no-require-unused-ruby-gems.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Description: remove rubame gem dependency
- This section in app/server/core.rb depends on the rubame gem, but the
- code is only used later in app/server/bin/ws.rb - which is an
- unmaintained part of the Sonic Pi code. The currently unmaintained
- HTML GUI of Sonic Pi uses ws.rb as its websocket server. It is not
- packaged in this .deb and through this patch, we can remove the rubame
- gem dependency entirely. 
-Forwarded: no
-Author: Hanno Zulla <kontakt at hanno.de>
-Last-Update: 2016-01-22
-
-Index: pkg-sonic-pi.work/app/server/core.rb
-===================================================================
---- pkg-sonic-pi.work.orig/app/server/core.rb	2016-01-22 15:49:32.789327374 +0100
-+++ pkg-sonic-pi.work/app/server/core.rb	2016-01-22 15:49:59.161112167 +0100
-@@ -378,45 +378,6 @@
-   end
- end
- 
--
--require 'rubame'
--
--## Teach Rubame::Server#run to block on IO.select
--## and therefore not thrash round in a loop
--module Rubame
--
--  class Server
--    def run(time = 0, &blk)
--      readable, writable = IO.select(@reading, @writing)
--
--      if readable
--        readable.each do |socket|
--          client = @clients[socket]
--          if socket == @socket
--            client = accept
--          else
--            msg = read(client)
--            client.messaged = msg
--          end
--
--          blk.call(client) if client and blk
--        end
--      end
--
--      # Check for lazy send items
--      timer_start = Time.now
--      time_passed = 0
--      begin
--        @clients.each do |s, c|
--          c.send_some_lazy(5)
--        end
--        time_passed = Time.now - timer_start
--      end while time_passed < time
--    end
--  end
--end
--
--
- # Backport Ruby 2+ thread local variable syntax
- if RUBY_VERSION < "2"
-   class Thread
diff --git a/debian/patches/05-use-debian-gems.patch b/debian/patches/05-use-debian-gems.patch
deleted file mode 100644
index 768467e..0000000
--- a/debian/patches/05-use-debian-gems.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Description: use Debian gems instead of upstream's embedded code copies
- Upstream ships Sonic Pi for Win, OS X and Raspbian and distributes all
- gems needed by the ruby server within the app/server/vendor/ directory
- in the source tarball. Debian wants packagers not to use these embedded
- code copies, but to use Debian's packaged ruby gems instead. This
- patch removes the code that added the vendor/ directory to the ruby
- library path. Do note that many of the gems provided by upstream
- aren't actually used in Sonic Pi, see
- <URL: https://github.com/samaaron/sonic-pi/issues/928> for details.
-Forwarded: no
-Author: Hanno Zulla <kontakt at hanno.de>
-Last-Update: 2016-01-22
-
-Index: sonic-pi/app/server/core.rb
-===================================================================
---- sonic-pi.orig/app/server/core.rb	2016-02-26 15:53:36.410295019 +0100
-+++ sonic-pi/app/server/core.rb	2016-02-26 15:54:38.632757162 +0100
-@@ -14,34 +14,8 @@
- 
- raise "Sonic Pi requires Ruby 1.9.3+ to be installed. You are using version #{RUBY_VERSION}" if RUBY_VERSION < "1.9.3"
- 
--## This core file sets up the load path and applies any necessary monkeypatches.
--
--## Ensure native lib dir is available
--require 'rbconfig'
--ruby_api = RbConfig::CONFIG['ruby_version']
--os = case RUBY_PLATFORM
--     when /.*arm.*-linux.*/
--       :raspberry
--     when /.*linux.*/
--       :linux
--     when /.*darwin.*/
--       :osx
--     when /.*mingw.*/
--       :windows
--     else
--       RUBY_PLATFORM
--     end
--$:.unshift "#{File.expand_path("../rb-native", __FILE__)}/#{os}/#{ruby_api}/"
--
--require 'win32/process' if os == :windows
--
--## Ensure all libs in vendor directory are available
--Dir["#{File.expand_path("../vendor", __FILE__)}/*/lib/"].each do |vendor_lib|
--  $:.unshift vendor_lib
--end
--
- begin
--  require 'did_you_mean'
-+  require 'did_you_mean' if RUBY_VERSION >= "2.3.0"
- rescue LoadError
-   warn "Non-critical error: Could not load did_you_mean"
- end
diff --git a/debian/patches/06-rename-ruby-beautify-legacy.patch b/debian/patches/06-rename-ruby-beautify-legacy.patch
deleted file mode 100644
index 2b233f2..0000000
--- a/debian/patches/06-rename-ruby-beautify-legacy.patch
+++ /dev/null
@@ -1,176 +0,0 @@
-Description: Use legacy version 0.92.2 of ruby-beautify gem
- Sonic Pi wants the version 0.92.2 of the ruby-beautify gem. However,
- that gem has seen a total rewrite since that version. The current
- version 0.97.4 is now a different software with a different API and
- different behaviour under the same package name. The Debian version of
- the gem is that new and updated gem. To address this and to avoid name
- space issues, this patch renames the old version to "legacy" and
- installs it in /usr/lib/sonic-pi/server/vendor/
- <URL: https://github.com/samaaron/sonic-pi/pull/943>
- <URL: https://github.com/samaaron/sonic-pi/issues/928>
-Forwarded: no
-Author: Hanno Zulla <kontakt at hanno.de>
-Last-Update: 2016-02-04
-
-Index: pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/vendor/ruby-beautify/lib/ruby-beautify.rb	2016-02-03 14:17:26.287100863 +0100
-+++ pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify.rb	2016-02-03 17:32:11.051445795 +0100
-@@ -1,26 +1,26 @@
--require "ruby-beautify/version"
--require 'ruby-beautify/block_start'
--require 'ruby-beautify/block_end'
--require 'ruby-beautify/block_matcher'
--require 'ruby-beautify/language'
--require 'ruby-beautify/line'
--require 'ruby-beautify/config/ruby'
-+require_relative "ruby-beautify-legacy/version"
-+require_relative 'ruby-beautify-legacy/block_start'
-+require_relative 'ruby-beautify-legacy/block_end'
-+require_relative 'ruby-beautify-legacy/block_matcher'
-+require_relative 'ruby-beautify-legacy/language'
-+require_relative 'ruby-beautify-legacy/line'
-+require_relative 'ruby-beautify-legacy/config/ruby'
- 
--module RBeautify
-+module RBeautifyLegacy
-   def self.beautify_string(language, source, use_tabs=false)
-     dest = ""
-     block = nil
- 
--    unless language.is_a? RBeautify::Language
--      language = RBeautify::Language.language(language)
-+    unless language.is_a? RBeautifyLegacy::Language
-+      language = RBeautifyLegacy::Language.language(language)
-     end
- 
-     source.lines.each_with_index do |line_content, line_number|
--      line = RBeautify::Line.new(language, line_content, line_number, block, use_tabs)
-+      line = RBeautifyLegacy::Line.new(language, line_content, line_number, block, use_tabs)
-       dest += line.format
-       block = line.block
-     end
- 
-     return dest
-   end
--end # module RBeautify
-+end # module RBeautifyLegacy
-Index: pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/block_end.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/vendor/ruby-beautify/lib/ruby-beautify/block_end.rb	2016-02-03 14:17:26.287100863 +0100
-+++ pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/block_end.rb	2016-02-03 14:27:55.205161507 +0100
-@@ -1,4 +1,4 @@
--module RBeautify
-+module RBeautifyLegacy
- 
-   class BlockEnd
- 
-Index: pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/block_matcher.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/vendor/ruby-beautify/lib/ruby-beautify/block_matcher.rb	2016-02-03 14:17:26.287100863 +0100
-+++ pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/block_matcher.rb	2016-02-03 14:28:05.525075950 +0100
-@@ -1,4 +1,4 @@
--module RBeautify
-+module RBeautifyLegacy
- 
-   class BlockMatcher
- 
-@@ -77,7 +77,7 @@
- 
-     def parse_block_start(string, parent_block, offset, line_number)
-       if !string.empty? && (match = starts.match(string))
--        RBeautify::BlockStart.new(self, parent_block, line_number, offset + match.begin(0), match[0], match.post_match)
-+        RBeautifyLegacy::BlockStart.new(self, parent_block, line_number, offset + match.begin(0), match[0], match.post_match)
-       end
-     end
- 
-Index: pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/block_start.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/vendor/ruby-beautify/lib/ruby-beautify/block_start.rb	2016-02-03 14:17:26.287100863 +0100
-+++ pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/block_start.rb	2016-02-03 14:28:13.333011608 +0100
-@@ -1,4 +1,4 @@
--module RBeautify
-+module RBeautifyLegacy
- 
-   class BlockStart
- 
-@@ -105,11 +105,11 @@
-                 # the match then this match should be skipped
-                 return parse_explicit_block_end(match.post_match, offset + escape_chars[0].size + match[0].length)
-               else
--                return RBeautify::BlockEnd.new(self, offset + match.begin(0), match[0], match.post_match)
-+                return RBeautifyLegacy::BlockEnd.new(self, offset + match.begin(0), match[0], match.post_match)
-               end
-             end
-           elsif negate_ends_match?
--            return RBeautify::BlockEnd.new(self, offset, '', string)
-+            return RBeautifyLegacy::BlockEnd.new(self, offset, '', string)
-           end
- 
-         end
-Index: pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/config/ruby.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/vendor/ruby-beautify/lib/ruby-beautify/config/ruby.rb	2016-02-03 14:17:26.287100863 +0100
-+++ pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/config/ruby.rb	2016-02-03 14:29:11.724540127 +0100
-@@ -1,8 +1,8 @@
- # define ruby language
- 
--unless RBeautify::Language.language(:ruby)
-+unless RBeautifyLegacy::Language.language(:ruby)
- 
--  ruby = RBeautify::Language.add_language(:ruby)
-+  ruby = RBeautifyLegacy::Language.add_language(:ruby)
- 
-   pre_keyword_boundary = '(^|[^a-z0-9A-Z:._])' # like \b but with : , . _ all added to list of exceptions
-   start_statement_boundary = '(^|(;|=)\s*)'
-Index: pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/language.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/vendor/ruby-beautify/lib/ruby-beautify/language.rb	2016-02-03 14:17:26.287100863 +0100
-+++ pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/language.rb	2016-02-03 14:28:19.648959801 +0100
-@@ -1,4 +1,4 @@
--module RBeautify
-+module RBeautifyLegacy
-   class Language
- 
-     @@languages = {}
-Index: pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/line.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/vendor/ruby-beautify/lib/ruby-beautify/line.rb	2016-02-03 14:17:26.287100863 +0100
-+++ pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/line.rb	2016-02-03 14:28:25.796909571 +0100
-@@ -1,4 +1,4 @@
--module RBeautify
-+module RBeautifyLegacy
-   class Line
- 
-     attr_reader :language, :content, :line_number, :original_block, :block, :indent_character
-Index: pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/version.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/vendor/ruby-beautify/lib/ruby-beautify/version.rb	2016-02-03 14:17:26.287100863 +0100
-+++ pkg-sonic-pi/app/server/vendor/ruby-beautify/lib/ruby-beautify/version.rb	2016-02-03 14:28:34.972834958 +0100
-@@ -1,3 +1,3 @@
--module RBeautify
-+module RBeautifyLegacy
-   VERSION = "0.92.2"
- end
-Index: pkg-sonic-pi/app/server/sonicpi/lib/sonicpi/runtime.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/sonicpi/lib/sonicpi/runtime.rb	2016-02-03 14:19:15.000000000 +0100
-+++ pkg-sonic-pi/app/server/sonicpi/lib/sonicpi/runtime.rb	2016-02-03 17:30:15.280535790 +0100
-@@ -36,7 +36,7 @@
- require 'thread'
- require 'fileutils'
- require 'set'
--require 'ruby-beautify'
-+require_relative '../../../vendor/ruby-beautify/lib/ruby-beautify-legacy'
- require 'securerandom'
- require 'active_support/core_ext/integer/inflections'
- 
-@@ -858,7 +858,7 @@
-     end
-     def beautify_ruby_source(source)
-       source = source << "\n" unless source.end_with? "\n"
--      RBeautify.beautify_string :ruby, source
-+      RBeautifyLegacy.beautify_string :ruby, source
-     end
- 
- 
diff --git a/debian/patches/07-doc-base-index.patch b/debian/patches/07-doc-base-index.patch
deleted file mode 100644
index 15b4572..0000000
--- a/debian/patches/07-doc-base-index.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Description: create index file per Debian doc-base requirements
- Debian wants packagers to use doc-base and doc-base requires an index
- file for HTML documents.
-Forwarded: no
-Author: Hanno Zulla <kontakt at hanno.de>
-Last-Update: 2016-02-11
-
-Index: pkg-sonic-pi/app/server/bin/qt-doc.rb
-===================================================================
---- pkg-sonic-pi.orig/app/server/bin/qt-doc.rb	2016-02-11 12:07:05.882894560 +0100
-+++ pkg-sonic-pi/app/server/bin/qt-doc.rb	2016-02-11 12:14:49.622559528 +0100
-@@ -39,6 +39,7 @@
- 
- docs = []
- filenames = []
-+booknames = []
- count = 0
- 
- options = {}
-@@ -138,7 +139,9 @@
-   book_body = book[/<body.*?>/]
-   book.gsub!(/<\/?body.*?>/, '')
-   book.gsub!(/<meta http-equiv.*?>/, '')
--  File.open("#{qt_gui_path}/book/Sonic Pi - #{name.capitalize}" + (lang != "en" ? " (#{lang})" : "") + ".html", 'w') do |f|
-+  bookname = "Sonic Pi - #{name.capitalize}" + (lang != "en" ? " (#{lang})" : "")
-+  booknames << bookname
-+  File.open("#{qt_gui_path}/book/#{bookname}.html", 'w') do |f|
-     f << "<link rel=\"stylesheet\" href=\"../theme/light/doc-styles.css\" type=\"text/css\"/>\n"
-     f << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\n"
-     f << book_body << "\n"
-@@ -286,6 +289,13 @@
-   f << "  </qresource>\n</RCC>\n"
- end
- 
-+File.open("#{qt_gui_path}/book/index.html", 'w') do |f|
-+  f << "<link rel=\"stylesheet\" href=\"../theme/light/doc-styles.css\" type=\"text/css\"/>\n"
-+  f << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\n"
-+  f << "<body><ul>\n"
-+  f << booknames.sort.map{|n| "<li><a href=\"#{n}.html\">#{n}</a></li>\n"}.join
-+  f << "</ul></body>\n"
-+end  
- 
- ###
- # Generate info pages
diff --git a/debian/patches/series b/debian/patches/series
index 4720a89..1bfe860 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,5 @@
-01-qt5scintilla.patch
-02-paths.patch
-03-remove-rpi-volume.patch
-04-do-no-require-unused-ruby-gems.patch
-05-use-debian-gems.patch
-06-rename-ruby-beautify-legacy.patch
-07-doc-base-index.patch
+01-remove-rpi-volume.patch
+02-do-no-require-unused-ruby-gems.patch
+03-use-debian-gems.patch
+04-rename-ruby-beautify-legacy.patch
+05-doc-base-index.patch

-- 
sonic-pi packaging



More information about the pkg-multimedia-commits mailing list