1{
2 lib,
3 fetchFromGitHub,
4 gitUpdater,
5 adwaita-icon-theme,
6 gobject-introspection,
7 gtk3,
8 intltool,
9 python3Packages,
10 wrapGAppsHook3,
11 xdg-utils,
12}:
13
14python3Packages.buildPythonApplication rec {
15 pname = "gpodder";
16 version = "3.11.5";
17 format = "other";
18
19 src = fetchFromGitHub {
20 owner = "gpodder";
21 repo = "gpodder";
22 rev = version;
23 hash = "sha256-Hhk9JeHMg+FrekiNXP6Q8loCtst+FHT4EJTnh64VOhc=";
24 };
25
26 patches = [
27 ./disable-autoupdate.patch
28 ];
29
30 postPatch = ''
31 sed -i -re 's,^( *gpodder_dir *= *).*,\1"'"$out"'",' bin/gpodder
32 '';
33
34 build-system = with python3Packages; [
35 setuptools
36 build
37 installer
38 wheel
39 ];
40
41 nativeBuildInputs = [
42 intltool
43 wrapGAppsHook3
44 gobject-introspection
45 python3Packages.distutils
46 ];
47
48 buildInputs = [
49 gtk3
50 adwaita-icon-theme
51 ];
52
53 nativeCheckInputs = with python3Packages; [
54 minimock
55 pytest
56 pytest-httpserver
57 pytest-cov-stub
58 ];
59
60 doCheck = true;
61
62 propagatedBuildInputs = with python3Packages; [
63 feedparser
64 dbus-python
65 mygpoclient
66 requests
67 pygobject3
68 eyed3
69 podcastparser
70 html5lib
71 mutagen
72 yt-dlp # for use by gpodder's builtin "youtube-dl" extension
73 ];
74
75 makeFlags = [
76 "PREFIX=$(out)"
77 "share/applications/gpodder-url-handler.desktop"
78 "share/applications/gpodder.desktop"
79 "share/dbus-1/services/org.gpodder.service"
80 ];
81
82 installCheckPhase = ''
83 LC_ALL=C PYTHONPATH=src/:$PYTHONPATH pytest --ignore=tests --ignore=src/gpodder/utilwin32ctypes.py --doctest-modules src/gpodder/util.py src/gpodder/jsonconfig.py
84 LC_ALL=C PYTHONPATH=src/:$PYTHONPATH pytest tests --ignore=src/gpodder/utilwin32ctypes.py --ignore=src/mygpoclient --cov=gpodder
85 '';
86
87 makeWrapperArgs = [ "--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}" ];
88
89 passthru.updateScript = gitUpdater { };
90
91 meta = with lib; {
92 description = "Podcatcher written in python";
93 longDescription = ''
94 gPodder downloads and manages free audio and video content (podcasts)
95 for you. Listen directly on your computer or on your mobile devices.
96 '';
97 homepage = "http://gpodder.org/";
98 license = licenses.gpl3;
99 platforms = platforms.linux ++ platforms.darwin;
100 maintainers = with maintainers; [ mic92 ];
101 };
102}