Unverified Commit 9927c825 authored by Fernando Rodrigues's avatar Fernando Rodrigues Committed by GitHub
Browse files

direwolf: refactor; direwolf-unstable: init at 1.7-unstable-2025-04-29 (#406106)

parents e54d23d1 25e32a44
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  direwolf,
  nix-update-script,
  hamlibSupport ? true,
  gpsdSupport ? true,
  extraScripts ? false,
}:

(direwolf.override {
  inherit hamlibSupport gpsdSupport extraScripts;
}).overrideAttrs
  (oldAttrs: {
    version = "1.7-unstable-2025-04-29";

    src = fetchFromGitHub {
      owner = "wb2osz";
      repo = "direwolf";
      rev = "486b3cf1f685502af7dc87b0f9c9cead6800d47b";
      hash = "sha256-VFBkOWHGZP7GjekHL3GY3BGkVXQbtyD1YPmu0xaQ1ME=";
    };

    postPatch =
      builtins.replaceStrings
        [
          "decode_aprs.c"
          "tocalls.txt"
          "--replace-fail /etc/udev/rules.d/"
        ]
        [
          "deviceid.c"
          "tocalls.yaml"
          "--replace-fail /usr/lib/udev/rules.d/ $out/lib/udev/rules.d/ --replace-fail /etc/udev/rules.d/"
        ]
        oldAttrs.postPatch;

    dontVersionCheck = true;

    passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch=dev" ]; };
  })
+26 −18
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@
  alsa-lib,
  gpsd,
  gpsdSupport ? false,
  hamlib,
  hamlib_4,
  hamlib ? hamlib_4,
  hamlibSupport ? true,
  perl,
  portaudio,
@@ -15,17 +16,19 @@
  espeak,
  udev,
  udevCheckHook,
  versionCheckHook,
  nix-update-script,
  extraScripts ? false,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "direwolf";
  version = "1.7";

  src = fetchFromGitHub {
    owner = "wb2osz";
    repo = "direwolf";
    rev = version;
    tag = finalAttrs.version;
    hash = "sha256-Vbxc6a6CK+wrBfs15dtjfRa1LJDKKyHMrg8tqsF7EX4=";
  };

@@ -57,6 +60,7 @@ stdenv.mkDerivation rec {
      perl
      espeak
    ];
  nativeInstallCheckInputs = [ versionCheckHook ];

  preConfigure = lib.optionals (!extraScripts) ''
    echo "" > scripts/CMakeLists.txt
@@ -64,35 +68,39 @@ stdenv.mkDerivation rec {

  postPatch = ''
    substituteInPlace conf/CMakeLists.txt \
      --replace /etc/udev/rules.d/ $out/lib/udev/rules.d/
      --replace-fail /etc/udev/rules.d/ $out/lib/udev/rules.d/
    substituteInPlace src/symbols.c \
      --replace /usr/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt \
      --replace /opt/local/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt
      --replace-fail /usr/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt \
      --replace-fail /opt/local/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt
    substituteInPlace src/decode_aprs.c \
      --replace /usr/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt \
      --replace /opt/local/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt
      --replace-fail /usr/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt \
      --replace-fail /opt/local/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt
    substituteInPlace cmake/cpack/direwolf.desktop.in \
      --replace 'Terminal=false' 'Terminal=true' \
      --replace 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf'
    substituteInPlace src/dwgpsd.c \
      --replace 'GPSD_API_MAJOR_VERSION > 11' 'GPSD_API_MAJOR_VERSION > 14'
      --replace-fail 'Terminal=false' 'Terminal=true' \
      --replace-fail 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf'
  ''
  + lib.optionalString extraScripts ''
    patchShebangs scripts/dwespeak.sh
    substituteInPlace scripts/dwespeak.sh \
      --replace espeak ${espeak}/bin/espeak
      --replace-fail espeak ${espeak}/bin/espeak
  '';

  doInstallCheck = true;

  meta = with lib; {
  versionCheckProgramArg = [ "-u" ];

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Soundcard Packet TNC, APRS Digipeater, IGate, APRStt gateway";
    homepage = "https://github.com/wb2osz/direwolf/";
    license = licenses.gpl2;
    platforms = platforms.unix;
    maintainers = with maintainers; [
    mainProgram = "direwolf";
    license = lib.licenses.gpl2;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [
      lasandell
      sarcasticadmin
      pandapip1
    ];
  };
}
})
+0 −4
Original line number Diff line number Diff line
@@ -10959,10 +10959,6 @@ with pkgs;

  dfasma = libsForQt5.callPackage ../applications/audio/dfasma { };

  direwolf = callPackage ../applications/radio/direwolf {
    hamlib = hamlib_4;
  };

  djv = callPackage ../by-name/dj/djv/package.nix { openexr = openexr_2; };

  djview4 = djview;