summary refs log tree commit diff
path: root/pkgs/tools/misc/fortune/default.nix
blob: 941aa7564204ac8d94a9704d6b350a7d36266890 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ stdenv, fetchurl, recode }:

stdenv.mkDerivation {
  name = "fortune-mod-1.99.1";
  
  src = fetchurl {
    url = http://ftp.de.debian.org/debian/pool/main/f/fortune-mod/fortune-mod_1.99.1.orig.tar.gz;
    sha256 = "1kpa2hgbglj5dbfasvl9wc1q3xpl91mqn3sfby46r4rwyzhswlgw";
  };
  
  buildInputs = [ recode ];
  
  preConfigure = ''
    sed -i "s|/usr/|$out/|" Makefile 
  '';

  preBuild = ''
    makeFlagsArray=("CC=$CC" "REGEXDEFS=-DHAVE_REGEX_H -DPOSIX_REGEX" "LDFLAGS=")
  '';
  
  postInstall = ''
    ln -s $out/games/fortune $out/bin/fortune
  '';

  meta = {
    description = "A program that displays a pseudorandom message from a database of quotations";
  };
}