From 243c336022e9f324b721630a163bfa7b01939fa9 Mon Sep 17 00:00:00 2001 From: Arnold Krille Date: Sat, 13 Feb 2016 17:17:24 +0100 Subject: [PATCH 1/3] 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 c13bb1b329df..6608e32e8bcb 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 000000000000..044a01993f9d --- /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 000000000000..f6896d2c5985 --- /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 5e8312764dda..ebbd1edce0d7 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 { }; From c3b4dd920b50d6fd7625ada250d042b47fbd0217 Mon Sep 17 00:00:00 2001 From: Arnold Krille Date: Sat, 13 Feb 2016 18:50:07 +0100 Subject: [PATCH 2/3] rsync/rrsync: less code duplication - refactor the common parts all into the base.nix - add myself as maintainer --- .../networking/sync/rsync/base.nix | 26 +++++++++++++++++++ .../networking/sync/rsync/default.nix | 20 +++++--------- .../networking/sync/rsync/rrsync.nix | 18 ++++++------- .../networking/sync/rsync/src.nix | 7 ----- 4 files changed, 41 insertions(+), 30 deletions(-) create mode 100644 pkgs/applications/networking/sync/rsync/base.nix delete mode 100644 pkgs/applications/networking/sync/rsync/src.nix diff --git a/pkgs/applications/networking/sync/rsync/base.nix b/pkgs/applications/networking/sync/rsync/base.nix new file mode 100644 index 000000000000..ef159d4d0e39 --- /dev/null +++ b/pkgs/applications/networking/sync/rsync/base.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl }: + +let + version = "3.2.1"; +in +{ + version = version; + src = 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"; + }; + patches = fetchurl { + # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 + url = "mirror://samba/rsync/rsync-patches-${version}.tar.gz"; + sha256 = "09i3dcl37p22dp75vlnsvx7bm05ggafnrf1zwhf2kbij4ngvxvpd"; + }; + + 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 kampfschlaefer ]; + }; +} \ No newline at end of file diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix index 6608e32e8bcb..8a4ff67e2eb5 100644 --- a/pkgs/applications/networking/sync/rsync/default.nix +++ b/pkgs/applications/networking/sync/rsync/default.nix @@ -5,17 +5,15 @@ assert enableACLs -> acl != null; +let + base = import ./base.nix { inherit stdenv fetchurl; }; +in stdenv.mkDerivation rec { - name = "rsync-${version}"; - version = "3.1.2"; + name = "rsync-${base.version}"; - mainSrc = import ./src.nix { inherit fetchurl version; }; + mainSrc = base.src; - patchesSrc = fetchurl { - # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 - url = "mirror://samba/rsync/rsync-patches-${version}.tar.gz"; - sha256 = "09i3dcl37p22dp75vlnsvx7bm05ggafnrf1zwhf2kbij4ngvxvpd"; - }; + patchesSrc = base.patches; srcs = [mainSrc] ++ stdenv.lib.optional enableCopyDevicesPatch patchesSrc; patches = stdenv.lib.optional enableCopyDevicesPatch "./patches/copy-devices.diff"; @@ -25,11 +23,7 @@ stdenv.mkDerivation rec { configureFlags = "--with-nobody-group=nogroup"; - meta = with stdenv.lib; { - homepage = http://rsync.samba.org/; + meta = base.meta // { description = "A fast incremental file transfer utility"; - license = licenses.gpl3Plus; - platforms = platforms.unix; - maintainers = with maintainers; [ simons ehmry ]; }; } diff --git a/pkgs/applications/networking/sync/rsync/rrsync.nix b/pkgs/applications/networking/sync/rsync/rrsync.nix index 044a01993f9d..6260fc0ddeca 100644 --- a/pkgs/applications/networking/sync/rsync/rrsync.nix +++ b/pkgs/applications/networking/sync/rsync/rrsync.nix @@ -1,10 +1,12 @@ { stdenv, fetchurl, perl, rsync }: +let + base = import ./base.nix { inherit stdenv fetchurl; }; +in stdenv.mkDerivation rec { - name = "rrsync-${version}"; - version = "3.1.2"; + name = "rrsync-${base.version}"; - src = import ./src.nix { inherit fetchurl version; }; + src = base.src; buildInputs = [ rsync ]; nativeBuildInputs = [perl]; @@ -15,7 +17,7 @@ stdenv.mkDerivation rec { dontBuild = true; postPatch = '' - sed -i 's#/usr/bin/rsync#${rsync}/bin/rsync#' support/rrsync + substituteInPlace support/rrsync --replace /usr/bin/rsync ${rsync}/bin/rsync ''; installPhase = '' @@ -24,11 +26,7 @@ stdenv.mkDerivation rec { 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 ]; + meta = base.meta // { + description = "A helper to run rsync-only environments from ssh-logins"; }; } diff --git a/pkgs/applications/networking/sync/rsync/src.nix b/pkgs/applications/networking/sync/rsync/src.nix deleted file mode 100644 index f6896d2c5985..000000000000 --- a/pkgs/applications/networking/sync/rsync/src.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ 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 From b4ac8fb39bbd1bd01c619fa7f19cb4dcd200cde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 21 Feb 2016 09:59:00 +0100 Subject: [PATCH 3/3] (r)rsync: simplify and don't copy maintainers Let's keep the original rsync maintainers only on rsync, as I haven't noticed them wanting to maintain rrsync as well. --- pkgs/applications/networking/sync/rsync/base.nix | 9 ++------- pkgs/applications/networking/sync/rsync/default.nix | 1 + pkgs/applications/networking/sync/rsync/rrsync.nix | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/networking/sync/rsync/base.nix b/pkgs/applications/networking/sync/rsync/base.nix index ef159d4d0e39..86b90ea22ef2 100644 --- a/pkgs/applications/networking/sync/rsync/base.nix +++ b/pkgs/applications/networking/sync/rsync/base.nix @@ -1,10 +1,7 @@ { stdenv, fetchurl }: -let +rec { version = "3.2.1"; -in -{ - version = version; src = fetchurl { # signed with key 0048 C8B0 26D4 C96F 0E58 9C2F 6C85 9FB1 4B96 A8C5 url = "mirror://samba/rsync/src/rsync-${version}.tar.gz"; @@ -18,9 +15,7 @@ in 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 kampfschlaefer ]; }; -} \ No newline at end of file +} diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix index 8a4ff67e2eb5..b65eb43351ef 100644 --- a/pkgs/applications/networking/sync/rsync/default.nix +++ b/pkgs/applications/networking/sync/rsync/default.nix @@ -25,5 +25,6 @@ stdenv.mkDerivation rec { meta = base.meta // { description = "A fast incremental file transfer utility"; + maintainers = with stdenv.lib.maintainers; [ simons ehmry kampfschlaefer ]; }; } diff --git a/pkgs/applications/networking/sync/rsync/rrsync.nix b/pkgs/applications/networking/sync/rsync/rrsync.nix index 6260fc0ddeca..7563b0ea1950 100644 --- a/pkgs/applications/networking/sync/rsync/rrsync.nix +++ b/pkgs/applications/networking/sync/rsync/rrsync.nix @@ -28,5 +28,6 @@ stdenv.mkDerivation rec { meta = base.meta // { description = "A helper to run rsync-only environments from ssh-logins"; + maintainers = [ stdenv.lib.maintainers.kampfschlaefer ]; }; }