From cf4dfd7d3a814287c578608571d02b8c01afb248 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Mon, 27 Feb 2023 14:47:57 -0700 Subject: [PATCH] rex: 1.13.4 -> 1.14.0 - Add new testing dependencies needed for 1.14.0. - Enable tests with some patches from upstream. --- pkgs/tools/system/rex/default.nix | 39 ++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/system/rex/default.nix b/pkgs/tools/system/rex/default.nix index cf59a22cecee..f27c2d1fd2af 100644 --- a/pkgs/tools/system/rex/default.nix +++ b/pkgs/tools/system/rex/default.nix @@ -1,21 +1,50 @@ -{ pkgs, lib, fetchurl, perlPackages, rsync, installShellFiles, ... }: - +{ pkgs, lib, fetchurl, fetchpatch, perl, perlPackages, rsync, which, installShellFiles, ... }: perlPackages.buildPerlPackage rec { pname = "Rex"; - version = "1.13.4"; + version = "1.14.0"; src = fetchurl { url = "mirror://cpan/authors/id/F/FE/FERKI/Rex-${version}.tar.gz"; - sha256 = "a86e9270159b41c9a8fce96f9ddc97c5caa68167ca4ed33e97908bfce17098cf"; + hash = "sha256-RHxJbkaEjKF9lkl6JYFp2pvcKQurRGUU7FfM/m5lSz8="; }; + buildInputs = with perlPackages; [ FileShareDirInstall ParallelForkManager StringEscape TestDeep TestOutput + TestWarnings TestUseAllModules + TestException + SubOverride rsync + which + ]; + + # These are part of a greater effort to add better support upstream: + # https://github.com/RexOps/Rex/compare/master...nixos + patches = [ + # Fix rex's ability to execute things on NixOS managed hosts + (fetchpatch { + url = "https://github.com/RexOps/Rex/commit/c71f3b255dac8f929abea46913798f132566af55.patch"; + hash = "sha256-S2tF3IZ96QrxDN3HfBk7RWDZcEwukQYAkSId51dATiU="; + }) + # Fix explicit calls to /bin/mv and /bin/rm + (fetchpatch { + url = "https://github.com/RexOps/Rex/commit/2782e80bb9789d3afb42e08904c28a4366a58334.patch"; + hash = "sha256-htm39fF2tumG5b5E1ZBRX5n3vRaZZZzn2lfSN1omP8s="; + }) + # Fix for PATH assumptions + (fetchpatch { + url = "https://github.com/RexOps/Rex/commit/ec72c8d1fdddf9116afdb21091100fe7cc20f41a.patch"; + hash = "sha256-a/Sns2f596dbAWbuIveNldc/V3MwR08/ocXVgx0Tbcw="; + }) + # Fix explicit path in Sudo.pm + (fetchpatch { + url = "https://github.com/RexOps/Rex/commit/f0b312f42178e7e4271b5b010c00efb5cdba2970.patch"; + hash = "sha256-n/+huVCM8zpgx2LZgMB41PPIYgNhF6AK8+4FGPQH+FU="; + }) ]; nativeBuildInputs = with perlPackages; [ installShellFiles ParallelForkManager ]; @@ -42,8 +71,6 @@ perlPackages.buildPerlPackage rec { YAML ]; - doCheck = false; - outputs = [ "out" ]; fixupPhase = ''