From 405a7b0edb0d3b5d868e073f8740cf6081aed252 Mon Sep 17 00:00:00 2001 From: Yann Collette Date: Tue, 20 Jun 2017 21:48:20 +0200 Subject: [PATCH 1/5] patches to support fedora 25 --- src/claudia_database.py | 2 ++ src/claudia_launcher.py | 25 ++++++++++++++++++++----- src/shared_cadence.py | 21 +++++++++++++-------- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/claudia_database.py b/src/claudia_database.py index 7424fbf..69e975c 100644 --- a/src/claudia_database.py +++ b/src/claudia_database.py @@ -24,6 +24,8 @@ USING_KXSTUDIO = False list_DAW = [ # Package AppName Type Binary Icon Template? Level (L, D, L, V, VST-Mode, T, M, MIDI-Mode) (doc-file, website) + [ "ardour5", "Ardour 5", "DAW", "ardour5", "ardour", TEMPLATE_NO, LEVEL_JS, (1, 0, 1, 1, "Native", 1, 1, "JACK"), ("", "http://www.ardour.org/") ], + [ "ardour4", "Ardour 4", "DAW", "ardour4", "ardour", TEMPLATE_NO, LEVEL_JS, (1, 0, 1, 1, "Native", 1, 1, "JACK"), ("", "http://www.ardour.org/") ], [ "ariamaestosa", "Aria Maestosa", "MIDI Sequencer", "Aria", "aria", TEMPLATE_NO, LEVEL_0, (0, 0, 0, 0, "", 0, 1, "ALSA | JACK"), ("", "http://ariamaestosa.sf.net/") ], diff --git a/src/claudia_launcher.py b/src/claudia_launcher.py index dc06058..8e3aad7 100755 --- a/src/claudia_launcher.py +++ b/src/claudia_launcher.py @@ -20,6 +20,7 @@ # Imports (Global) from random import randint +import os if True: from PyQt5.QtCore import pyqtSlot, Qt, QTimer, QSettings @@ -119,7 +120,10 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): self._parent = None self._settings = None self.m_ladish_only = False - + if os.path.isdir("/usr/lib64"): + self.lib_path = "lib64" + else: + self.lib_path = "lib" self.listDAW.setColumnWidth(0, 22) self.listDAW.setColumnWidth(1, 225) self.listDAW.setColumnWidth(2, 150) @@ -696,6 +700,18 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): for package in pkg_out: pkglist.append(package) + elif os.path.exists("/usr/bin/dnf"): + pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/dnf list installed 2>/dev/null").split("\n") + for pkg_info in pkg_out[2:]: + package = pkg_info.split(" ")[0].split(".")[0] + pkglist.append(package.strip()) + + elif os.path.exists("/usr/bin/yum"): + pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/yum list installed 2>/dev/null").split("\n") + for package in pkg_out[2:]: + package = pkg_info.split(" ")[0].split(".")[0] + pkglist.append(package.strip()) + elif os.path.exists("/usr/bin/dpkg"): pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/dpkg --get-selections 2>/dev/null").split("\n") for pkg_info in pkg_out: @@ -823,11 +839,10 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): last_pos += 1 - if haveCarla and os.path.exists("/usr/lib/carla/libcarla_utils.so"): - utils = CarlaUtils("/usr/lib/carla/libcarla_utils.so") + if haveCarla and os.path.exists("/usr/" + self.lib_path + "/carla/libcarla_utils.so"): + utils = CarlaUtils("/usr/" + self.lib_path + "/carla/libcarla_utils.so") last_pos = 0 - lv2path = os.getenv("LV2_PATH", "~/.lv2:/usr/lib/lv2:/usr/local/lib/lv2") - for i in range(utils.get_cached_plugin_count(PLUGIN_LV2, lv2path)): + for i in range(utils.get_cached_plugin_count(PLUGIN_LV2, os.getenv("LV2_PATH", "~/.lv2:/usr/" + self.lib_path + "/lv2:/usr/local/" + self.lib_path + "/lv2"))): plugin = utils.get_cached_plugin_info(PLUGIN_LV2, i) if (plugin["hints"] & PLUGIN_HAS_CUSTOM_UI) == 0: diff --git a/src/shared_cadence.py b/src/shared_cadence.py index 2a819f3..e665793 100644 --- a/src/shared_cadence.py +++ b/src/shared_cadence.py @@ -20,6 +20,7 @@ # Imports (Global) from time import sleep +import os if True: from PyQt5.QtCore import QProcess, QSettings @@ -33,29 +34,33 @@ from shared import * # ------------------------------------------------------------------------------------------------------------ # Default Plugin PATHs +if os.path.isdir("/usr/lib64"): + LIB_PATH = "lib64" +else: + LIB_PATH = "lib" DEFAULT_LADSPA_PATH = [ os.path.join(HOME, ".ladspa"), - os.path.join("/", "usr", "lib", "ladspa"), - os.path.join("/", "usr", "local", "lib", "ladspa") + os.path.join("/", "usr", LIB_PATH, "ladspa"), + os.path.join("/", "usr", "local", LIB_PATH, "ladspa") ] DEFAULT_DSSI_PATH = [ os.path.join(HOME, ".dssi"), - os.path.join("/", "usr", "lib", "dssi"), - os.path.join("/", "usr", "local", "lib", "dssi") + os.path.join("/", "usr", LIB_PATH, "dssi"), + os.path.join("/", "usr", "local", LIB_PATH, "dssi") ] DEFAULT_LV2_PATH = [ os.path.join(HOME, ".lv2"), - os.path.join("/", "usr", "lib", "lv2"), - os.path.join("/", "usr", "local", "lib", "lv2") + os.path.join("/", "usr", LIB_PATH, "lv2"), + os.path.join("/", "usr", "local", LIB_PATH, "lv2") ] DEFAULT_VST_PATH = [ os.path.join(HOME, ".vst"), - os.path.join("/", "usr", "lib", "vst"), - os.path.join("/", "usr", "local", "lib", "vst") + os.path.join("/", "usr", LIB_PATH, "vst"), + os.path.join("/", "usr", "local", LIB_PATH, "vst") ] # ------------------------------------------------------------------------------------------------------------ From 92d3785e02c0118b06811cf875cead4c8cf8af63 Mon Sep 17 00:00:00 2001 From: Yann Collette Date: Thu, 22 Jun 2017 21:08:18 +0200 Subject: [PATCH 2/5] replace dnf enumeration by pull request #122 --- src/claudia_launcher.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/claudia_launcher.py b/src/claudia_launcher.py index 8e3aad7..27a5789 100755 --- a/src/claudia_launcher.py +++ b/src/claudia_launcher.py @@ -700,18 +700,6 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): for package in pkg_out: pkglist.append(package) - elif os.path.exists("/usr/bin/dnf"): - pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/dnf list installed 2>/dev/null").split("\n") - for pkg_info in pkg_out[2:]: - package = pkg_info.split(" ")[0].split(".")[0] - pkglist.append(package.strip()) - - elif os.path.exists("/usr/bin/yum"): - pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/yum list installed 2>/dev/null").split("\n") - for package in pkg_out[2:]: - package = pkg_info.split(" ")[0].split(".")[0] - pkglist.append(package.strip()) - elif os.path.exists("/usr/bin/dpkg"): pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/dpkg --get-selections 2>/dev/null").split("\n") for pkg_info in pkg_out: @@ -719,6 +707,11 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): if installed == "install": pkglist.append(package.strip()) + elif os.path.exists("/bin/rpm"): + pkg_out = getoutput("env LANG=C /bin/rpm -qa --qf \"%{NAME}\n\" 2>/dev/null").split("\n") + for package in pkg_out: + pkglist.append(package) + if not "bristol" in pkglist: self.tabWidget.setTabEnabled(iTabBristol, False) From c070acf3bec715282348595478712857558614cf Mon Sep 17 00:00:00 2001 From: Richard Henwood Date: Wed, 13 Feb 2019 19:54:20 -0600 Subject: [PATCH 3/5] Make more readable strings by using format method. --- src/claudia_launcher.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/claudia_launcher.py b/src/claudia_launcher.py index 27a5789..fd6d1ab 100755 --- a/src/claudia_launcher.py +++ b/src/claudia_launcher.py @@ -832,10 +832,14 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): last_pos += 1 - if haveCarla and os.path.exists("/usr/" + self.lib_path + "/carla/libcarla_utils.so"): - utils = CarlaUtils("/usr/" + self.lib_path + "/carla/libcarla_utils.so") + if haveCarla and os.path.exists("/usr/{}/carla/libcarla_utils.so".format(self.lib_path)): + utils = CarlaUtils("/usr/{}/carla/libcarla_utils.so".format(self.lib_path)) last_pos = 0 - for i in range(utils.get_cached_plugin_count(PLUGIN_LV2, os.getenv("LV2_PATH", "~/.lv2:/usr/" + self.lib_path + "/lv2:/usr/local/" + self.lib_path + "/lv2"))): + for i in range(utils.get_cached_plugin_count(PLUGIN_LV2, + os.getenv("LV2_PATH", + "~/.lv2:"\ + "/usr/{lib_path}/lv2:"\ + "/usr/local/{lib_path}/lv2".format(lib_path=self.lib_path)))): plugin = utils.get_cached_plugin_info(PLUGIN_LV2, i) if (plugin["hints"] & PLUGIN_HAS_CUSTOM_UI) == 0: From 83eaf8e3720d77f349d13009f3e52ffe9f260dbd Mon Sep 17 00:00:00 2001 From: Richard Henwood Date: Wed, 20 Feb 2019 20:50:40 -0600 Subject: [PATCH 4/5] put lib dir discovery in central location. --- src/claudia_launcher.py | 7 ++----- src/shared.py | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/claudia_launcher.py b/src/claudia_launcher.py index fd6d1ab..67de9b4 100755 --- a/src/claudia_launcher.py +++ b/src/claudia_launcher.py @@ -120,11 +120,8 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): self._parent = None self._settings = None self.m_ladish_only = False - if os.path.isdir("/usr/lib64"): - self.lib_path = "lib64" - else: - self.lib_path = "lib" - self.listDAW.setColumnWidth(0, 22) + self.lib_path = LIB_PATH + fself.listDAW.setColumnWidth(0, 22) self.listDAW.setColumnWidth(1, 225) self.listDAW.setColumnWidth(2, 150) self.listHost.setColumnWidth(0, 22) diff --git a/src/shared.py b/src/shared.py index d1276cd..72dc223 100644 --- a/src/shared.py +++ b/src/shared.py @@ -143,6 +143,13 @@ if PATH is None: else: PATH = PATH.split(os.pathsep) +# ------------------------------------------------------------------------------------------------------------ +# Set PATH + +LIB_PATH = "lib" +if os.path.isdir("/usr/lib64"): + LIB_PATH = "lib64" + # ------------------------------------------------------------------------------------------------------------ # Remove/convert non-ascii chars from a string From 3672aa48a01317d0ffdbc8c6f346f05e3bde0b97 Mon Sep 17 00:00:00 2001 From: richardhenwood Date: Wed, 6 Mar 2019 20:20:08 -0600 Subject: [PATCH 5/5] Update claudia_launcher.py --- src/claudia_launcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/claudia_launcher.py b/src/claudia_launcher.py index 67de9b4..a146cdd 100755 --- a/src/claudia_launcher.py +++ b/src/claudia_launcher.py @@ -121,7 +121,7 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): self._settings = None self.m_ladish_only = False self.lib_path = LIB_PATH - fself.listDAW.setColumnWidth(0, 22) + self.listDAW.setColumnWidth(0, 22) self.listDAW.setColumnWidth(1, 225) self.listDAW.setColumnWidth(2, 150) self.listHost.setColumnWidth(0, 22)