Skip to content

Commit

Permalink
hardinfo: bugfix & enhancement
Browse files Browse the repository at this point in the history
* Introduced a new patch to fix problematic loading order of modules. See
... upstream issue lpereira/hardinfo#676
* Dropped unneeded prepare file
* Updated dependency list

Signed-off-by: Camber Huang <[email protected]>
  • Loading branch information
CamberLoid committed Oct 8, 2022
1 parent de98b48 commit a166489
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
5 changes: 3 additions & 2 deletions extra-utils/hardinfo/autobuild/defines
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
PKGNAME=hardinfo
PKGSEC=utils
PKGDEP="gtk-3 libsoup zlib json-glib sysbench"
PKGDEP="gtk-3 libsoup zlib json-glib sysbench hddtemp"
# LuaJIT is not available on riscv64 for now.
PKGDEP__RISCV64="${PKGDEP/sysbench/}"
PKGDEP__RETRO="gtk-2 zlib"
BUILDDEP="intltool"
PKGDES="A system information and benchmark tool"

# Use GTK-3 instead of outdated GTK-2 on mainline architecture
CMAKE_AFTER__MAINLINE="-DHARDINFO_GTK3=1"
CMAKE_AFTER__MAINLINE=" -DHARDINFO_GTK3=1"
#CMAKE_AFTER__MAINLINE+=" -CMAKE_BUILD_TYPE=Debug"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/hardinfo/util.c b/hardinfo/util.c
index 38c7bce..0f02afb 100644
--- a/hardinfo/util.c
+++ b/hardinfo/util.c
@@ -962,11 +962,21 @@ static GSList *modules_load(gchar ** module_list)
dir = g_dir_open(filename, 0, NULL);
g_free(filename);

+ /***
+ * g_module_open("benchmark.so"/"computer.so") failed due to some undefined
+ * symbols, which are located in devices.so.
+ * From https://docs.gtk.org/glib/method.Dir.read_name.html
+ * The order of entries returned from this g_dir_read_name() is not
+ * defined. Unless we got a better solution, we need a hardcoded
+ * module list, or load devices.so first.
+ */
+ DEBUG("Temporary fix: loading devices.so before all");
+ module_load((gchar *) "devices.so");
if (dir) {
while ((filename = (gchar *) g_dir_read_name(dir))) {
if (g_strrstr(filename, "." G_MODULE_SUFFIX) &&
module_in_module_list(filename, module_list) &&
- ((module = module_load(filename)))) {
+ ((module = module_load(filename)))) { // Where the bug exists
modules = g_slist_prepend(modules, module);
}
}
1 change: 0 additions & 1 deletion extra-utils/hardinfo/autobuild/prepare

This file was deleted.

4 changes: 2 additions & 2 deletions extra-utils/hardinfo/spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VER=0.5.1+git20220724
_COMMIT="10f9789e95b735931805b7eb684ae43ac6f29353"
_COMMIT="54b2e307af763ce87bc8c88e80785d8114bf38dd"
SRCS="tbl::https://github.com/lpereira/hardinfo/archive/${_COMMIT}.tar.gz"
CHKSUMS="sha256::0e2a762bcbce157f26127a5f67cf65e60043c0b1f9e6a78ea48ea16abbe497ab"
CHKSUMS="sha256::d1e92c037aedc5b8156ee3c1452ea035f422e70878132a032c1ae0be396e468f"
CHKUPDATE="anitya::id=14563"

0 comments on commit a166489

Please sign in to comment.