nixpkgs/pkgs/by-name/gp/gpodder/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

99 lines
2.1 KiB
Nix

{ lib
, fetchFromGitHub
, gitUpdater
, glibcLocales
, adwaita-icon-theme
, gobject-introspection
, gtk3
, intltool
, python311Packages
, wrapGAppsHook3
, xdg-utils
}:
python311Packages.buildPythonApplication rec {
pname = "gpodder";
version = "3.11.4";
format = "other";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "kEhyV1o8VSQW9qMx6m5avj6LnJuVTONDd6msRuc8t/4=";
};
patches = [
./disable-autoupdate.patch
];
postPatch = ''
sed -i -re 's,^( *gpodder_dir *= *).*,\1"'"$out"'",' bin/gpodder
'';
nativeBuildInputs = [
intltool
wrapGAppsHook3
glibcLocales
gobject-introspection
];
buildInputs = [
gtk3
adwaita-icon-theme
];
nativeCheckInputs = with python311Packages; [
minimock
pytest
pytest-httpserver
pytest-cov-stub
];
doCheck = true;
propagatedBuildInputs = with python311Packages; [
feedparser
dbus-python
mygpoclient
requests
pygobject3
eyed3
podcastparser
html5lib
mutagen
];
makeFlags = [
"PREFIX=$(out)"
"share/applications/gpodder-url-handler.desktop"
"share/applications/gpodder.desktop"
"share/dbus-1/services/org.gpodder.service"
];
preBuild = ''
export LC_ALL="en_US.UTF-8"
'';
installCheckPhase = ''
LC_ALL=C PYTHONPATH=src/:$PYTHONPATH pytest --ignore=tests --ignore=src/gpodder/utilwin32ctypes.py --doctest-modules src/gpodder/util.py src/gpodder/jsonconfig.py
LC_ALL=C PYTHONPATH=src/:$PYTHONPATH pytest tests --ignore=src/gpodder/utilwin32ctypes.py --ignore=src/mygpoclient --cov=gpodder
'';
makeWrapperArgs = [ "--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}" ];
passthru.updateScript = gitUpdater {};
meta = with lib; {
description = "Podcatcher written in python";
longDescription = ''
gPodder downloads and manages free audio and video content (podcasts)
for you. Listen directly on your computer or on your mobile devices.
'';
homepage = "http://gpodder.org/";
license = licenses.gpl3;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ mic92 ];
};
}