summary refs log tree commit diff
path: root/pkgs/os-specific/linux/upower/default.nix
blob: 08bebefed136dc32192ba6816fe907593f010bec (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
65
66
67
68
69
70
71
{ lib, stdenv
, fetchurl
, pkg-config
, libxslt
, docbook_xsl
, udev
, libgudev
, libusb1
, glib
, gobject-introspection
, gettext
, systemd
, useIMobileDevice ? true
, libimobiledevice
}:

stdenv.mkDerivation {
  pname = "upower";
  version = "0.99.11";

  outputs = [ "out" "dev" ];

  src = fetchurl {
    url = "https://gitlab.freedesktop.org/upower/upower/uploads/93cfe7c8d66ed486001c4f3f55399b7a/upower-0.99.11.tar.xz";
    sha256 = "1vxxvmz2cxb1qy6ibszaz5bskqdy9nd9fxspj9fv3gfmrjzzzdb4";
  };

  nativeBuildInputs = [
    docbook_xsl
    gettext
    gobject-introspection
    libxslt
    pkg-config
  ];

  buildInputs = [
    libgudev
    libusb1
    udev
    systemd
  ]
  ++ lib.optional useIMobileDevice libimobiledevice
  ;

  propagatedBuildInputs = [
    glib
  ];

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

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

  installFlags = [
    "historydir=$(TMPDIR)/foo"
    "sysconfdir=${placeholder "out"}/etc"
  ];

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