Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 796866 - media-libs/hamlib-4.2 version bump (4.1 has frequency slip when using gpredict on Icom transceivers)
Summary: media-libs/hamlib-4.2 version bump (4.1 has frequency slip when using gpredic...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Beierlein
URL: https://sourceforge.net/projects/haml...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-20 08:08 UTC by Brett Coady
Modified: 2021-06-24 05:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brett Coady 2021-06-20 08:08:05 UTC
Icom transceivers using CIV computer control, slip in frequency on the main display of gpredict while tracking satellites.


Reproducible: Always

Steps to Reproduce:
1.Install media-libs/hamlib-4.1
2.Install and operate gpredict 2.3 or 9999
3.
Actual Results:  
Repaired by simple rename of the media-libs/hamlib-4.1 to media-libs/hamlib-4.2 in my own repository and adding keywording until stable.

Expected Results:  
No slip of frequency and running quite well. Checked on both gpredict 2.3 stable and 9999 unmasked. OK.

later version of hamlib 4.2 appears to have this problem fixed. Needs testing for other issues. Added keywording until stable.

hamlib-4.2.ebuild:

# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{7..9} )
MY_P=${P/_rc2/~rc2}

inherit autotools python-single-r1

DESCRIPTION="Ham radio backend rig control libraries"
HOMEPAGE="https://sourceforge.net/projects/hamlib/"
SRC_URI="mirror://sourceforge/hamlib/${MY_P}.tar.gz"

LICENSE="LGPL-2 GPL-2"
SLOT="0/4"
KEYWORDS="~amd64 ~x86"
IUSE="doc perl python tcl"

RESTRICT="test"

RDEPEND="
        =virtual/libusb-0*
        dev-libs/libxml2
        sys-libs/readline:0=
        perl? ( dev-lang/perl )
        python? ( ${PYTHON_DEPS} )
        tcl? ( dev-lang/tcl:0= )"

DEPEND=" ${RDEPEND}
        virtual/pkgconfig
        dev-lang/swig
        >=sys-devel/libtool-2.2
        doc? ( app-doc/doxygen )"

REQUIRED_USE="${PYTHON_REQUIRED_USE}"

DOCS=(AUTHORS NEWS PLAN README README.betatester README.developer)

S="${WORKDIR}/${MY_P}"

pkg_setup() {
        use python && python-single-r1_pkg_setup
}

src_prepare() {
        # fix hardcoded libdir paths
        sed -i -e "s#fix}/lib#fix}/$(get_libdir)/hamlib#" \
                -e "s#fix}/include#fix}/include/hamlib#" \
                hamlib.pc.in || die "sed failed"

        # Correct install target to whatever INSTALLDIRS says and use vendor
        # installdirs everywhere (bug #611550)
        sed -i -e "s#install_site#install#"     \
        -e 's#MAKEFILE="Hamlib-pl.mk"#MAKEFILE="Hamlib-pl.mk" INSTALLDIRS=vendor#' \
        bindings/Makefile.am || die "sed failed patching for perl"

        # make building of documentation compatible with autotools-utils
        sed -i -e "s/doc:/html:/g" doc/Makefile.am || die "sed failed"

        eautoreconf

        eapply_user
}

src_configure() {
        econf \
                --libdir=/usr/$(get_libdir)/hamlib \
                --disable-static \
                --with-xml-support \
                $(use_with perl perl-binding) \
                $(use_with python python-binding) \
                $(use_with tcl tcl-binding)
}

src_compile() {
        emake
        use doc && emake html
}

src_install() {
        emake DESTDIR="${D}" install

        use python && python_optimize

        use doc && HTML_DOCS=( doc/html/ )
        einstalldocs

        insinto /usr/$(get_libdir)/pkgconfig
        doins hamlib.pc

        echo "LDPATH=/usr/$(get_libdir)/hamlib" > "${T}"/73hamlib
        doenvd "${T}"/73hamlib
}
Comment 1 Thomas Beierlein gentoo-dev 2021-06-20 17:02:46 UTC
Problem with hamlib-4.2 is that it changed its API so that quite some of the packages relying on hamlib can not be build. 

Lets wait for some time for the using packages to catch up with that.
Comment 2 Brett Coady 2021-06-21 04:03:27 UTC
(In reply to Thomas Beierlein from comment #1)
> Problem with hamlib-4.2 is that it changed its API so that quite some of the
> packages relying on hamlib can not be build. 
> 
> Lets wait for some time for the using packages to catch up with that.

Thanks for pointing this out. I have 3 other packages beside gpredict using hamlib: fldigi qsstv wsjtx
qsstv fails to build with hamlib 4.2 

gpredict's main developer was looking at an external plugin to remove the hamlib dependency, I might also look at this. Thanks for your time.
Comment 3 Thomas Beierlein gentoo-dev 2021-06-22 07:25:50 UTC
Of all packages relying on hamlib atm the following are failing to compile with a  new hamlib-4.2 version:

grig
qsstv
tlf
xlog

I am looking for a way to fix it at the moment.
Comment 4 Brett Coady 2021-06-22 13:57:02 UTC
(In reply to Thomas Beierlein from comment #3)
> Of all packages relying on hamlib atm the following are failing to compile
> with a  new hamlib-4.2 version:
> 
> grig
> qsstv
> tlf
> xlog
> 
> I am looking for a way to fix it at the moment.

I have qsstv going with a small patch but it might need some testing and rename -r1:

/media-radio/qsstv # cat qsstv-9.5.3.ebuild 
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit qmake-utils

MY_P=${P/-/_}

DESCRIPTION="Amateur radio SSTV software"
HOMEPAGE="http://users.telenet.be/on4qz/"
SRC_URI="http://users.telenet.be/on4qz/qsstv/downloads/${MY_P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE=""

CDEPEND="dev-qt/qtcore:5
        dev-qt/qtgui:5
        dev-qt/qtnetwork:5
        dev-qt/qtwidgets:5
        dev-qt/qtxml:5
        media-libs/hamlib:=
        media-libs/openjpeg:2
        media-libs/alsa-lib
        media-sound/pulseaudio
        media-libs/libv4l
        sci-libs/fftw:3.0="
DEPEND="${CDEPEND}
        virtual/pkgconfig"
RDEPEND="${CDEPEND}
        x11-misc/xdg-utils"

S="${WORKDIR}/${MY_P}"

src_prepare() {
        eapply_user
        eapply "${FILESDIR}/HAMLIB_FILPATHLEN.patch"
        # fix docdirectory, install path and hamlib search path
        sed -i -e "s:/doc/\$\$TARGET:/doc/${PF}:" \
                -e "s:-lhamlib:-L/usr/$(get_libdir)/hamlib -lhamlib:g" \
                qsstv.pro || die
}

src_configure() {
        eqmake5 PREFIX="/usr"
}

src_install() {
        emake INSTALL_ROOT="${D}" install
        dodoc README.txt
}


and the patch:

media-radio/qsstv/files # cat HAMLIB_FILPATHLEN.patch 
--- qsstv_9.5.3/rig/rigcontrol.cpp      2020-12-26 04:11:20.000000000 +1100
+++ qsstv_9.5.3/rig/rigcontrol.new.cpp  2021-06-21 22:41:45.681356724 +1000
@@ -87,7 +87,7 @@
     }
   if(!catParams.serialPort.isEmpty())
      {
-      strncpy(my_rig->state.rigport.pathname,(const char *)catParams.serialPort.toLatin1().data(),FILPATHLEN-1);
+      strncpy(my_rig->state.rigport.pathname,(const char *)catParams.serialPort.toLatin1().data(),HAMLIB_FILPATHLEN-1);
     }
 //  strncpy(my_rig->state.pttport.pathname,(const char *)catParams.serialPort.toLatin1().data(),FILPATHLEN);
   my_rig->state.rigport.parm.serial.rate = catParams.baudrate;
Comment 5 Brett Coady 2021-06-23 03:17:18 UTC
looks like similar could be done for media-radio/tlf-1.4.1:

sendqrg.c:103:6: error: ‘FILPATHLEN’ undeclared (first use in this function)
  103 |      FILPATHLEN - 1);
      |      ^~~~~~~~~~


and for media-radio/xlog-2.0.22:

hamlib-utils.c:171:50: error: ‘FILPATHLEN’ undeclared (first use in this function)
  171 |  strncpy (myrig->state.rigport.pathname, device, FILPATHLEN);
      |                                                  ^~~~~~~~~~


if I get time I might make these up with hopefully no further errors.
Comment 6 Thomas Beierlein gentoo-dev 2021-06-23 05:18:03 UTC
Thanks for your help Brett.

I did find and correct that problems already here. But the situation is a little bit more complex.

As we will have two versions of hamlib (4.1 and 4.2) in the tree for some time the solution will have to work with both versions. And we have to care that after a change of the installed version the packages in question have to be rebuild.
Comment 7 Thomas Beierlein gentoo-dev 2021-06-24 05:46:15 UTC
All preparations are in tree now. Hamlib-4.2 can be added now.
Comment 8 Larry the Git Cow gentoo-dev 2021-06-24 05:46:39 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=108c5996b25c0f0e7b78d7784343dd2bb1d4515c

commit 108c5996b25c0f0e7b78d7784343dd2bb1d4515c
Author:     Thomas Beierlein <tomjbe@gentoo.org>
AuthorDate: 2021-06-24 05:46:28 +0000
Commit:     Thomas Beierlein <tomjbe@gentoo.org>
CommitDate: 2021-06-24 05:46:28 +0000

    media-libs/hamlib: Version bump
    
    Closes: https://bugs.gentoo.org/796866
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Thomas Beierlein <tomjbe@gentoo.org>

 media-libs/hamlib/Manifest          |  1 +
 media-libs/hamlib/hamlib-4.2.ebuild | 94 +++++++++++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+)