3
0
Fork 0
forked from mirrors/nixpkgs

fortune: add an option to let user use offensive

This commit is contained in:
Vonfry 2022-05-08 09:44:04 +08:00
parent d707e510df
commit bf09f6c83a
No known key found for this signature in database
GPG key ID: 7E3128A1AAF71FCC

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, cmake, recode, perl }:
{ lib, stdenv, fetchurl, cmake, recode, perl, withOffensive ? false }:
stdenv.mkDerivation rec {
pname = "fortune-mod";
@ -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*
'';