@@ -1,30 +1,80 @@
1−{stdenv, fetchFromGitHub, python2, which}:
2−stdenv.mkDerivation {
3− pname = "redo-apenwarr";
1+{ stdenv, lib, python27, fetchFromGitHub, mkdocs, which, findutils, coreutils
2+, perl
3+, doCheck ? true
4+}: let
45
5− version = "unstable-2019-06-21";
6+ # copy from
7+ # pkgs/applications/networking/pyload/beautifulsoup.nix
8+ beautifulsoup = python27.pkgs.callPackage ./beautifulsoup.nix {
9+ pythonPackages = python27.pkgs;
10+ };
11+
12+ mkdocs-exclude = python27.pkgs.callPackage ./mkdocs-exclude.nix {
13+ pythonPackages = python27.pkgs;
14+ };
15+in stdenv.mkDerivation rec {
16+
17+ pname = "redo-apenwarr";
18+ version = "0.42";
619
720 src = fetchFromGitHub {
821 owner = "apenwarr";
9− repo = "redo";
10− rev = "8924fa35fa7363b531f8e6b48a1328d2407ad5cf";
11− sha256 = "1dj20w29najqjyvk0jh5kqbcd10k32rad986q5mzv4v49qcwdc1q";
22+ repo = pname;
23+ rev = "${pname}-${version}";
24+ sha256 = "1060yb7hrxm8c7bfvb0y4j0acpxsj6hbykw1d9549zpkxxr9nsgm";
1225 };
1326
14− DESTDIR="";
15− PREFIX = placeholder "out";
27+ postPatch = ''
28+
29+ patchShebangs minimal/do
30+
31+ '' + lib.optionalString doCheck ''
32+ unset CC CXX
33+
34+ substituteInPlace minimal/do.test \
35+ --replace "/bin/pwd" "${coreutils}/bin/pwd"
36+
37+ substituteInPlace t/105-sympath/all.do \
38+ --replace "/bin/pwd" "${coreutils}/bin/pwd"
39+
40+ substituteInPlace t/all.do \
41+ --replace "/bin/ls" "ls"
42+
43+ substituteInPlace t/110-compile/hello.o.do \
44+ --replace "/usr/include" "${stdenv.cc.libc.dev}/include"
45+
46+ substituteInPlace t/200-shell/nonshelltest.do \
47+ --replace "/usr/bin/env perl" "${perl}/bin/perl"
1648
17− patchPhase = ''
18− patchShebangs .
1949 '';
2050
21− buildInputs = [ python2 which ];
51+ inherit doCheck;
52+
53+ checkTarget = "test";
54+
55+ outputs = [ "out" "man" ];
56+
57+ installFlags = [
58+ "PREFIX=$(out)"
59+ "DESTDIR=/"
60+ ];
61+
62+ nativeBuildInputs = [
63+ python27
64+ beautifulsoup
65+ mkdocs
66+ mkdocs-exclude
67+ which
68+ findutils
69+ ];
2270
23− meta = with stdenv.lib; {
24− description = "Apenwarr version of the redo build tool.";
25− homepage = https://github.com/apenwarr/redo/;
26− license = stdenv.lib.licenses.asl20;
27− platforms = platforms.all;
28− maintainers = with stdenv.lib.maintainers; [ andrewchambers ];
71+ meta = with lib; {
72+ description = "Smaller, easier, more powerful, and more reliable than make. An implementation of djb's redo.";
73+ homepage = https://github.com/apenwarr/redo;
74+ maintainers = with maintainers; [
75+ andrewchambers
76+ ck3d
77+ ];
78+ license = licenses.asl20;
2979 };
3080}