python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / misc / fortune / default.nix
blobe82b13d12c65e63c6642be3893bbbaccb6194a0b
1 { lib, stdenv, fetchurl, cmake, recode, perl, withOffensive ? false }:
3 stdenv.mkDerivation rec {
4   pname = "fortune-mod";
5   version = "3.14.1";
7   # We use fetchurl instead of fetchFromGitHub because the release pack has some
8   # special files.
9   src = fetchurl {
10     url = "https://github.com/shlomif/fortune-mod/releases/download/${pname}-${version}/${pname}-${version}.tar.xz";
11     sha256 = "sha256-NnAj9dsB1ZUuTm2W8mPdK2h15Dtro8ve6c+tPoKUsXs=";
12   };
14   nativeBuildInputs = [ cmake perl ];
16   buildInputs = [ recode ];
18   cmakeFlags = [
19     "-DLOCALDIR=${placeholder "out"}/share/fortunes"
20   ] ++ lib.optional (!withOffensive) "-DNO_OFFENSIVE=true";
22   patches = [ (builtins.toFile "not-a-game.patch" ''
23     diff --git a/CMakeLists.txt b/CMakeLists.txt
24     index 865e855..5a59370 100644
25     --- a/CMakeLists.txt
26     +++ b/CMakeLists.txt
27     @@ -154,7 +154,7 @@ ENDMACRO()
28      my_exe(
29          "fortune"
30          "fortune/fortune.c"
31     -    "games"
32     +    "bin"
33      )
35      my_exe(
36     --
37   '') ];
39   postFixup = lib.optionalString (!withOffensive) ''
40     rm -f $out/share/fortunes/men-women*
41   '';
43   meta = with lib; {
44     mainProgram = "fortune";
45     description = "A program that displays a pseudorandom message from a database of quotations";
46     license = licenses.bsdOriginal;
47     platforms = platforms.unix;
48     maintainers = with maintainers; [ vonfry ];
49   };