4b7e3ae
From 8ec9214da5ff699a243917054fbf530fdb685546 Mon Sep 17 00:00:00 2001
4b7e3ae
From: Yann Collette <ycollette.nospam@free.fr>
4b7e3ae
Date: Sat, 12 May 2018 14:05:15 +0200
4b7e3ae
Subject: [PATCH] fedora support
4b7e3ae
4b7e3ae
---
4b7e3ae
 src/claudia_database.py |  2 ++
4b7e3ae
 src/claudia_launcher.py | 21 +++++++++++++++++++--
4b7e3ae
 src/shared_cadence.py   | 21 +++++++++++++--------
4b7e3ae
 3 files changed, 34 insertions(+), 10 deletions(-)
4b7e3ae
4b7e3ae
diff --git a/src/claudia_database.py b/src/claudia_database.py
4b7e3ae
index 7424fbf..69e975c 100644
4b7e3ae
--- a/src/claudia_database.py
4b7e3ae
+++ b/src/claudia_database.py
4b7e3ae
@@ -24,6 +24,8 @@ USING_KXSTUDIO = False
4b7e3ae
 
4b7e3ae
 list_DAW = [
4b7e3ae
   # Package          AppName            Type              Binary              Icon                Template?     Level      (L, D, L, V, VST-Mode,  T, M, MIDI-Mode)      (doc-file,                                                         website)
4b7e3ae
+  [ "ardour5",       "Ardour 5",        "DAW",            "ardour5",          "ardour",           TEMPLATE_NO,  LEVEL_JS,  (1, 0, 1, 1, "Native",  1, 1, "JACK"),        ("",                                                               "http://www.ardour.org/") ],
4b7e3ae
+
4b7e3ae
   [ "ardour4",       "Ardour 4",        "DAW",            "ardour4",          "ardour",           TEMPLATE_NO,  LEVEL_JS,  (1, 0, 1, 1, "Native",  1, 1, "JACK"),        ("",                                                               "http://www.ardour.org/") ],
4b7e3ae
 
4b7e3ae
   [ "ariamaestosa",  "Aria Maestosa",   "MIDI Sequencer", "Aria",             "aria",             TEMPLATE_NO,  LEVEL_0,   (0, 0, 0, 0, "",        0, 1, "ALSA | JACK"), ("",                                                               "http://ariamaestosa.sf.net/") ],
4b7e3ae
diff --git a/src/claudia_launcher.py b/src/claudia_launcher.py
4b7e3ae
index dc06058..3bb6150 100755
4b7e3ae
--- a/src/claudia_launcher.py
4b7e3ae
+++ b/src/claudia_launcher.py
4b7e3ae
@@ -20,6 +20,7 @@
4b7e3ae
 # Imports (Global)
4b7e3ae
 
4b7e3ae
 from random import randint
4b7e3ae
+import os
4b7e3ae
 
4b7e3ae
 if True:
4b7e3ae
     from PyQt5.QtCore import pyqtSlot, Qt, QTimer, QSettings
4b7e3ae
@@ -119,6 +120,10 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW):
4b7e3ae
         self._parent   = None
4b7e3ae
         self._settings = None
4b7e3ae
         self.m_ladish_only = False
4b7e3ae
+        if os.path.isdir("/usr/lib64"):
4b7e3ae
+            self.lib_path = "lib64"
4b7e3ae
+        else:
4b7e3ae
+            self.lib_path = "lib"
4b7e3ae
 
4b7e3ae
         self.listDAW.setColumnWidth(0, 22)
4b7e3ae
         self.listDAW.setColumnWidth(1, 225)
4b7e3ae
@@ -696,6 +701,18 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW):
4b7e3ae
                 for package in pkg_out:
4b7e3ae
                     pkglist.append(package)
4b7e3ae
 
4b7e3ae
+            elif os.path.exists("/usr/bin/dnf"):
4b7e3ae
+                pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/dnf list installed 2>/dev/null").split("\n")
4b7e3ae
+                for pkg_info in pkg_out[2:]:
4b7e3ae
+                    package = pkg_info.split(" ")[0].split(".")[0]
4b7e3ae
+                    pkglist.append(package.strip())
4b7e3ae
+
4b7e3ae
+            elif os.path.exists("/usr/bin/yum"):
4b7e3ae
+                pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/yum list installed 2>/dev/null").split("\n")
4b7e3ae
+                for package in pkg_out[2:]:
4b7e3ae
+                    package = pkg_info.split(" ")[0].split(".")[0]
4b7e3ae
+                    pkglist.append(package.strip())
4b7e3ae
+ 
4b7e3ae
             elif os.path.exists("/usr/bin/dpkg"):
4b7e3ae
                 pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/dpkg --get-selections 2>/dev/null").split("\n")
4b7e3ae
                 for pkg_info in pkg_out:
4b7e3ae
@@ -823,10 +840,10 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW):
4b7e3ae
 
4b7e3ae
                 last_pos += 1
4b7e3ae
 
4b7e3ae
-        if haveCarla and os.path.exists("/usr/lib/carla/libcarla_utils.so"):
4b7e3ae
+        if haveCarla and os.path.exists("/usr/" + self.lib_path + "/carla/libcarla_utils.so"):
4b7e3ae
             utils = CarlaUtils("/usr/lib/carla/libcarla_utils.so")
4b7e3ae
             last_pos = 0
4b7e3ae
-            lv2path = os.getenv("LV2_PATH", "~/.lv2:/usr/lib/lv2:/usr/local/lib/lv2")
4b7e3ae
+            lv2path = os.getenv("LV2_PATH", "~/.lv2:/usr/" + self.lib_path + "/lv2:/usr/local/" + self.lib_path + "/lv2")
4b7e3ae
             for i in range(utils.get_cached_plugin_count(PLUGIN_LV2, lv2path)):
4b7e3ae
                 plugin = utils.get_cached_plugin_info(PLUGIN_LV2, i)
4b7e3ae
 
4b7e3ae
diff --git a/src/shared_cadence.py b/src/shared_cadence.py
4b7e3ae
index 2a819f3..d4b676c 100644
4b7e3ae
--- a/src/shared_cadence.py
4b7e3ae
+++ b/src/shared_cadence.py
4b7e3ae
@@ -30,32 +30,37 @@ else:
4b7e3ae
 # Imports (Custom Stuff)
4b7e3ae
 
4b7e3ae
 from shared import *
4b7e3ae
+import os
4b7e3ae
 
4b7e3ae
 # ------------------------------------------------------------------------------------------------------------
4b7e3ae
 # Default Plugin PATHs
4b7e3ae
+if os.path.isdir("/usr/lib64"):
4b7e3ae
+    LIB_PATH = "lib64"
4b7e3ae
+else:
4b7e3ae
+    LIB_PATH = "lib"
4b7e3ae
 
4b7e3ae
 DEFAULT_LADSPA_PATH = [
4b7e3ae
     os.path.join(HOME, ".ladspa"),
4b7e3ae
-    os.path.join("/", "usr", "lib", "ladspa"),
4b7e3ae
-    os.path.join("/", "usr", "local", "lib", "ladspa")
4b7e3ae
+    os.path.join("/", "usr", LIB_PATH, "ladspa"),
4b7e3ae
+    os.path.join("/", "usr", "local", LIB_PATH, "ladspa")
4b7e3ae
 ]
4b7e3ae
 
4b7e3ae
 DEFAULT_DSSI_PATH = [
4b7e3ae
     os.path.join(HOME, ".dssi"),
4b7e3ae
-    os.path.join("/", "usr", "lib", "dssi"),
4b7e3ae
-    os.path.join("/", "usr", "local", "lib", "dssi")
4b7e3ae
+    os.path.join("/", "usr", LIB_PATH, "dssi"),
4b7e3ae
+    os.path.join("/", "usr", "local", LIB_PATH, "dssi")
4b7e3ae
 ]
4b7e3ae
 
4b7e3ae
 DEFAULT_LV2_PATH = [
4b7e3ae
     os.path.join(HOME, ".lv2"),
4b7e3ae
-    os.path.join("/", "usr", "lib", "lv2"),
4b7e3ae
-    os.path.join("/", "usr", "local", "lib", "lv2")
4b7e3ae
+    os.path.join("/", "usr", LIB_PATH, "lv2"),
4b7e3ae
+    os.path.join("/", "usr", "local", LIB_PATH, "lv2")
4b7e3ae
 ]
4b7e3ae
 
4b7e3ae
 DEFAULT_VST_PATH = [
4b7e3ae
     os.path.join(HOME, ".vst"),
4b7e3ae
-    os.path.join("/", "usr", "lib", "vst"),
4b7e3ae
-    os.path.join("/", "usr", "local", "lib", "vst")
4b7e3ae
+    os.path.join("/", "usr", LIB_PATH, "vst"),
4b7e3ae
+    os.path.join("/", "usr", "local", LIB_PATH, "vst")
4b7e3ae
 ]
4b7e3ae
 
4b7e3ae
 # ------------------------------------------------------------------------------------------------------------
4b7e3ae
-- 
4b7e3ae
2.13.6
4b7e3ae