1{
2 lib,
3 stdenv,
4 fetchurl,
5}:
6
7stdenv.mkDerivation rec {
8 pname = "dog";
9 version = "1.7";
10
11 src = fetchurl {
12 url = "http://archive.debian.org/debian/pool/main/d/dog/dog_${version}.orig.tar.gz";
13 sha256 = "3ef25907ec5d1dfb0df94c9388c020b593fbe162d7aaa9bd08f35d2a125af056";
14 };
15
16 postPatch = ''
17 substituteInPlace Makefile \
18 --replace-fail "gcc" "$CC"
19 sed -i '40i #include <time.h>' dog.c
20 '';
21
22 installPhase = ''
23 runHook preInstall
24 mkdir -p $out/bin
25 mkdir -p $out/man/man1
26 cp dog.1 $out/man/man1
27 cp dog $out/bin
28 runHook postInstall
29 '';
30
31 meta = with lib; {
32 homepage = "https://lwn.net/Articles/421072/";
33 description = "cat replacement";
34 license = licenses.gpl2Plus;
35 maintainers = with maintainers; [ qknight ];
36 platforms = platforms.all;
37 mainProgram = "dog";
38 };
39}