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

fortune: update & add an option to let user use offensive
main
Wout Mertens 2 years ago committed by GitHub
commit 13ed374ab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      pkgs/tools/misc/fortune/default.nix

@ -1,14 +1,14 @@
{ lib, stdenv, fetchurl, cmake, recode, perl }: { lib, stdenv, fetchurl, cmake, recode, perl, withOffensive ? false }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "fortune-mod"; pname = "fortune-mod";
version = "3.12.0"; version = "3.14.0";
# We use fetchurl instead of fetchFromGitHub because the release pack has some # We use fetchurl instead of fetchFromGitHub because the release pack has some
# special files. # special files.
src = fetchurl { src = fetchurl {
url = "https://github.com/shlomif/fortune-mod/releases/download/${pname}-${version}/${pname}-${version}.tar.xz"; 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 ]; nativeBuildInputs = [ cmake perl ];
@ -17,8 +17,7 @@ stdenv.mkDerivation rec {
cmakeFlags = [ cmakeFlags = [
"-DLOCALDIR=${placeholder "out"}/share/fortunes" "-DLOCALDIR=${placeholder "out"}/share/fortunes"
"-DNO_OFFENSIVE=true" ] ++ lib.optional (!withOffensive) "-DNO_OFFENSIVE=true";
];
patches = [ (builtins.toFile "not-a-game.patch" '' patches = [ (builtins.toFile "not-a-game.patch" ''
diff --git a/CMakeLists.txt b/CMakeLists.txt 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* rm -f $out/share/fortunes/men-women*
''; '';

Loading…
Cancel
Save