@@ -1,55 +1,21 @@
1−{ lib, stdenv, fetchurl, fetchpatch, ed }:
1+{ lib, stdenv, fetchurl, fetchpatch, buildPackages, diffutils, ed }:
22
33stdenv.mkDerivation rec {
4− name = "rcs-5.9.4";
4+ pname = "rcs";
5+ version = "5.10.0";
56
67 src = fetchurl {
7− url = "mirror://gnu/rcs/${name}.tar.xz";
8− sha256 = "1zsx7bb0rgvvvisiy4zlixf56ay8wbd9qqqcp1a1g0m1gl6mlg86";
8+ url = "mirror://gnu/rcs/${pname}-${version}.tar.xz";
9+ sha256 = "sha256-Og2flYx60wPkdehjRlSXTtvm3rOkVEkfOFfcGIm6xcU";
910 };
1011
11− buildInputs = [ ed ];
12+ ac_cv_path_ED = "${ed}/bin/ed";
13+ DIFF = "${diffutils}/bin/diff";
14+ DIFF3 = "${diffutils}/bin/diff3";
1215
13− patches = lib.optionals stdenv.isDarwin [
14− # This failure appears unrelated to the subject of the test. This
15− # test seems to rely on a bash bug where `test $x -nt $y` ignores
16− # subsecond values in timetamps. This bug has been fixed in Bash
17− # 5, and seemingly doesn't affect Darwin.
18− ./disable-t810.patch
19−
20− (fetchpatch {
21− url = "https://raw.githubusercontent.com/macports/macports-ports/b76d1e48dac/editors/nano/files/secure_snprintf.patch";
22− extraPrefix = "";
23− sha256 = "1wy9pjw3vvp8fv8a7pmkqmiapgacfx54qj9fvsc5gwry0vv7vnc3";
24− })
25−
26− # Expected to appear in the next release
27− (fetchpatch {
28− url = "https://raw.githubusercontent.com/Homebrew/formula-patches/3fff7c990b8df4174045834b9c1210e7736ff5a4/rcs/noreturn.patch";
29− sha256 = "10zniqrd6xagf3q03i1vksl0vd9nla3qcj0840n3m8z6jd4aypcx";
30− })
31− ];
32−
33− doCheck = true;
34−
35− checkFlags = [ "VERBOSE=1" ];
36−
37− checkPhase = ''
38− # If neither LOGNAME or USER are set, rcs will default to
39− # getlogin(), which is unreliable on macOS. It will often return
40− # things like `_spotlight`, or `_mbsetupuser`. macOS sets both
41− # environment variables in user sessions, so this is unlikely to
42− # affect regular usage.
43−
44− export LOGNAME=$(id -un)
45−
46− print_logs_and_fail() {
47− grep -nH -e . -r tests/*.d/{out,err}
48− return 1
49− }
50−
51− make $checkFlags check || print_logs_and_fail
52− '';
16+ disallowedReferences =
17+ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform)
18+ [ buildPackages.diffutils buildPackages.ed ];
5319
5420 NIX_CFLAGS_COMPILE = "-std=c99";
5521