1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 autoreconfHook,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "libinotify-kqueue";
11 version = "20240724";
12
13 src = fetchFromGitHub {
14 owner = "libinotify-kqueue";
15 repo = "libinotify-kqueue";
16 rev = version;
17 sha256 = "sha256-m59GWrx5C+JXDbhVdKx+SNSn8wwIKyW+KlXabNi17A0=";
18 };
19
20 patches = [
21 # https://github.com/libinotify-kqueue/libinotify-kqueue/pull/23
22 (fetchpatch {
23 name = "add-configure-caching.patch";
24 url = "https://github.com/libinotify-kqueue/libinotify-kqueue/commit/81a8f05c1ce6df819dc898f3754c9c874ee24b10.patch";
25 hash = "sha256-imKS2DuQrHSMnJH1gOYrVSeWTe2nhcl8Gm9IX5B9ZqI=";
26 })
27 ];
28
29 nativeBuildInputs = [ autoreconfHook ];
30
31 configureFlags =
32 lib.optionals (with stdenv; buildPlatform != hostPlatform && hostPlatform.isFreeBSD)
33 [
34 "ik_cv_have_note_extend_in=yes"
35 "ik_cv_have_note_extend_out=yes"
36 "ik_cv_have_o_path=yes"
37 "ik_cv_have_o_empty_path=yes"
38 "ik_cv_have_at_empty_path=yes"
39 ];
40
41 checkFlags = [ "test" ];
42
43 meta = with lib; {
44 description = "Inotify shim for macOS and BSD";
45 homepage = "https://github.com/libinotify-kqueue/libinotify-kqueue";
46 license = licenses.mit;
47 maintainers = [ ];
48 platforms = with platforms; darwin ++ freebsd ++ netbsd ++ openbsd;
49 };
50}