nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, lua, pkg-config, rsync,
2 asciidoc, libxml2, docbook_xml_dtd_45, docbook_xsl, libxslt, xnu }:
3
4stdenv.mkDerivation rec {
5 pname = "lsyncd";
6 version = "2.3.1";
7
8 src = fetchFromGitHub {
9 owner = "axkibe";
10 repo = "lsyncd";
11 rev = "release-${version}";
12 hash = "sha256-QBmvS1HGF3VWS+5aLgDr9AmUfEsuSz+DTFIeql2XHH4=";
13 };
14
15 postPatch = ''
16 substituteInPlace default-rsync.lua \
17 --replace "/usr/bin/rsync" "${rsync}/bin/rsync"
18 '';
19
20 # Special flags needed on Darwin:
21 # https://github.com/axkibe/lsyncd/blob/42413cabbedca429d55a5378f6e830f191f3cc86/INSTALL#L51
22 cmakeFlags = lib.optionals stdenv.isDarwin [ "-DWITH_INOTIFY=OFF" "-DWITH_FSEVENTS=ON" "-DXNU_DIR=${xnu}/include" ];
23
24 dontUseCmakeBuildDir = true;
25
26 nativeBuildInputs = [ cmake pkg-config ];
27 buildInputs = [
28 rsync
29 lua
30 asciidoc libxml2 docbook_xml_dtd_45 docbook_xsl libxslt
31 ];
32
33 meta = with lib; {
34 homepage = "https://github.com/axkibe/lsyncd";
35 description = "A utility that synchronizes local directories with remote targets";
36 license = licenses.gpl2Plus;
37 platforms = platforms.all;
38 maintainers = with maintainers; [ bobvanderlinden ];
39 };
40}