1 { lib, stdenv, fetchurl, cmake, recode, perl, 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/${pname}-${version}/${pname}-${version}.tar.xz";
11 sha256 = "sha256-NnAj9dsB1ZUuTm2W8mPdK2h15Dtro8ve6c+tPoKUsXs=";
14 nativeBuildInputs = [ cmake perl ];
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 -f $out/share/fortunes/men-women*
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 ];