nixpkgs/pkgs/applications/audio/pyradio/default.nix
Yaya a98dd90cef pyradio: Disable update check
pyradio checks for new releases every 10 days and offers the user to
self-update:

```console
$ pyradio --update
Released version   :  0.9.3.3
Installed version  :  0.9.3.1
Updating PyRadio...
Using directory: "/tmp/tmp-pyradio"
Downloading PyRadio source code...
  url: "https://github.com/coderholic/pyradio/archive/0.9.3.3.zip"
  filename: "/tmp/tmp-pyradio/pyradio-0.9.3.3.zip"
^CError: Failed to download PyRadio source code..
```

This functionality can be disabled by setting the `distro` configuration
parameter to anything different than `None`. With such patch applied, it
will now refuse to self-update:

```console
$ pyradio --update
PyRadio has been installed using either pip or your distribution's
package manager. Please use that to update it.
```

Co-authored-by: Guilhem Saurel <guilhem.saurel@laas.fr>
2024-05-04 17:13:59 +02:00

54 lines
1.1 KiB
Nix

{ lib
, python3Packages
, fetchFromGitHub
, installShellFiles
}:
python3Packages.buildPythonApplication rec {
pname = "pyradio";
version = "0.9.3.4";
src = fetchFromGitHub {
owner = "coderholic";
repo = "pyradio";
rev = "refs/tags/${version}";
hash = "sha256-QifBzQsvYU5kP5mnidOgWGBh3h2MvJm8Wo0i1v6j/cU=";
};
nativeBuildInputs = [
installShellFiles
];
propagatedBuildInputs = with python3Packages; [
dnspython
netifaces
psutil
python-dateutil
requests
rich
];
postPatch = ''
# Disable update check
substituteInPlace pyradio/config \
--replace-fail "distro = None" "distro = NixOS"
'';
checkPhase = ''
$out/bin/pyradio --help
'';
postInstall = ''
installManPage *.1
'';
meta = with lib; {
homepage = "http://www.coderholic.com/pyradio/";
description = "Curses based internet radio player";
mainProgram = "pyradio";
changelog = "https://github.com/coderholic/pyradio/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ contrun yayayayaka ];
};
}