Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ fetchurl, lib, stdenv, expect, makeWrapper }:
2
3stdenv.mkDerivation rec {
4 pname = "dejagnu";
5 version = "1.6.3";
6
7 src = fetchurl {
8 url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
9 sha256 = "1qx2cv6qkxbiqg87jh217jb62hk3s7dmcs4cz1llm2wmsynfznl7";
10 };
11
12 nativeBuildInputs = [ makeWrapper ];
13 buildInputs = [ expect ];
14
15 # dejagnu-1.6.3 can't successfully run tests in source tree:
16 # https://wiki.linuxfromscratch.org/lfs/ticket/4871
17 preConfigure = ''
18 mkdir build
19 cd build
20 '';
21 configureScript = "../configure";
22
23 doCheck = !(with stdenv; isDarwin && isAarch64);
24
25 # Note: The test-suite *requires* /dev/pts among the `build-chroot-dirs' of
26 # the build daemon when building in a chroot. See
27 # <https://www.mail-archive.com/nix-dev@cs.uu.nl/msg01056.html> for
28 # details.
29
30 # The test-suite needs to have a non-empty stdin:
31 # https://lists.gnu.org/archive/html/bug-dejagnu/2003-06/msg00002.html
32 checkPhase = ''
33 # Provide `runtest' with a log name, otherwise it tries to run
34 # `whoami', which fails when in a chroot.
35 LOGNAME="nix-build-daemon" make check < /dev/zero
36 '';
37
38 postInstall = ''
39 # 'runtest' and 'dejagnu' look up 'expect' in their 'bin' path
40 # first. We avoid use of 'wrapProgram' here because wrapping
41 # of shell scripts does not preserve argv[0] for schell scripts:
42 # https://sourceware.org/PR30052#c5
43 ln -s ${expect}/bin/expect $out/bin/expect
44 '';
45
46 meta = with lib; {
47 description = "Framework for testing other programs";
48
49 longDescription = ''
50 DejaGnu is a framework for testing other programs. Its purpose
51 is to provide a single front end for all tests. Think of it as a
52 custom library of Tcl procedures crafted to support writing a
53 test harness. A test harness is the testing infrastructure that
54 is created to support a specific program or tool. Each program
55 can have multiple testsuites, all supported by a single test
56 harness. DejaGnu is written in Expect, which in turn uses Tcl --
57 Tool command language.
58 '';
59
60 homepage = "https://www.gnu.org/software/dejagnu/";
61 license = licenses.gpl2Plus;
62
63 platforms = platforms.unix;
64 maintainers = with maintainers; [ vrthra ];
65 };
66}