nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 gobject-introspection,
6 makeWrapper,
7 wrapGAppsHook3,
8 gtk3,
9 gst_all_1,
10 python3,
11 gettext,
12 adwaita-icon-theme,
13 help2man,
14 keybinder3,
15 libnotify,
16 librsvg,
17 streamripper,
18 udisks,
19 webkitgtk_4_1,
20 iconTheme ? adwaita-icon-theme,
21 deviceDetectionSupport ? true,
22 documentationSupport ? true,
23 notificationSupport ? true,
24 scalableIconSupport ? true,
25 translationSupport ? true,
26 ipythonSupport ? false,
27 cdMetadataSupport ? false,
28 lastfmSupport ? false,
29 lyricsManiaSupport ? false,
30 multimediaKeySupport ? false,
31 musicBrainzSupport ? false,
32 podcastSupport ? false,
33 streamripperSupport ? false,
34 wikipediaSupport ? false,
35}:
36
37stdenv.mkDerivation (finalAttrs: {
38 pname = "exaile";
39 version = "4.2.1";
40
41 src = fetchFromGitHub {
42 owner = "exaile";
43 repo = "exaile";
44 rev = finalAttrs.version;
45 sha256 = "sha256-eH7JhoGd5jiaye8ZLx836tgEXsRpEd3D3z6gvnVrbIs=";
46 };
47
48 nativeBuildInputs = [
49 gobject-introspection
50 makeWrapper
51 wrapGAppsHook3
52 ]
53 ++ lib.optionals documentationSupport [
54 help2man
55 python3.pkgs.sphinx
56 python3.pkgs.sphinx-rtd-theme
57 ]
58 ++ lib.optional translationSupport gettext;
59
60 buildInputs = [
61 iconTheme
62 gtk3
63 ]
64 ++ (with gst_all_1; [
65 gstreamer
66 gst-plugins-base
67 gst-plugins-good
68 gst-plugins-bad
69 gst-plugins-ugly
70 gst-libav
71 ])
72 ++ (with python3.pkgs; [
73 berkeleydb
74 dbus-python
75 mutagen
76 pygobject3
77 pycairo
78 gst-python
79 ])
80 ++ lib.optional deviceDetectionSupport udisks
81 ++ lib.optional notificationSupport libnotify
82 ++ lib.optional scalableIconSupport librsvg
83 ++ lib.optional ipythonSupport python3.pkgs.ipython
84 ++ lib.optional cdMetadataSupport python3.pkgs.discid
85 ++ lib.optional lastfmSupport python3.pkgs.pylast
86 ++ lib.optional lyricsManiaSupport python3.pkgs.lxml
87 ++ lib.optional multimediaKeySupport keybinder3
88 ++ lib.optional (musicBrainzSupport || cdMetadataSupport) python3.pkgs.musicbrainzngs
89 ++ lib.optional podcastSupport python3.pkgs.feedparser
90 ++ lib.optional wikipediaSupport webkitgtk_4_1;
91
92 nativeCheckInputs = with python3.pkgs; [
93 pytest
94 ];
95
96 makeFlags = [
97 "PREFIX=${placeholder "out"}"
98 ];
99
100 doCheck = true;
101 preCheck = ''
102 substituteInPlace Makefile --replace "PYTHONPATH=$(shell pwd)" "PYTHONPATH=$PYTHONPATH:$(shell pwd)"
103 export PYTEST="py.test"
104 export XDG_CACHE_HOME=$(mktemp -d)
105 '';
106
107 postInstall = ''
108 wrapProgram $out/bin/exaile \
109 --set PYTHONPATH $PYTHONPATH \
110 --prefix PATH : ${
111 lib.makeBinPath ([ python3 ] ++ lib.optionals streamripperSupport [ streamripper ])
112 }
113 '';
114
115 meta = {
116 homepage = "https://www.exaile.org/";
117 description = "Music player with a simple interface and powerful music management capabilities";
118 mainProgram = "exaile";
119 license = lib.licenses.gpl2Only;
120 maintainers = with lib.maintainers; [ ryneeverett ];
121 platforms = lib.platforms.all;
122 };
123})