2023-03-08 16:32:21 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, recode, perl, rinutils, withOffensive ? false }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "fortune-mod";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "3.20.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-09 15:59:12 +00:00
|
|
|
# We use fetchurl instead of fetchFromGitHub because the release pack has some
|
|
|
|
# special files.
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2020-11-09 15:59:12 +00:00
|
|
|
url = "https://github.com/shlomif/fortune-mod/releases/download/${pname}-${version}/${pname}-${version}.tar.xz";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-MQG+lfuJxISNSD5ykw2o0D9pJXN6I9eIA9a1XEL+IJQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
nativeBuildInputs = [ cmake perl rinutils ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ recode ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DLOCALDIR=${placeholder "out"}/share/fortunes"
|
2022-05-18 14:49:53 +00:00
|
|
|
] ++ lib.optional (!withOffensive) "-DNO_OFFENSIVE=true";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patches = [ (builtins.toFile "not-a-game.patch" ''
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
|
|
index 865e855..5a59370 100644
|
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
|
|
|
@@ -154,7 +154,7 @@ ENDMACRO()
|
|
|
|
my_exe(
|
|
|
|
"fortune"
|
|
|
|
"fortune/fortune.c"
|
|
|
|
- "games"
|
|
|
|
+ "bin"
|
|
|
|
)
|
|
|
|
|
|
|
|
my_exe(
|
2020-11-09 15:59:12 +00:00
|
|
|
--
|
2020-04-24 23:36:52 +00:00
|
|
|
'') ];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
postFixup = lib.optionalString (!withOffensive) ''
|
2022-04-27 09:35:20 +00:00
|
|
|
rm -f $out/share/fortunes/men-women*
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
mainProgram = "fortune";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A program that displays a pseudorandom message from a database of quotations";
|
|
|
|
license = licenses.bsdOriginal;
|
|
|
|
platforms = platforms.unix;
|
2020-11-09 15:59:12 +00:00
|
|
|
maintainers = with maintainers; [ vonfry ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|