Merge pull request #172011 from Vonfry/update/fortune-mod

fortune: update & add an option to let user use offensive
This commit is contained in:
Wout Mertens 2022-05-09 12:33:26 +02:00 committed by GitHub
commit 13ed374ab2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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*
'';