From bf09f6c83afefd3c2dae00eeec0802644ceb7456 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Sun, 8 May 2022 09:44:04 +0800 Subject: [PATCH 1/2] fortune: add an option to let user use offensive --- pkgs/tools/misc/fortune/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/fortune/default.nix b/pkgs/tools/misc/fortune/default.nix index 3e6ebb2f0d6..b4778cd1acb 100644 --- a/pkgs/tools/misc/fortune/default.nix +++ b/pkgs/tools/misc/fortune/default.nix @@ -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* ''; From d5cdae6c5da043dbf5c58c2b5243cf3c7f7c3e50 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Sun, 8 May 2022 09:49:21 +0800 Subject: [PATCH 2/2] fortune: 3.12.0 -> 3.14.0 --- pkgs/tools/misc/fortune/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/fortune/default.nix b/pkgs/tools/misc/fortune/default.nix index b4778cd1acb..9cab0bc2237 100644 --- a/pkgs/tools/misc/fortune/default.nix +++ b/pkgs/tools/misc/fortune/default.nix @@ -2,13 +2,13 @@ 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 ];