From 34cfba36429056072972a0f12a7470375cc8eeaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Thu, 13 Feb 2025 22:34:52 -0500 Subject: [PATCH 1/3] unixcw: cleanup, fix license --- pkgs/applications/radio/unixcw/default.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/radio/unixcw/default.nix b/pkgs/applications/radio/unixcw/default.nix index 8565b691802d..e1fbfe65ec9a 100644 --- a/pkgs/applications/radio/unixcw/default.nix +++ b/pkgs/applications/radio/unixcw/default.nix @@ -11,23 +11,28 @@ 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 ]; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libpulseaudio alsa-lib qtbase ]; + 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 +49,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; }; } From 296a46fa94ba07a19b1324f3ab90355dc0f3a06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Thu, 13 Feb 2025 22:38:33 -0500 Subject: [PATCH 2/3] unixcw: move to by-name --- .../default.nix => by-name/un/unixcw/package.nix} | 13 ++++++++----- .../un}/unixcw/remove-use-of-dlopen.patch | 0 pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 8 insertions(+), 7 deletions(-) rename pkgs/{applications/radio/unixcw/default.nix => by-name/un/unixcw/package.nix} (92%) rename pkgs/{applications/radio => by-name/un}/unixcw/remove-use-of-dlopen.patch (100%) diff --git a/pkgs/applications/radio/unixcw/default.nix b/pkgs/by-name/un/unixcw/package.nix similarity index 92% rename from pkgs/applications/radio/unixcw/default.nix rename to pkgs/by-name/un/unixcw/package.nix index e1fbfe65ec9a..df8e8fe0469f 100644 --- a/pkgs/applications/radio/unixcw/default.nix +++ b/pkgs/by-name/un/unixcw/package.nix @@ -1,14 +1,14 @@ { lib, - mkDerivation, + stdenv, fetchurl, libpulseaudio, alsa-lib, pkg-config, - qtbase, + qt5, }: -mkDerivation rec { +stdenv.mkDerivation rec { pname = "unixcw"; version = "3.5.1"; @@ -21,12 +21,15 @@ mkDerivation rec { ./remove-use-of-dlopen.patch ]; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ + pkg-config + qt5.wrapQtAppsHook + ]; buildInputs = [ libpulseaudio alsa-lib - qtbase + qt5.qtbase ]; CFLAGS = "-lasound -lpulse-simple"; diff --git a/pkgs/applications/radio/unixcw/remove-use-of-dlopen.patch b/pkgs/by-name/un/unixcw/remove-use-of-dlopen.patch similarity index 100% rename from pkgs/applications/radio/unixcw/remove-use-of-dlopen.patch rename to pkgs/by-name/un/unixcw/remove-use-of-dlopen.patch diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0a58cf1edb0c..274a3ad66cdc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17979,8 +17979,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 { From 6288f880889a22e30696302d55b8e1e0ec4f68f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Thu, 13 Feb 2025 22:41:50 -0500 Subject: [PATCH 3/3] unixcw: build cwcp --- pkgs/by-name/un/unixcw/package.nix | 13 ++++++++++++ pkgs/by-name/un/unixcw/unixcw-3.6-tinfo.patch | 20 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/by-name/un/unixcw/unixcw-3.6-tinfo.patch diff --git a/pkgs/by-name/un/unixcw/package.nix b/pkgs/by-name/un/unixcw/package.nix index df8e8fe0469f..fc169b90d32f 100644 --- a/pkgs/by-name/un/unixcw/package.nix +++ b/pkgs/by-name/un/unixcw/package.nix @@ -6,6 +6,8 @@ alsa-lib, pkg-config, qt5, + ncurses, + autoreconfHook, }: stdenv.mkDerivation rec { @@ -19,9 +21,19 @@ stdenv.mkDerivation rec { 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 ]; + postPatch = '' + substituteInPlace src/cwcp/Makefile.am \ + --replace-fail '-lcurses' '-lncurses' + ''; + nativeBuildInputs = [ + autoreconfHook pkg-config qt5.wrapQtAppsHook ]; @@ -30,6 +42,7 @@ stdenv.mkDerivation rec { libpulseaudio alsa-lib qt5.qtbase + ncurses ]; CFLAGS = "-lasound -lpulse-simple"; diff --git a/pkgs/by-name/un/unixcw/unixcw-3.6-tinfo.patch b/pkgs/by-name/un/unixcw/unixcw-3.6-tinfo.patch new file mode 100644 index 000000000000..01038fa1fdd8 --- /dev/null +++ b/pkgs/by-name/un/unixcw/unixcw-3.6-tinfo.patch @@ -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])