kubedog: 0.12.3 -> 0.13.0 (#375971)
[NixPkgs.git] / pkgs / by-name / fo / fortune / package.nix
blobbb0233f4b6155cf1f681890183a70a2513830f17
2   lib,
3   stdenv,
4   fetchurl,
5   cmake,
6   recode,
7   perl,
8   rinutils,
9   withOffensive ? false,
12 stdenv.mkDerivation rec {
13   pname = "fortune-mod";
14   version = "3.24.0";
16   # We use fetchurl instead of fetchFromGitHub because the release pack has some
17   # special files.
18   src = fetchurl {
19     url = "https://github.com/shlomif/fortune-mod/releases/download/fortune-mod-${version}/fortune-mod-${version}.tar.xz";
20     sha256 = "sha256-Hzh4dyVOleq2H5NyV7QmCfKbmU7wVxUxZVu/w6KsdKw=";
21   };
23   nativeBuildInputs = [
24     cmake
25     perl
26     rinutils
27   ];
29   buildInputs = [ recode ];
31   cmakeFlags = [
32     "-DLOCALDIR=${placeholder "out"}/share/fortunes"
33   ] ++ lib.optional (!withOffensive) "-DNO_OFFENSIVE=true";
35   patches = [
36     (builtins.toFile "not-a-game.patch" ''
37       diff --git a/CMakeLists.txt b/CMakeLists.txt
38       index 865e855..5a59370 100644
39       --- a/CMakeLists.txt
40       +++ b/CMakeLists.txt
41       @@ -154,7 +154,7 @@ ENDMACRO()
42        my_exe(
43            "fortune"
44            "fortune/fortune.c"
45       -    "games"
46       +    "bin"
47        )
49        my_exe(
50       --
51     '')
52   ];
54   postFixup = lib.optionalString (!withOffensive) ''
55     rm $out/share/games/fortunes/men-women*
56   '';
58   meta = with lib; {
59     mainProgram = "fortune";
60     description = "Program that displays a pseudorandom message from a database of quotations";
61     license = licenses.bsdOriginal;
62     platforms = platforms.unix;
63     maintainers = with maintainers; [ vonfry ];
64   };