python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / audio / headset-charge-indicator / default.nix
blobf771fd47a7584f0ba61de7a3432a9780af139f53
1 { lib, stdenv, fetchFromGitHub, headsetcontrol, wrapGAppsHook, python3, gtk3
2 , gobject-introspection, libayatana-appindicator }:
4 stdenv.mkDerivation rec {
5   # The last versioned release is 1.0.0.0 from 2020, since then there were updates but no versioned release.
6   # This is not marked unstable because upstream encourages installation from source.
7   pname = "headset-charge-indicator";
8   version = "2021-08-15";
10   src = fetchFromGitHub {
11     owner = "centic9";
12     repo = "headset-charge-indicator";
13     rev = "6e20f81a4d6118c7385b831044c468af83103193";
14     sha256 = "sha256-eaAbqeFY+B3CcKJywC3vaRsWZNQENTbALc7L7uW0W6U=";
15   };
17   nativeBuildInputs = [ wrapGAppsHook ];
19   buildInputs = [
20     (python3.withPackages (ps: with ps; [ pygobject3 ]))
21     headsetcontrol
22     gtk3
23     gobject-introspection
24     libayatana-appindicator
25   ];
27   installPhase = ''
28     mkdir -p $out/bin
29     cp $src/headset-charge-indicator.py $out/bin/headset-charge-indicator.py
30     chmod +x $out/bin/headset-charge-indicator.py
32     substituteInPlace \
33       $out/bin/headset-charge-indicator.py \
34       --replace "default='headsetcontrol'" "default='${headsetcontrol}/bin/headsetcontrol'"
36     cat << EOF > ${pname}.desktop
37     [Desktop Entry]
38     Name=Wireless headset app-indicator
39     Categories=Application;System
40     Exec=$out/bin/headset-charge-indicator.py
41     Terminal=false
42     Type=Application
43     X-GNOME-AutoRestart=true
44     X-GNOME-Autostart-enabled=true
45     EOF
47     mkdir -p $out/share/applications
48     mkdir -p $out/etc/xdg/autostart
49     cp ${pname}.desktop $out/share/applications/${pname}.desktop
50     cp ${pname}.desktop $out/etc/xdg/autostart/${pname}.desktop
51   '';
53   meta = with lib; {
54     homepage = "https://github.com/centic9/headset-charge-indicator";
55     description =
56       "A app-indicator for GNOME desktops for controlling some features of various wireless headsets";
57     longDescription =
58       "A simple app-indicator for GNOME desktops to display the battery charge of some wireless headsets which also allows to control some functions like LEDs, sidetone and others.";
59     platforms = platforms.linux;
60     maintainers = with maintainers; [ zebreus ];
61     license = licenses.bsd2;
62   };