14 gobject-introspection,
17 lib.meta.availableOn stdenv.hostPlatform gobject-introspection
18 && stdenv.hostPlatform.emulatorAvailable buildPackages,
21 stdenv.mkDerivation (finalAttrs: {
31 url = "mirror://gnome/sources/libgudev/${lib.versions.majorMinor finalAttrs.version}/libgudev-${finalAttrs.version}.tar.xz";
32 hash = "sha256-YSZqsa/J1z28YKiyr3PpnS/f9H2ZVE0IV2Dk+mZ7XdE=";
36 # Conditionally disable one test that requires a locale implementation
37 # https://gitlab.gnome.org/GNOME/libgudev/-/merge_requests/31
38 ./tests-skip-double-test-on-stub-locale-impls.patch
41 postPatch = lib.optionalString finalAttrs.finalPackage.doCheck ''
42 # The relative location of LD_PRELOAD works for Glibc but not for other loaders (e.g. pkgsMusl)
43 substituteInPlace tests/meson.build \
44 --replace "LD_PRELOAD=libumockdev-preload.so.0" "LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0"
54 glib # for glib-mkenums needed during the build
56 ++ lib.optionals withIntrospection [
71 doCheck = withIntrospection;
73 (lib.mesonEnable "introspection" withIntrospection)
74 (lib.mesonEnable "vapi" withIntrospection)
75 (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck)
79 updateScript = gnome.updateScript {
80 packageName = "libgudev";
81 versionPolicy = "none";
86 description = "Library that provides GObject bindings for libudev";
87 homepage = "https://gitlab.gnome.org/GNOME/libgudev";
88 maintainers = teams.gnome.members;
89 platforms = platforms.linux;
90 license = licenses.lgpl2Plus;