Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsjtx, js8call: unvendor hamlib #265897

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions pkgs/applications/radio/js8call/cmake.patch
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ index 75b80b3..7c04265 100644

# if (UNIX)
# if (NOT WSJT_SKIP_MANPAGES)
@@ -1292,3 +1292,5 @@ configure_file ("${PROJECT_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
set (CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CMakeCPackOptions.cmake")

include (CPack)
+
+add_definitions (-DJS8_USE_HAMLIB_THREE)
diff --git a/Configuration.cpp b/Configuration.cpp
index 8258f97..63a29bb 100644
--- a/Configuration.cpp
Expand Down
9 changes: 6 additions & 3 deletions pkgs/applications/radio/js8call/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, fetchFromBitbucket
, wrapQtAppsHook
, pkg-config
, hamlib
, hamlib_4-wsjtx
, libusb1
, cmake
, gfortran
Expand Down Expand Up @@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
];

buildInputs = [
hamlib
hamlib_4-wsjtx
libusb1
fftw
fftwFloat
Expand All @@ -49,7 +49,10 @@ stdenv.mkDerivation rec {
--replace "/usr/bin/" "$out/bin"
'';

patches = [ ./cmake.patch ];
patches = [
./cmake.patch
./qt-fixes.patch
];

meta = with lib; {
description = "Weak-signal keyboard messaging for amateur radio";
Expand Down
13 changes: 13 additions & 0 deletions pkgs/applications/radio/js8call/qt-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/qt_helpers.hpp b/qt_helpers.hpp
index bc3ce74..31927e4 100644
--- a/qt_helpers.hpp
+++ b/qt_helpers.hpp
@@ -99,7 +99,7 @@ public:

static QVariant asQVariant(T * ptr)
{
- return qVariantFromValue (reinterpret_cast<void *> (ptr));
+ return QVariant::fromValue (reinterpret_cast<void *> (ptr));
}
};

28 changes: 11 additions & 17 deletions pkgs/applications/radio/wsjtx/default.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
{ lib, stdenv, fetchurl, asciidoc, asciidoctor, autoconf, automake, cmake,
docbook_xsl, fftw, fftwFloat, gfortran, libtool, libusb1, qtbase,
{ lib, stdenv, fetchgit, asciidoc, asciidoctor, cmake, pkg-config,
fftw, fftwFloat, gfortran, hamlib_4-wsjtx, libtool, libusb1, qtbase,
qtmultimedia, qtserialport, qttools, boost, texinfo, wrapQtAppsHook }:

stdenv.mkDerivation rec {
pname = "wsjtx";
version = "2.6.1";

# This is a "superbuild" tarball containing both wsjtx and a hamlib fork
src = fetchurl {
url = "https://sourceforge.net/projects/wsjt/files/wsjtx-${version}/wsjtx-${version}.tgz";
sha256 = "sha256-YNDiy0WkmmrVhbCQiCGp/yw6wlZNYQQmIP82wt3Mdl8=";
src = fetchgit {
url = "http://git.code.sf.net/p/wsjt/wsjtx";
rev = "wsjtx-${version}";
hash = "sha256-fELx3B9JqCCL5vaIHab3of5ah9qdu5lemqjUnvY5DdM=";
};

# Hamlib builds with autotools, wsjtx builds with cmake
# Omitting pkg-config because it causes issues locating the built hamlib
nativeBuildInputs = [
asciidoc asciidoctor autoconf automake cmake docbook_xsl gfortran libtool
qttools texinfo wrapQtAppsHook
asciidoc asciidoctor cmake gfortran libtool
pkg-config qttools texinfo wrapQtAppsHook
];
buildInputs = [ fftw fftwFloat libusb1 qtbase qtmultimedia qtserialport boost ];

# Remove Git dependency from superbuild since sources are included
patches = [ ./super.patch ];
buildInputs = [ fftw fftwFloat hamlib_4-wsjtx libusb1 qtbase qtmultimedia qtserialport boost ];

meta = with lib; {
description = "Weak-signal digital communication modes for amateur radio";
Expand All @@ -33,9 +28,8 @@ stdenv.mkDerivation rec {
contacts under extreme weak-signal conditions.
'';
homepage = "https://physics.princeton.edu/pulsar/k1jt/wsjtx.html";
# Older licenses are for the statically-linked hamlib
license = with licenses; [ gpl3Plus gpl2Plus lgpl21Plus ];
license = with licenses; [ gpl3Plus ];
platforms = platforms.linux;
maintainers = with maintainers; [ lasandell numinit ];
maintainers = with maintainers; [ lasandell numinit melling ];
};
}
12 changes: 0 additions & 12 deletions pkgs/applications/radio/wsjtx/super.patch

This file was deleted.

78 changes: 78 additions & 0 deletions pkgs/development/libraries/hamlib/wsjtx.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{ lib
, stdenv
, fetchgit
, autoreconfHook
, perl
, swig
, gd
, ncurses
, python3
, libxml2
, tcl
, libusb1
, pkg-config
, boost
, libtool
, perlPackages
, pythonBindings ? true
, tclBindings ? true
, perlBindings ? stdenv.buildPlatform == stdenv.hostPlatform
, buildPackages
}:

let
version = "4.3.1";
in stdenv.mkDerivation {
pname = "hamlib";
version = "${version}-wsjtx";

src = fetchgit {
url = "git://git.code.sf.net/u/bsomervi/hamlib";
rev = version;
hash = "sha256-aXQjB49GBVz9rY67VXHLMmLM1l4ZR53By4XroenSvak=";
};

strictDeps = true;
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [
autoreconfHook
swig
pkg-config
libtool
] ++ lib.optionals pythonBindings [ python3 ]
++ lib.optionals tclBindings [ tcl ]
++ lib.optionals perlBindings [ perl ];

buildInputs = [
gd
libxml2
libusb1
boost
] ++ lib.optionals pythonBindings [ python3 ncurses ]
++ lib.optionals tclBindings [ tcl ];


configureFlags = [
"CC_FOR_BUILD=${stdenv.cc.targetPrefix}cc"
] ++ lib.optionals perlBindings [ "--with-perl-binding" ]
++ lib.optionals tclBindings [ "--with-tcl-binding" "--with-tcl=${tcl}/lib/" ]
++ lib.optionals pythonBindings [ "--with-python-binding" ];

meta = with lib; {
description = "WSJT-X fork of the runtime library to control radio transceivers and receivers";
longDescription = ''
Hamlib provides a standardized programming interface that applications
can use to send the appropriate commands to a radio.

Also included in the package is a simple radio control program 'rigctl',
which lets one control a radio transceiver or receiver, either from
command line interface or in a text-oriented interactive interface.

This package is the fork used by WSJT-X and related applications.
'';
license = with licenses; [ gpl2Plus lgpl2Plus ];
homepage = "https://hamlib.sourceforge.net";
maintainers = with maintainers; [ melling ];
platforms = with platforms; unix;
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22014,6 +22014,7 @@ with pkgs;
hamlib = hamlib_3;
hamlib_3 = callPackage ../development/libraries/hamlib { };
hamlib_4 = callPackage ../development/libraries/hamlib/4.nix { };
hamlib_4-wsjtx = callPackage ../development/libraries/hamlib/wsjtx.nix { };

heimdal = callPackage ../development/libraries/kerberos/heimdal.nix {
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security SystemConfiguration;
Expand Down