Files
nixpkgs/pkgs/by-name/di/direvent/package.nix
Palmer Cox 2993c6d9a3 direvent: Fix on Darwin
There are two issues:

The first problem is that there is an implicit definition of a function
which is by default an error with the compiler that is used on Darwin.

There is an upstream submitted patch
(https://puszcza.gnu.org.ua/bugs/?256) to fix this issue, but its from
2015 and thus doesn't seem likely to be applied anytime soon. Since its
just a comment, we can't retrieve it with fetchpatch or similar. The
patch is very simple and so we can vendor it here.

The second problem is that the 5.5 release of direvent uses
clock_nanosleep which is only available on Linux. There is an upstream
fix for that issue which is in git but not a released version - so, we
can pick that up. Unfortunately, it appears that we have to vendor this
patch since attempts to use fetchpatch to get it from the source
(https://git.gnu.org.ua/direvent.git/patch/?id=f6042ca2e240a27a20e405de49755f350ca95e7b)
failed due to bot protection functionality on that site.
2026-08-13 15:15:49 -04:00

37 lines
893 B
Nix

{
lib,
stdenv,
fetchurl,
autoreconfHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "direvent";
version = "5.5";
src = fetchurl {
url = "mirror://gnu/direvent/direvent-${finalAttrs.version}.tar.gz";
sha256 = "sha256-DhbAtLPm92c+m08x2BqwEjatIvg1OFEvOy9Y+flv3Lc=";
};
patches = [
./fix-darwin.patch
./use-nonosleep-if-clock-nanosleep-not-available.patch
];
nativeBuildInputs = [
# The nanosleep patch about modifies configure.ac so we use autoreconfHook.
# We should be able to remove this when we drop the nanosleep patch.
autoreconfHook
];
meta = {
description = "Directory event monitoring daemon";
mainProgram = "direvent";
homepage = "https://www.gnu.org.ua/software/direvent/";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ puffnfresh ];
};
})