Merge pull request #172011 from Vonfry/update/fortune-mod
fortune: update & add an option to let user use offensive
This commit is contained in:
commit
13ed374ab2
|
@ -1,14 +1,14 @@
|
|||
{ lib, stdenv, fetchurl, cmake, recode, perl }:
|
||||
{ lib, stdenv, fetchurl, cmake, recode, perl, withOffensive ? false }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "fortune-mod";
|
||||
version = "3.12.0";
|
||||
version = "3.14.0";
|
||||
|
||||
# We use fetchurl instead of fetchFromGitHub because the release pack has some
|
||||
# special files.
|
||||
src = fetchurl {
|
||||
url = "https://github.com/shlomif/fortune-mod/releases/download/${pname}-${version}/${pname}-${version}.tar.xz";
|
||||
sha256 = "sha256-fVrtfLmZiVDTSeuoOltX/vunGSizSw+ZhQhBn9t0C3E=";
|
||||
sha256 = "sha256-jjBxCfjLjnhdKeMgJwEPytCVKQ4R4wHeF8/3Z/F6UgQ=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake perl ];
|
||||
|
@ -17,8 +17,7 @@ stdenv.mkDerivation rec {
|
|||
|
||||
cmakeFlags = [
|
||||
"-DLOCALDIR=${placeholder "out"}/share/fortunes"
|
||||
"-DNO_OFFENSIVE=true"
|
||||
];
|
||||
] ++ lib.optional (!withOffensive) "-DNO_OFFENSIVE=true";
|
||||
|
||||
patches = [ (builtins.toFile "not-a-game.patch" ''
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
|
@ -37,7 +36,7 @@ stdenv.mkDerivation rec {
|
|||
--
|
||||
'') ];
|
||||
|
||||
postFixup = ''
|
||||
postFixup = lib.optionalString (!withOffensive) ''
|
||||
rm -f $out/share/fortunes/men-women*
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in a new issue