nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv
2, fetchurl
3, pkg-config
4, meson
5, ninja
6, udev
7, glib
8, gnome
9, vala
10, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform)
11, gobject-introspection
12}:
13
14stdenv.mkDerivation rec {
15 pname = "libgudev";
16 version = "237";
17
18 outputs = [ "out" "dev" ];
19
20 src = fetchurl {
21 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
22 sha256 = "1al6nr492nzbm8ql02xhzwci2kwb1advnkaky3j9636jf08v41hd";
23 };
24
25 strictDeps = true;
26
27 depsBuildBuild = [ pkg-config ];
28
29 nativeBuildInputs = [
30 pkg-config
31 meson
32 ninja
33 vala
34 glib # for glib-mkenums needed during the build
35 ] ++ lib.optionals withIntrospection [
36 gobject-introspection
37 ];
38
39 buildInputs = [
40 udev
41 glib
42 ];
43
44 mesonFlags = [
45 # There's a dependency cycle with umockdev and the tests fail to LD_PRELOAD anyway
46 "-Dtests=disabled"
47 "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
48 ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
49 "-Dvapi=disabled"
50 ];
51
52 passthru = {
53 updateScript = gnome.updateScript {
54 packageName = pname;
55 versionPolicy = "none";
56 };
57 };
58
59 meta = with lib; {
60 description = "A library that provides GObject bindings for libudev";
61 homepage = "https://wiki.gnome.org/Projects/libgudev";
62 maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
63 platforms = platforms.linux;
64 license = licenses.lgpl2Plus;
65 };
66}