about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/upower/default.nix
blob: 14458356a790b8359d9f51d9330836d00d5c46fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ stdenv
, fetchurl
, pkgconfig
, dbus-glib
, intltool
, libxslt
, docbook_xsl
, udev
, libgudev
, libusb1
, gobject-introspection
, useSystemd ? true, systemd
}:

stdenv.mkDerivation rec {
  pname = "upower";
  version = "0.99.10";

  src = fetchurl {
    url = https://gitlab.freedesktop.org/upower/upower/uploads/c438511024b9bc5a904f8775cfc8e4c4/upower-0.99.10.tar.xz;
    sha256 = "17d2bclv5fgma2y3g8bsn9pdvspn1zrzismzdnzfivc0f2wm28k4";
  };

  nativeBuildInputs = [
    pkgconfig
  ];

  buildInputs = [
    dbus-glib
    intltool
    libxslt
    docbook_xsl
    udev
    libgudev
    libusb1
    gobject-introspection
  ]
  ++ stdenv.lib.optional useSystemd systemd
  ;

  configureFlags = [
    "--with-backend=linux"
    "--localstatedir=/var"
  ]
  ++ stdenv.lib.optional useSystemd [
    "--with-systemdsystemunitdir=${placeholder ''out''}/etc/systemd/system"
    "--with-systemdutildir=${placeholder ''out''}/lib/systemd"
    "--with-udevrulesdir=${placeholder ''out''}/lib/udev/rules.d"
  ]
  ;

  doCheck = false; # fails with "env: './linux/integration-test': No such file or directory"

  installFlags = [
    "historydir=$(TMPDIR)/foo"
  ];

  meta = with stdenv.lib; {
    homepage = https://upower.freedesktop.org/;
    description = "A D-Bus service for power management";
    platforms = platforms.linux;
    license = licenses.gpl2Plus;
  };
}