6 , gobject-introspection
22 stdenv.mkDerivation (finalAttrs: {
26 outputs = [ "bin" "out" "dev" "devdoc" ];
29 url = "https://github.com/martinpitt/umockdev/releases/download/${finalAttrs.version}/umockdev-${finalAttrs.version}.tar.xz";
30 hash = "sha256-EVMG8Xvnj4yZ4gZS4t7M3UjfOHNr8A609D/vw4CaMZw=";
34 # Hardcode absolute paths to libraries so that consumers
35 # do not need to set LD_LIBRARY_PATH themselves.
36 ./hardcode-paths.patch
38 # Replace references to udevadm with an absolute paths, so programs using
39 # umockdev will just work without having to provide it in their test environment
42 src = ./substitute-udevadm.patch;
43 udevadm = "${systemdMinimal}/bin/udevadm";
55 ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
65 checkInputs = lib.optionals finalAttrs.passthru.withGudev [
84 # Substitute the path to this derivation in the patch we apply.
85 substituteInPlace src/umockdev-wrapper \
86 --subst-var-by 'LIBDIR' "''${!outputLib}/lib"
90 # Our patch makes the path to the `LD_PRELOAD`ed library absolute.
91 # When running tests, the library is not yet installed, though,
92 # so we need to replace the absolute path with a local one during build.
93 # We are using a symlink that will be overridden during installation.
95 ln -s "$PWD/libumockdev-preload.so.0" "$out/lib/libumockdev-preload.so.0"
99 # libgudev is needed for an optional test but it itself relies on umockdev for testing.
103 withGudev = finalAttrs.finalPackage.overrideAttrs (attrs: {
104 passthru = attrs.passthru // {
112 homepage = "https://github.com/martinpitt/umockdev";
113 changelog = "https://github.com/martinpitt/umockdev/releases/tag/${finalAttrs.version}";
114 description = "Mock hardware devices for creating unit tests";
115 license = licenses.lgpl21Plus;
116 maintainers = with maintainers; [ flokli ];
117 platforms = with platforms; linux;