13 , gobject-introspection
15 , withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
18 stdenv.mkDerivation (finalAttrs: {
22 outputs = [ "out" "dev" ];
25 url = "mirror://gnome/sources/libgudev/${lib.versions.majorMinor finalAttrs.version}/libgudev-${finalAttrs.version}.tar.xz";
26 hash = "sha256-YSZqsa/J1z28YKiyr3PpnS/f9H2ZVE0IV2Dk+mZ7XdE=";
30 # Conditionally disable one test that requires a locale implementation
31 # https://gitlab.gnome.org/GNOME/libgudev/-/merge_requests/31
32 ./tests-skip-double-test-on-stub-locale-impls.patch
35 postPatch = lib.optionalString finalAttrs.finalPackage.doCheck ''
36 # The relative location of LD_PRELOAD works for Glibc but not for other loaders (e.g. pkgsMusl)
37 substituteInPlace tests/meson.build \
38 --replace "LD_PRELOAD=libumockdev-preload.so.0" "LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0"
47 glib # for glib-mkenums needed during the build
48 ] ++ lib.optionals withIntrospection [
63 doCheck = withIntrospection;
65 (lib.mesonEnable "introspection" withIntrospection)
66 (lib.mesonEnable "vapi" withIntrospection)
67 (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck)
71 updateScript = gnome.updateScript {
72 packageName = "libgudev";
73 versionPolicy = "none";
78 description = "Library that provides GObject bindings for libudev";
79 homepage = "https://gitlab.gnome.org/GNOME/libgudev";
80 maintainers = teams.gnome.members;
81 platforms = platforms.linux;
82 license = licenses.lgpl2Plus;