Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 15 additions & 31 deletions pkgs/development/libraries/libgudev/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib, stdenv
{ stdenv
, lib
, fetchurl
, pkg-config
, meson
Expand All @@ -9,42 +10,23 @@
, vala
, gobject-introspection
, fetchpatch
, glibcLocales
, umockdev
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "libgudev";
version = "237";
version = "238";

outputs = [ "out" "dev" ];

src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1al6nr492nzbm8ql02xhzwci2kwb1advnkaky3j9636jf08v41hd";
url = "mirror://gnome/sources/libgudev/${lib.versions.majorMinor finalAttrs.version}/libgudev-${finalAttrs.version}.tar.xz";
hash = "sha256-YSZqsa/J1z28YKiyr3PpnS/f9H2ZVE0IV2Dk+mZ7XdE=";
};

patches = [
# https://gitlab.gnome.org/GNOME/libgudev/-/merge_requests/27
(fetchpatch {
name = "gir-dep";
url = "https://gitlab.gnome.org/GNOME/libgudev/-/commit/6bdde16a0cfde462502fce1d9a7eb6ec33f388bb.diff";
sha256 = "sha256-bDtLUxOLEgyJURshqEQC4YCBTUVzQQP4qoWL786b3Z8=";
})
(fetchpatch {
name = "vapi-dep";
url = "https://gitlab.gnome.org/GNOME/libgudev/-/commit/d1f6457910842ba869c9871e7a2131fbe0d6b6be.diff";
sha256 = "sha256-/PY8ziZST/vQvksJm69a3O6/YesknIxCDvj0z40piik=";
})
(fetchpatch {
name = "gtk-doc-dep";
url = "https://gitlab.gnome.org/GNOME/libgudev/-/commit/34336cbadbcaac8b9b029f730eed0bdf4c633617.diff";
sha256 = "sha256-Bk05xe69LGqWH1uhLMZhwbVMSsCTyBrrOvqWic2TTd4=";
})
];

strictDeps = true;

depsBuildBuild = [ pkg-config ];

nativeBuildInputs = [
pkg-config
meson
Expand All @@ -59,14 +41,16 @@ stdenv.mkDerivation rec {
glib
];

mesonFlags = [
# There's a dependency cycle with umockdev and the tests fail to LD_PRELOAD anyway
"-Dtests=disabled"
checkInputs = [
glibcLocales
umockdev
];

doCheck = true;

passthru = {
updateScript = gnome.updateScript {
packageName = pname;
packageName = "libgudev";
versionPolicy = "none";
};
};
Expand All @@ -78,4 +62,4 @@ stdenv.mkDerivation rec {
platforms = platforms.linux;
license = licenses.lgpl2Plus;
};
}
})
26 changes: 21 additions & 5 deletions pkgs/development/libraries/umockdev/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
, which
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "umockdev";
version = "0.17.17";

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

src = fetchurl {
url = "https://github.com/martinpitt/umockdev/releases/download/${version}/${pname}-${version}.tar.xz";
url = "https://github.com/martinpitt/umockdev/releases/download/${finalAttrs.version}/umockdev-${finalAttrs.version}.tar.xz";
sha256 = "sha256-IOYhseRYsyADz+qZc5tngkuGZShUqLzjPiYSTjR/32w=";
};

Expand All @@ -50,10 +50,13 @@ stdenv.mkDerivation rec {
buildInputs = [
glib
systemd
libgudev
libpcap
];

checkInputs = lib.optionals finalAttrs.passthru.withGudev [
libgudev
];

nativeCheckInputs = [
python3
which
Expand Down Expand Up @@ -81,12 +84,25 @@ stdenv.mkDerivation rec {
ln -s "$PWD/libumockdev-preload.so.0" "$out/lib/libumockdev-preload.so.0"
'';

passthru = {
# libgudev is needed for an optional test but it itself relies on umockdev for testing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooh, interesting bootstrapping problem :-D But LGTM 👍

withGudev = false;

tests = {
withGudev = finalAttrs.finalPackage.overrideAttrs (attrs: {
passthru = attrs.passthru // {
withGudev = true;
};
});
};
};

meta = with lib; {
homepage = "https://github.com/martinpitt/umockdev";
changelog = "https://github.com/martinpitt/umockdev/releases/tag/${version}";
changelog = "https://github.com/martinpitt/umockdev/releases/tag/${finalAttrs.version}";
description = "Mock hardware devices for creating unit tests";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ flokli ];
platforms = with platforms; linux;
};
}
})