nixpkgs/pkgs/tools/misc/fortune/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, cmake, recode, perl }:
stdenv.mkDerivation rec {
2019-08-13 21:52:01 +00:00
pname = "fortune-mod";
2022-02-11 12:24:12 +00:00
version = "3.12.0";
2020-10-29 11:22:09 +00:00
# We use fetchurl instead of fetchFromGitHub because the release pack has some
# special files.
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-02-11 12:24:12 +00:00
sha256 = "sha256-fVrtfLmZiVDTSeuoOltX/vunGSizSw+ZhQhBn9t0C3E=";
};
nativeBuildInputs = [ cmake perl ];
buildInputs = [ recode ];
cmakeFlags = [
"-DLOCALDIR=${placeholder "out"}/share/fortunes"
];
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
--
'') ];
meta = with lib; {
mainProgram = "fortune";
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 ];
};
}