summary refs log tree commit diff
path: root/pkgs/development/libraries/umockdev/default.nix
blob: 866dc48f270419eed727562a204d7a75c06fa07e (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
{ stdenv, fetchurl, fetchpatch, pkgconfig
, gobject-introspection, glib, systemd, libgudev, vala
, usbutils, which, python3 }:

stdenv.mkDerivation rec {
  name = "umockdev-${version}";
  version = "0.13.1";

  outputs = [ "bin" "out" "dev" "doc" ];

  src = fetchurl {
    url = "https://github.com/martinpitt/umockdev/releases/download/${version}/${name}.tar.xz";
    sha256 = "197a169imiirgm73d9fn9234cx56agyw9d2f47h7f1d8s2d51lla";
  };

  patches = [
    ./fix-test-paths.patch
    # https://github.com/martinpitt/umockdev/pull/93
    (fetchpatch {
      url = "https://github.com/abbradar/umockdev/commit/ce22f893bf50de0b32760238a3e2cfb194db89e9.patch";
      sha256 = "01q3qhs30x8hl23iigimsa2ikbiw8y8y0bpmh02mh1my87shpwnx";
    })
  ];

  # autoreconfHook complains if we try to build the documentation
  postPatch = ''
    echo 'EXTRA_DIST =' > docs/gtk-doc.make
  '';

  preCheck = ''
    patchShebangs tests/test-static-code
  '';

  buildInputs = [ glib systemd libgudev ];

  nativeBuildInputs = [ pkgconfig vala gobject-introspection ];

  checkInputs = [ python3 which usbutils ];

  enableParallelBuilding = true;

  doCheck = true;

  meta = with stdenv.lib; {
    description = "Mock hardware devices for creating unit tests";
    license = licenses.lgpl2;
    maintainers = with maintainers; [ ndowens ];
    platforms = with platforms; linux;
  };
}