unixcw: refactor, by-name, and build missing binary (cwcp) (#381948)

This commit is contained in:
Aleksana 2025-02-18 11:26:26 +08:00 committed by GitHub
commit 385231d765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 52 additions and 13 deletions

View File

@ -1,33 +1,54 @@
{
lib,
mkDerivation,
stdenv,
fetchurl,
libpulseaudio,
alsa-lib,
pkg-config,
qtbase,
qt5,
ncurses,
autoreconfHook,
}:
mkDerivation rec {
stdenv.mkDerivation rec {
pname = "unixcw";
version = "3.5.1";
src = fetchurl {
url = "mirror://sourceforge/unixcw/unixcw_${version}.orig.tar.gz";
sha256 = "5f3aacd8a26e16e6eff437c7ae1e9b389956fb137eeb3de24670ce05de479e7a";
hash = "sha256-Xzqs2KJuFubv9DfHrh6bOJlW+xN+6z3iRnDOBd5Hnno=";
};
patches = [
./remove-use-of-dlopen.patch
# fix pkg-config searching for ncurses
# yoinked from gentoo (https://gitweb.gentoo.org/repo/gentoo.git/tree/media-radio/unixcw/files/unixcw-3.6-tinfo.patch), with modifications
./unixcw-3.6-tinfo.patch
];
nativeBuildInputs = [ pkg-config ];
postPatch = ''
substituteInPlace src/cwcp/Makefile.am \
--replace-fail '-lcurses' '-lncurses'
'';
nativeBuildInputs = [
autoreconfHook
pkg-config
qt5.wrapQtAppsHook
];
buildInputs = [
libpulseaudio
alsa-lib
qtbase
qt5.qtbase
ncurses
];
CFLAGS = "-lasound -lpulse-simple";
meta = with lib; {
description = "sound characters as Morse code on the soundcard or console speaker";
meta = {
description = "Sound characters as Morse code on the soundcard or console speaker";
longDescription = ''
unixcw is a project providing libcw library and a set of programs
using the library: cw, cwgen, cwcp and xcwcp.
@ -44,8 +65,8 @@ mkDerivation rec {
cw reports any errors in embedded commands
'';
homepage = "https://unixcw.sourceforge.net";
maintainers = [ maintainers.mafo ];
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ lib.maintainers.mafo ];
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
};
}

View File

@ -0,0 +1,20 @@
--- a/configure.ac 2017-03-07 13:31:46.074580930 +0100
+++ b/configure.ac 2017-03-07 13:33:25.640924331 +0100
@@ -347,7 +347,7 @@
AC_DEFINE([LIBCW_WITH_PULSEAUDIO], [1], [Define as 1 if your build machine can support PulseAudio.])
fi
-
+PKG_PROG_PKG_CONFIG
if test "$enable_cwcp" = "no" ; then
WITH_CWCP='no'
@@ -355,6 +355,7 @@
AC_CHECK_LIB(curses, initscr)
- if test $ac_cv_lib_curses_initscr = 'yes' ; then
+ if true ; then
WITH_CWCP='yes'
+ PKG_CHECK_MODULES(ncurses, ncurses, [NCURSES_LIB="$ncurses_LIBS"], )
else
WITH_CWCP='no'
AC_MSG_WARN([Cannot find libcurses - unable to build cwcp])

View File

@ -17925,8 +17925,6 @@ with pkgs;
unityhub = callPackage ../development/tools/unityhub { };
unixcw = libsForQt5.callPackage ../applications/radio/unixcw { };
vaultenv = haskell.lib.justStaticExecutables haskellPackages.vaultenv;
vaultwarden = callPackage ../tools/security/vaultwarden {