From 243c336022e9f324b721630a163bfa7b01939fa9 Mon Sep 17 00:00:00 2001 From: Arnold Krille Date: Sat, 13 Feb 2016 17:17:24 +0100 Subject: [PATCH] rsync: Add rrsync as individual app Extract the rsync source fetching into its own expression and use that expression to fetch the same source for rsync and rrsync. rrsync is just copied from the support folder of rsync, no configure or build needed. Also none of the rsync patches are needed. Only the path to rsync needs to be patched into rrsync. --- .../networking/sync/rsync/default.nix | 6 +--- .../networking/sync/rsync/rrsync.nix | 34 +++++++++++++++++++ .../networking/sync/rsync/src.nix | 7 ++++ pkgs/top-level/all-packages.nix | 1 + 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 pkgs/applications/networking/sync/rsync/rrsync.nix create mode 100644 pkgs/applications/networking/sync/rsync/src.nix diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix index c13bb1b329d..6608e32e8bc 100644 --- a/pkgs/applications/networking/sync/rsync/default.nix +++ b/pkgs/applications/networking/sync/rsync/default.nix @@ -9,11 +9,7 @@ stdenv.mkDerivation rec { name = "rsync-${version}"; version = "3.1.2"; - mainSrc = fetchurl { - # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 - url = "mirror://samba/rsync/src/rsync-${version}.tar.gz"; - sha256 = "1hm1q04hz15509f0p9bflw4d6jzfvpm1d36dxjwihk1wzakn5ypc"; - }; + mainSrc = import ./src.nix { inherit fetchurl version; }; patchesSrc = fetchurl { # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 diff --git a/pkgs/applications/networking/sync/rsync/rrsync.nix b/pkgs/applications/networking/sync/rsync/rrsync.nix new file mode 100644 index 00000000000..044a01993f9 --- /dev/null +++ b/pkgs/applications/networking/sync/rsync/rrsync.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl, perl, rsync }: + +stdenv.mkDerivation rec { + name = "rrsync-${version}"; + version = "3.1.2"; + + src = import ./src.nix { inherit fetchurl version; }; + + buildInputs = [ rsync ]; + nativeBuildInputs = [perl]; + + # Skip configure and build phases. + # We just want something from the support directory + configurePhase = "true"; + dontBuild = true; + + postPatch = '' + sed -i 's#/usr/bin/rsync#${rsync}/bin/rsync#' support/rrsync + ''; + + installPhase = '' + mkdir -p $out/bin + cp support/rrsync $out/bin + chmod a+x $out/bin/rrsync + ''; + + meta = with stdenv.lib; { + homepage = http://rsync.samba.org/; + description = "A helper to run rsync-only environments from ssh-logins."; + license = licenses.gpl3Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ simons ehmry ]; + }; +} diff --git a/pkgs/applications/networking/sync/rsync/src.nix b/pkgs/applications/networking/sync/rsync/src.nix new file mode 100644 index 00000000000..f6896d2c598 --- /dev/null +++ b/pkgs/applications/networking/sync/rsync/src.nix @@ -0,0 +1,7 @@ +{ version, fetchurl }: + +fetchurl { + # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 + url = "mirror://samba/rsync/src/rsync-${version}.tar.gz"; + sha256 = "1hm1q04hz15509f0p9bflw4d6jzfvpm1d36dxjwihk1wzakn5ypc"; +} \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5e8312764dd..ebbd1edce0d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13225,6 +13225,7 @@ let enableACLs = !(stdenv.isDarwin || stdenv.isSunOS || stdenv.isFreeBSD); enableCopyDevicesPatch = (config.rsync.enableCopyDevicesPatch or false); }; + rrsync = callPackage ../applications/networking/sync/rsync/rrsync.nix {}; rtl-sdr = callPackage ../applications/misc/rtl-sdr { };