2022-05-08 01:44:04 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, recode, perl, withOffensive ? false }:
|
2012-03-29 07:15:40 +00:00
|
|
|
|
2019-09-03 16:19:00 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "fortune-mod";
|
2022-08-13 09:32:04 +00:00
|
|
|
version = "3.14.1";
|
2018-07-19 04:28:14 +00:00
|
|
|
|
2020-10-29 11:22:09 +00:00
|
|
|
# We use fetchurl instead of fetchFromGitHub because the release pack has some
|
|
|
|
# special files.
|
2019-09-03 16:19:00 +00:00
|
|
|
src = fetchurl {
|
2020-10-29 11:22:09 +00:00
|
|
|
url = "https://github.com/shlomif/fortune-mod/releases/download/${pname}-${version}/${pname}-${version}.tar.xz";
|
2022-08-13 09:32:04 +00:00
|
|
|
sha256 = "sha256-NnAj9dsB1ZUuTm2W8mPdK2h15Dtro8ve6c+tPoKUsXs=";
|
2019-09-03 16:19:00 +00:00
|
|
|
};
|
2019-02-05 13:07:27 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake perl ];
|
2018-07-19 04:28:14 +00:00
|
|
|
|
2012-06-12 23:41:05 +00:00
|
|
|
buildInputs = [ recode ];
|
2018-07-19 04:28:14 +00:00
|
|
|
|
2019-09-03 16:19:00 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DLOCALDIR=${placeholder "out"}/share/fortunes"
|
2022-05-08 01:44:04 +00:00
|
|
|
] ++ lib.optional (!withOffensive) "-DNO_OFFENSIVE=true";
|
2019-09-03 16:19:00 +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-10-29 11:22:09 +00:00
|
|
|
--
|
2019-09-03 16:19:00 +00:00
|
|
|
'') ];
|
2012-03-29 07:15:40 +00:00
|
|
|
|
2022-05-08 01:44:04 +00:00
|
|
|
postFixup = lib.optionalString (!withOffensive) ''
|
2022-05-01 16:58:25 +00:00
|
|
|
rm -f $out/share/fortunes/men-women*
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-11-10 07:14:30 +00:00
|
|
|
mainProgram = "fortune";
|
2012-06-12 23:41:05 +00:00
|
|
|
description = "A program that displays a pseudorandom message from a database of quotations";
|
2018-08-16 19:55:12 +00:00
|
|
|
license = licenses.bsdOriginal;
|
|
|
|
platforms = platforms.unix;
|
2020-10-29 11:22:09 +00:00
|
|
|
maintainers = with maintainers; [ vonfry ];
|
2012-03-29 07:15:40 +00:00
|
|
|
};
|
|
|
|
}
|