1 { lib, stdenv, fetchurl, cmake, recode, perl, rinutils, withOffensive ? false }:
3 stdenv.mkDerivation rec {
7 # We use fetchurl instead of fetchFromGitHub because the release pack has some
10 url = "https://github.com/shlomif/fortune-mod/releases/download/fortune-mod-${version}/fortune-mod-${version}.tar.xz";
11 sha256 = "sha256-BpMhu01K46v1VJPQQ86gZTTck/Giwp6GaU2e2xOAoOM=";
14 nativeBuildInputs = [ cmake perl rinutils ];
16 buildInputs = [ recode ];
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
27 @@ -154,7 +154,7 @@ ENDMACRO()
39 postFixup = lib.optionalString (!withOffensive) ''
40 rm $out/share/games/fortunes/men-women*
44 mainProgram = "fortune";
45 description = "Program that displays a pseudorandom message from a database of quotations";
46 license = licenses.bsdOriginal;
47 platforms = platforms.unix;
48 maintainers = with maintainers; [ vonfry ];