Accepting request 1237077 from hardware:sdr

OBS-URL: https://build.opensuse.org/request/show/1237077
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hamlib?expand=0&rev=21
This commit is contained in:
Ana Guerrero 2025-01-12 10:23:06 +00:00 committed by Git OBS Bridge
commit e09852c813
7 changed files with 182 additions and 5 deletions

View File

@ -0,0 +1,55 @@
From f2a9f091d08667db9d3fc2e842a427af7cfb990e Mon Sep 17 00:00:00 2001
From: Michael Black W9MDB <mdblack98@yahoo.com>
Date: Sun, 29 Dec 2024 08:42:24 -0600
Subject: [PATCH 1/6] Change rig_list_foreach back to using const argument --
was breaking many C++ application builds
https://github.com/Hamlib/Hamlib/issues/1647
---
include/hamlib/rig.h | 2 +-
src/register.c | 2 +-
tests/rigctl_parse.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index c15c706c9..bba2f8133 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -3791,7 +3791,7 @@ extern HAMLIB_EXPORT(int)
rig_unregister HAMLIB_PARAMS((rig_model_t rig_model));
extern HAMLIB_EXPORT(int)
-rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(struct rig_caps *, rig_ptr_t),
+rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rig_caps *, rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
diff --git a/src/register.c b/src/register.c
index fcf62b03e..ef0c1f9fd 100644
--- a/src/register.c
+++ b/src/register.c
@@ -393,7 +393,7 @@ int HAMLIB_API rig_unregister(rig_model_t rig_model)
* executes cfunc on all the elements stored in the rig hash list
*/
//! @cond Doxygen_Suppress
-int HAMLIB_API rig_list_foreach(int (*cfunc)(struct rig_caps *,
+int HAMLIB_API rig_list_foreach(int (*cfunc)(const struct rig_caps *,
rig_ptr_t),
rig_ptr_t data)
{
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 263a7bad8..bcb10af96 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -2088,7 +2088,7 @@ int print_conf_list2(const struct confparams *cfp, rig_ptr_t data)
return 1; /* !=0, we want them all ! */
}
-static int hash_model_list(struct rig_caps *caps, void *data)
+static int hash_model_list(const struct rig_caps *caps, void *data)
{
hash_add_model(caps->rig_model,
caps->mfg_name,
--
2.47.1

View File

@ -0,0 +1,26 @@
From 601dd1361cbc897b41c989a10dca2e2bb191a112 Mon Sep 17 00:00:00 2001
From: Michael Black W9MDB <mdblack98@yahoo.com>
Date: Sun, 29 Dec 2024 08:51:47 -0600
Subject: [PATCH 2/6] Fix testrigopen.c rig_list_foreach
https://github.com/Hamlib/Hamlib/issues/1647
---
tests/testrigopen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/testrigopen.c b/tests/testrigopen.c
index b98064a1e..74886e8d7 100644
--- a/tests/testrigopen.c
+++ b/tests/testrigopen.c
@@ -16,7 +16,7 @@
#define SERIAL_PORT "/dev/ttyUSB0"
-int callback(struct rig_caps *caps, rig_ptr_t rigp)
+int callback(const struct rig_caps *caps, rig_ptr_t rigp)
{
RIG *rig = (RIG *) rigp;
--
2.47.1

View File

@ -0,0 +1,26 @@
From 728d0a543290d23c4f19023f15845e1ca0e7fc3f Mon Sep 17 00:00:00 2001
From: Michael Black W9MDB <mdblack98@yahoo.com>
Date: Sun, 29 Dec 2024 08:56:53 -0600
Subject: [PATCH 3/6] Fix listrigs.s rig_list_foreach
https://github.com/Hamlib/Hamlib/issues/1647
---
tests/listrigs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/listrigs.c b/tests/listrigs.c
index 65300d25f..230b1c413 100644
--- a/tests/listrigs.c
+++ b/tests/listrigs.c
@@ -27,7 +27,7 @@
#include <hamlib/rig.h>
-int print_caps_sum(struct rig_caps *caps, void *data)
+int print_caps_sum(const struct rig_caps *caps, void *data)
{
const char *fmt1 = "%-13s";
printf("%6u \t%-22s \t%-23s\t%-8s \t",
--
2.47.1

View File

@ -0,0 +1,26 @@
From ac8a8b2027983f6710f29abc170555607b4796c9 Mon Sep 17 00:00:00 2001
From: Michael Black W9MDB <mdblack98@yahoo.com>
Date: Sun, 29 Dec 2024 10:33:33 -0600
Subject: [PATCH 4/6] Fix rig_list_foreach in hamlibmodels.c
https://github.com/Hamlib/Hamlib/issues/1647
---
tests/hamlibmodels.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/hamlibmodels.c b/tests/hamlibmodels.c
index 0a5e21596..a7cfac7f0 100644
--- a/tests/hamlibmodels.c
+++ b/tests/hamlibmodels.c
@@ -7,7 +7,7 @@ char *list[1000]; // as of 2023-01-17 we have 275 rigs so this should cover us f
int nmodels = 0;
-static int hash_model_list(struct rig_caps *caps, void *data)
+static int hash_model_list(const struct rig_caps *caps, void *data)
{
char s[256];
sprintf(s, "%s %s", caps->mfg_name, caps->model_name);
--
2.47.1

View File

@ -0,0 +1,25 @@
From 028d750249ab00c8c362598c838b15e8aa6a2951 Mon Sep 17 00:00:00 2001
From: Michael Black W9MDB <mdblack98@yahoo.com>
Date: Sun, 29 Dec 2024 10:43:39 -0600
Subject: [PATCH 5/6] Fix rig_list_foreach in testmW2power.c
---
tests/testmW2power.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/testmW2power.c b/tests/testmW2power.c
index 88c38b6ed..9e910e95c 100644
--- a/tests/testmW2power.c
+++ b/tests/testmW2power.c
@@ -13,7 +13,7 @@
int nrigs = 0;
-int callback(struct rig_caps *caps, rig_ptr_t rigp)
+int callback(const struct rig_caps *caps, rig_ptr_t rigp)
{
RIG *rig = (RIG *) rigp;
--
2.47.1

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sat Jan 11 17:26:08 UTC 2025 - Andreas Stieger <andreas.stieger@gmx.de>
- add patches from upstream fixing Tucnak build:
* 0001-Change-rig_list_foreach-back-to-using-const-argument.patch
* 0002-Fix-testrigopen.c-rig_list_foreach.patch
* 0003-Fix-listrigs.s-rig_list_foreach.patch
* 0004-Fix-rig_list_foreach-in-hamlibmodels.c.patch
* 0005-Fix-rig_list_foreach-in-testmW2power.c.patch
-------------------------------------------------------------------
Sat Dec 28 22:31:12 UTC 2024 - Wojciech Kazubski <wk@ire.pw.edu.pl>

View File

@ -2,6 +2,7 @@
# spec file for package hamlib
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 Andreas Stieger <Andreas.Stieger@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -29,6 +30,11 @@ Source2: https://github.com/Hamlib/Hamlib/releases/download/%{version}/%{
# taken from debian
Source3: %{name}.keyring
Patch0: hamlib-3.0-perl_install.patch
Patch1: 0001-Change-rig_list_foreach-back-to-using-const-argument.patch
Patch2: 0002-Fix-testrigopen.c-rig_list_foreach.patch
Patch3: 0003-Fix-listrigs.s-rig_list_foreach.patch
Patch4: 0004-Fix-rig_list_foreach-in-hamlibmodels.c.patch
Patch5: 0005-Fix-rig_list_foreach-in-testmW2power.c.patch
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libtool
@ -120,7 +126,7 @@ autoreconf -fiv
--with-perl-binding \
--with-tcl-binding \
--with-lua-binding \
--with-python-binding PYTHON_VERSION=%py3_ver \
--with-python-binding PYTHON_VERSION=%{py3_ver} \
--with-xml-support
%make_build
@ -138,10 +144,8 @@ mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}%{_docdir}
%check
%make_build check
%post -n libhamlib++%{sover} -p /sbin/ldconfig
%post -n libhamlib%{sover} -p /sbin/ldconfig
%postun -n libhamlib++%{sover} -p /sbin/ldconfig
%postun -n libhamlib%{sover} -p /sbin/ldconfig
%ldconfig_scriptlets -n libhamlib%{sover}
%ldconfig_scriptlets -n libhamlib++%{sover}
%files
%license LICENSE
@ -181,6 +185,7 @@ mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}%{_docdir}
%exclude %{_docdir}/hamlib/LICENSE
%files devel
%license COPYING COPYING.LIB
%dir %{_includedir}/hamlib
%{_includedir}/hamlib/*.h
%{_datadir}/aclocal/hamlib.m4
@ -197,19 +202,23 @@ mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}%{_docdir}
%{_libdir}/libhamlib++.so.%{sover}*
%files -n lua-Hamliblua
%license COPYING COPYING.LIB
%{_libdir}/lua
%files -n python3-Hamlib
%license COPYING COPYING.LIB
%{python3_sitearch}/Hamlib.*
%{python3_sitearch}/_Hamlib.*
%{python3_sitearch}/__pycache__/Hamlib.cpython*.pyc
%files -n tcl-Hamlib
%license COPYING COPYING.LIB
%dir %{_libdir}/tcl*/
%dir %{_libdir}/tcl*/Hamlib
%{_libdir}/tcl*/Hamlib/*
%files -n perl-Hamlib
%license COPYING COPYING.LIB
%{perl_vendorarch}/*
%changelog