Merge pull request #67280 from dtzWill/update/fortune-2.10.0

fortune: 2.6.2 -> 2.10.0, use official tarball
This commit is contained in:
worldofpeace 2019-09-06 05:29:04 -04:00 committed by GitHub
commit 8b8b4abd55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,37 +1,38 @@
{ stdenv, fetchurl, cmake, recode, perl }:
let srcs = {
fortune = fetchurl {
url = "https://github.com/shlomif/fortune-mod/archive/fortune-mod-${version}.tar.gz";
sha256 = "89223bb649ea62b030527f181539182d6a17a1a43b0cc499a52732b839f7b691";
};
shlomifCommon = fetchurl {
url = https://bitbucket.org/shlomif/shlomif-cmake-modules/raw/default/shlomif-cmake-modules/Shlomif_Common.cmake;
sha256 = "62f188a9f1b7ab0e757eb0bc6540d9c0026d75edc7acc1c3cdf7438871d0a94f";
};
};
version = "2.6.2";
in
stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "fortune-mod";
inherit version;
version = "2.10.0";
src = srcs.fortune;
sourceRoot = "fortune-mod-fortune-mod-${version}/fortune-mod";
src = fetchurl {
url = "https://www.shlomifish.org/open-source/projects/fortune-mod/arcs/fortune-mod-${version}.tar.xz";
sha256 = "07g50hij87jb7m40pkvgd47qfvv4s805lwiz79jbqcxzd7zdyax7";
};
nativeBuildInputs = [ cmake perl ];
buildInputs = [ recode ];
preConfigure = ''
cp ${srcs.shlomifCommon} cmake/Shlomif_Common.cmake
'';
cmakeFlags = [
"-DLOCALDIR=${placeholder "out"}/share/fortunes"
];
postInstall = ''
mv $out/games/fortune $out/bin/fortune
rm -r $out/games
'';
patches = [ (builtins.toFile "not-a-game.patch" ''
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 865e855..5a59370 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -154,7 +154,7 @@ ENDMACRO()
my_exe(
"fortune"
"fortune/fortune.c"
- "games"
+ "bin"
)
my_exe(
--
'') ];
meta = with stdenv.lib; {
description = "A program that displays a pseudorandom message from a database of quotations";