2023-08-04 22:07:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2021-05-20 23:08:51 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2020-04-24 23:36:52 +00:00
|
|
|
, udev
|
|
|
|
, glib
|
2021-05-20 23:08:51 +00:00
|
|
|
, gnome
|
|
|
|
, vala
|
2021-12-06 16:07:01 +00:00
|
|
|
, gobject-introspection
|
2023-08-04 22:07:22 +00:00
|
|
|
, glibcLocales
|
|
|
|
, umockdev
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libgudev";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "238";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
2023-08-04 22:07:22 +00:00
|
|
|
url = "mirror://gnome/sources/libgudev/${lib.versions.majorMinor finalAttrs.version}/libgudev-${finalAttrs.version}.tar.xz";
|
|
|
|
hash = "sha256-YSZqsa/J1z28YKiyr3PpnS/f9H2ZVE0IV2Dk+mZ7XdE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
patches = [
|
|
|
|
# Conditionally disable one test that requires a locale implementation
|
|
|
|
# https://gitlab.gnome.org/GNOME/libgudev/-/merge_requests/31
|
|
|
|
./tests-skip-double-test-on-stub-locale-impls.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = lib.optionalString finalAttrs.finalPackage.doCheck ''
|
|
|
|
# The relative location of LD_PRELOAD works for Glibc but not for other loaders (e.g. pkgsMusl)
|
|
|
|
substituteInPlace tests/meson.build \
|
|
|
|
--replace "LD_PRELOAD=libumockdev-preload.so.0" "LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0"
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
vala
|
2021-12-06 16:07:01 +00:00
|
|
|
glib # for glib-mkenums needed during the build
|
|
|
|
gobject-introspection
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [
|
|
|
|
udev
|
|
|
|
glib
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
checkInputs = [
|
|
|
|
glibcLocales
|
|
|
|
umockdev
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
doCheck = true;
|
|
|
|
mesonFlags = lib.optional (!finalAttrs.finalPackage.doCheck) "-Dtests=disabled";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru = {
|
2021-05-20 23:08:51 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2023-08-04 22:07:22 +00:00
|
|
|
packageName = "libgudev";
|
2020-04-24 23:36:52 +00:00
|
|
|
versionPolicy = "none";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library that provides GObject bindings for libudev";
|
|
|
|
homepage = "https://wiki.gnome.org/Projects/libgudev";
|
|
|
|
maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
})
|