2021-07-22 08:22:59 +00:00
{ lib
, stdenv
, fetchurl
, perl
, libiconv
, zlib
, popt
, enableACLs ? lib . meta . availableOn stdenv . hostPlatform acl
, acl
, enableLZ4 ? true
, lz4
, enableOpenSSL ? true
, openssl
, enableXXHash ? true
, xxHash
, enableZstd ? true
, zstd
2020-10-06 08:25:58 +00:00
, nixosTests
2009-02-03 22:13:35 +00:00
} :
2012-01-18 20:38:24 +00:00
stdenv . mkDerivation rec {
2021-07-12 10:51:53 +00:00
pname = " r s y n c " ;
2022-10-29 14:07:26 +00:00
version = " 3 . 2 . 7 " ;
2011-12-03 16:11:57 +00:00
2022-08-20 03:51:09 +00:00
src = fetchurl {
2022-05-27 13:39:03 +00:00
# signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5
2022-08-20 03:51:09 +00:00
url = " m i r r o r : / / s a m b a / r s y n c / s r c / r s y n c - ${ version } . t a r . g z " ;
2022-10-29 14:07:26 +00:00
sha256 = " s h a 2 5 6 - T n 2 d P 2 7 R C H j F j F + 3 J K Z 9 r P S 2 q s c 0 C x P k i P s t x B N G 8 r s = " ;
2022-08-20 03:51:09 +00:00
} ;
2012-01-18 20:38:24 +00:00
2022-05-27 13:39:03 +00:00
nativeBuildInputs = [ perl ] ;
2023-11-06 12:47:27 +00:00
patches = [
# https://github.com/WayneD/rsync/issues/511#issuecomment-1774612577
# original source: https://build.opensuse.org/package/view_file/network/rsync/rsync-fortified-strlcpy-fix.patch?expand=1&rev=3f8dd2f4a404c96c0f69176e60893714
./rsync-fortified-strlcpy-fix.patch
2024-01-02 03:57:10 +00:00
# https://github.com/WayneD/rsync/pull/558
./configure.ac-fix-failing-IPv6-check.patch
2023-11-06 12:47:27 +00:00
] ;
2021-07-22 08:22:59 +00:00
buildInputs = [ libiconv zlib popt ]
++ lib . optional enableACLs acl
++ lib . optional enableZstd zstd
++ lib . optional enableLZ4 lz4
++ lib . optional enableOpenSSL openssl
++ lib . optional enableXXHash xxHash ;
2009-02-03 22:13:35 +00:00
2020-11-01 10:38:54 +00:00
configureFlags = [
" - - w i t h - n o b o d y - g r o u p = n o g r o u p "
# disable the included zlib explicitly as it otherwise still compiles and
# links them even.
" - - w i t h - i n c l u d e d - z l i b = n o "
2023-01-11 16:28:46 +00:00
] ++ lib . optionals ( stdenv . hostPlatform . isMusl && stdenv . hostPlatform . isx86_64 ) [
# fix `multiversioning needs 'ifunc' which is not supported on this target` error
" - - d i s a b l e - r o l l - s i m d "
2022-07-29 19:57:16 +00:00
] ;
2014-05-05 12:55:34 +00:00
2022-07-29 19:55:23 +00:00
enableParallelBuilding = true ;
2020-08-13 13:31:17 +00:00
passthru . tests = { inherit ( nixosTests ) rsyncd ; } ;
2022-05-27 13:39:03 +00:00
meta = with lib ; {
description = " F a s t i n c r e m e n t a l f i l e t r a n s f e r u t i l i t y " ;
homepage = " h t t p s : / / r s y n c . s a m b a . o r g / " ;
license = licenses . gpl3Plus ;
2023-08-10 21:17:32 +00:00
mainProgram = " r s y n c " ;
2022-08-20 03:51:09 +00:00
maintainers = with lib . maintainers ; [ ehmry kampfschlaefer ivan ] ;
2023-08-10 21:17:32 +00:00
platforms = platforms . unix ;
2009-02-03 22:13:35 +00:00
} ;
2005-11-22 22:39:09 +00:00
}