From 4069bb50e94f9998fec9626b5356fb6ef66bde50 Mon Sep 17 00:00:00 2001 From: Ryan Volz Date: Fri, 26 Apr 2024 15:31:17 -0400 Subject: [PATCH] Add qdarkstyle dep for grc (qt) and patches to fix running grc-qt --- ...l_blocks_path-preference-and-use-pre.patch | 37 ++++++++++++++++++- ...n-t-error-when-missing-manifests-dir.patch | 27 ++++++++++++++ recipe/meta.yaml | 4 +- 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 recipe/0005-grc-qt-Don-t-error-when-missing-manifests-dir.patch diff --git a/recipe/0002-grc-Remove-global_blocks_path-preference-and-use-pre.patch b/recipe/0002-grc-Remove-global_blocks_path-preference-and-use-pre.patch index 637a1490..7d1d1515 100644 --- a/recipe/0002-grc-Remove-global_blocks_path-preference-and-use-pre.patch +++ b/recipe/0002-grc-Remove-global_blocks_path-preference-and-use-pre.patch @@ -20,7 +20,8 @@ Signed-off-by: Ryan Volz grc/core/{Constants.py => Constants.py.in} | 2 ++ grc/grc.conf.in | 3 +-- grc/gui/Config.py | 3 +-- - 6 files changed, 27 insertions(+), 19 deletions(-) + grc/gui_qt/Config.py | 8 ++++---- + 7 files changed, 31 insertions(+), 23 deletions(-) rename grc/core/{Constants.py => Constants.py.in} (97%) diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt @@ -173,6 +174,40 @@ index 5aab9d7b8..51301e79c 100644 Constants.update_font_size(self.font_size) self.parser = configparser.ConfigParser() +diff --git a/grc/gui_qt/Config.py b/grc/gui_qt/Config.py +index 28b735773..c953aa8fa 100644 +--- a/grc/gui_qt/Config.py ++++ b/grc/gui_qt/Config.py +@@ -1,7 +1,8 @@ + import os +-from os.path import expanduser, normpath, expandvars, exists ++from os.path import expanduser, normpath, expandvars, exists, join + from collections import OrderedDict + ++from . import Constants + from ..core.Config import Config as CoreConfig + from qtpy import QtCore + +@@ -13,9 +14,8 @@ class Config(CoreConfig): + gui_prefs_file = os.environ.get( + 'GRC_QT_PREFS_PATH', os.path.expanduser('~/.gnuradio/grc_qt.conf')) + +- def __init__(self, install_prefix, *args, **kwargs): ++ def __init__(self, *args, **kwargs): + CoreConfig.__init__(self, *args, **kwargs) +- self.install_prefix = install_prefix + self.qsettings = QtCore.QSettings(self.gui_prefs_file, QtCore.QSettings.IniFormat) + + @property +@@ -28,7 +28,7 @@ class Config(CoreConfig): + self.hier_block_lib_dir, + os.environ.get('GRC_BLOCKS_PATH', ''), + self._gr_prefs.get_string('grc', 'local_blocks_path', ''), +- self._gr_prefs.get_string('grc', 'global_blocks_path', ''), ++ normpath(join(self.install_prefix, Constants.GRC_BLOCKS_DIR)), + self.qsettings.value('grc/custom_block_paths', ''), + ) + -- 2.42.0 diff --git a/recipe/0005-grc-qt-Don-t-error-when-missing-manifests-dir.patch b/recipe/0005-grc-qt-Don-t-error-when-missing-manifests-dir.patch new file mode 100644 index 00000000..29790f8e --- /dev/null +++ b/recipe/0005-grc-qt-Don-t-error-when-missing-manifests-dir.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ryan Volz +Date: Fri, 26 Apr 2024 15:28:30 -0400 +Subject: [PATCH] grc-qt: Don't error when missing manifests dir + +Signed-off-by: Ryan Volz +--- + grc/gui_qt/components/oot_browser.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/grc/gui_qt/components/oot_browser.py b/grc/gui_qt/components/oot_browser.py +index f25f67cd4..5e599e697 100644 +--- a/grc/gui_qt/components/oot_browser.py ++++ b/grc/gui_qt/components/oot_browser.py +@@ -31,6 +31,9 @@ class OOTBrowser(QtWidgets.QDialog, base.Component): + + self.manifest_dir = os.path.join(Paths.RESOURCES, "manifests") + ++ if not os.path.exists(self.manifest_dir): ++ return ++ + for f in os.listdir(self.manifest_dir): + with open(os.path.join(self.manifest_dir, f), 'r', encoding='utf8') as manifest: + text = manifest.read() +-- +2.42.0 + diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 57750aba..54d009ee 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -14,9 +14,10 @@ source: - 0002-grc-Remove-global_blocks_path-preference-and-use-pre.patch - 0003-filter-python-Drop-unused-args-argument-overriden-by.patch - 0004-cmake-runtime-Manually-set-the-pybind11-internal-bui.patch + - 0005-grc-qt-Don-t-error-when-missing-manifests-dir.patch build: - number: 0 + number: 1 requirements: build: @@ -297,6 +298,7 @@ outputs: - pygobject - python - pyyaml + - qdarkstyle - qtpy test: requires: