2024-06-30 08:16:52 +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 ,
2024-05-02 00:46:19 +00:00
# for passthru.tests
# , nixosTests
} :
stdenv . mkDerivation rec {
pname = " r s y n c " ;
version = " 3 . 2 . 7 " ;
src = fetchurl {
# signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5
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 " ;
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 = " ;
} ;
nativeBuildInputs = [ perl ] ;
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
# https://github.com/WayneD/rsync/pull/558
./configure.ac-fix-failing-IPv6-check.patch
] ;
2024-06-30 08:16:52 +00:00
buildInputs =
[
libiconv
zlib
popt
]
2024-05-02 00:46:19 +00:00
++ lib . optional enableACLs acl
++ lib . optional enableZstd zstd
++ lib . optional enableLZ4 lz4
++ lib . optional enableOpenSSL openssl
++ lib . optional enableXXHash xxHash ;
2024-06-30 08:16:52 +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 "
2024-05-02 00:46:19 +00:00
2024-06-30 08:16:52 +00:00
# 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 "
]
++ 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 "
]
++ lib . optionals ( ! enableZstd ) [ " - - d i s a b l e - z s t d " ]
++ lib . optionals ( ! enableXXHash ) [ " - - d i s a b l e - x x h a s h " ] ;
2024-05-02 00:46:19 +00:00
enableParallelBuilding = true ;
# passthru.tests = { inherit (nixosTests) rsyncd; };
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 ;
mainProgram = " r s y n c " ;
2024-06-30 08:16:52 +00:00
maintainers = with lib . maintainers ; [
ehmry
kampfschlaefer
ivan
] ;
2024-05-02 00:46:19 +00:00
platforms = platforms . unix ;
} ;
}