biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / audio / osdlyrics / default.nix
blobd0f12a59125dab6570dfc79073a9340aaf5f1d3f
1 { lib
2 , stdenv
3 , fetchFromGitHub
5 , autoreconfHook
6 , pkg-config
7 , intltool
9 , glib
10 , gtk2
11 , dbus-glib
12 , libappindicator-gtk2
13 , libnotify
14 , python3
15 , runtimeShell
18 stdenv.mkDerivation rec {
19   pname = "osdlyrics";
20   version = "0.5.15";
22   src = fetchFromGitHub {
23     owner = "osdlyrics";
24     repo = "osdlyrics";
25     rev = version;
26     hash = "sha256-4jEF1LdMwaLNF6zvzAuGW8Iu4dzhrFLutX69LwSjTAI=";
27   };
29   nativeBuildInputs = [
30     autoreconfHook
31     pkg-config
32     intltool
33   ];
35   buildInputs = [
36     glib
37     gtk2
38     dbus-glib
39     libappindicator-gtk2
40     libnotify
41     python3.pkgs.wrapPython
42     (python3.withPackages (pp: with pp; [
43       chardet
44       dbus-python
45       pycurl
46       pygobject3
47     ]))
48   ];
50   postFixup = ''
51     extractExecLine() {
52       serviceFile=$1
53       program=$2
55       execLine=$(grep --only-matching --perl-regexp 'Exec=\K(.+)' "$serviceFile")
56       echo "#!${runtimeShell}" > "$program"
57       echo "exec $execLine" >> "$program"
58       chmod +x "$program"
60       substituteInPlace "$serviceFile" \
61         --replace "Exec=$execLine" "Exec=$program"
62     }
64     # Extract the exec line into a separate program so that it can be wrapped.
65     mkdir -p "$out/libexec/osdlyrics/"
66     for svcFile in "$out/share/dbus-1/services"/*; do
67       svc=$(basename "$svcFile" ".service")
68       if grep "python" "$svcFile"; then
69         extractExecLine "$svcFile" "$out/libexec/osdlyrics/$svc"
70       fi
71     done
73     for p in "$out/bin/osdlyrics-create-lyricsource" "$out/bin/osdlyrics-daemon" "$out/libexec/osdlyrics"/*; do
74       wrapProgram "$p" \
75         --prefix PYTHONPATH : "$out/${python3.sitePackages}"
76     done
77   '';
79   meta = with lib; {
80     description = "Standalone lyrics fetcher/displayer";
81     homepage = "https://github.com/osdlyrics/osdlyrics";
82     license = licenses.gpl3Plus;
83     maintainers = with maintainers; [ pedrohlc ];
84     platforms = platforms.linux;
85   };