nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 gexiv2,
6 gobject-introspection,
7 gtk3,
8 hicolor-icon-theme,
9 intltool,
10 libnotify,
11 librsvg,
12 runtimeShell,
13 wrapGAppsHook3,
14 fehSupport ? false,
15 feh,
16 imagemagickSupport ? true,
17 imagemagick,
18 appindicatorSupport ? true,
19 libayatana-appindicator,
20 bash,
21}:
22
23python3Packages.buildPythonApplication rec {
24 pname = "variety";
25 version = "0.8.13";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "varietywalls";
30 repo = "variety";
31 tag = version;
32 hash = "sha256-7CTJ3hWddbOX/UfZ1qX9rPNGTfkxQ4pxu23sq9ulgv4=";
33 };
34
35 nativeBuildInputs = [
36 intltool
37 wrapGAppsHook3
38 gobject-introspection
39 ];
40
41 buildInputs = [
42 gexiv2
43 gtk3
44 hicolor-icon-theme
45 libnotify
46 librsvg
47 ]
48 ++ lib.optional appindicatorSupport libayatana-appindicator;
49
50 build-system = with python3Packages; [ setuptools ];
51
52 dependencies =
53 with python3Packages;
54 [
55 beautifulsoup4
56 configobj
57 dbus-python
58 distutils-extra
59 httplib2
60 lxml
61 pillow
62 pycairo
63 pygobject3
64 requests
65 setuptools
66 ]
67 ++ lib.optional fehSupport feh
68 ++ lib.optional imagemagickSupport imagemagick;
69
70 doCheck = false;
71
72 # Prevent double wrapping, let the Python wrapper use the args in preFixup.
73 dontWrapGApps = true;
74
75 preFixup = ''
76 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
77 '';
78
79 prePatch = ''
80 substituteInPlace variety_lib/varietyconfig.py \
81 --replace-fail "__variety_data_directory__ = \"../data\"" \
82 "__variety_data_directory__ = \"$out/share/variety\""
83 substituteInPlace variety/VarietyWindow.py \
84 --replace-fail '[script,' '["${runtimeShell}", script,' \
85 --replace-fail 'check_output(script)' 'check_output(["${runtimeShell}", script])'
86 substituteInPlace data/variety-autostart.desktop.template \
87 --replace-fail "/bin/bash" "${lib.getExe bash}" \
88 --replace-fail "{VARIETY_PATH}" "variety"
89 '';
90
91 pythonImportsCheck = [ "variety" ];
92
93 meta = {
94 homepage = "https://github.com/varietywalls/variety";
95 description = "Wallpaper manager for Linux systems";
96 mainProgram = "variety";
97 longDescription = ''
98 Variety is a wallpaper manager for Linux systems. It supports numerous
99 desktops and wallpaper sources, including local files and online services:
100 Flickr, Wallhaven, Unsplash, and more.
101
102 Where supported, Variety sits as a tray icon to allow easy pausing and
103 resuming. Otherwise, its desktop entry menu provides a similar set of
104 options.
105
106 Variety also includes a range of image effects, such as oil painting and
107 blur, as well as options to layer quotes and a clock onto the background.
108 '';
109 license = lib.licenses.gpl3Plus;
110 maintainers = with lib.maintainers; [
111 p3psi
112 zfnmxt
113 ];
114 };
115}