8 , enableACLs ? lib.meta.availableOn stdenv.hostPlatform acl
12 , enableOpenSSL ? true
21 stdenv.mkDerivation rec {
26 # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5
27 url = "mirror://samba/rsync/src/rsync-${version}.tar.gz";
28 sha256 = "sha256-Tn2dP27RCHjFjF+3JKZ9rPS2qsc0CxPkiPstxBNG8rs=";
31 nativeBuildInputs = [ perl ];
34 # https://github.com/WayneD/rsync/issues/511#issuecomment-1774612577
35 # original source: https://build.opensuse.org/package/view_file/network/rsync/rsync-fortified-strlcpy-fix.patch?expand=1&rev=3f8dd2f4a404c96c0f69176e60893714
36 ./rsync-fortified-strlcpy-fix.patch
39 buildInputs = [ libiconv zlib popt ]
40 ++ lib.optional enableACLs acl
41 ++ lib.optional enableZstd zstd
42 ++ lib.optional enableLZ4 lz4
43 ++ lib.optional enableOpenSSL openssl
44 ++ lib.optional enableXXHash xxHash;
47 "--with-nobody-group=nogroup"
49 # disable the included zlib explicitly as it otherwise still compiles and
51 "--with-included-zlib=no"
52 ] ++ lib.optionals (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_64) [
53 # fix `multiversioning needs 'ifunc' which is not supported on this target` error
57 enableParallelBuilding = true;
59 passthru.tests = { inherit (nixosTests) rsyncd; };
62 description = "Fast incremental file transfer utility";
63 homepage = "https://rsync.samba.org/";
64 license = licenses.gpl3Plus;
65 mainProgram = "rsync";
66 maintainers = with lib.maintainers; [ ehmry kampfschlaefer ivan ];
67 platforms = platforms.unix;