about summary refs log tree commit diff
path: root/pkgs/tools/misc/fortune
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2019-09-03 11:19:00 -0500
committerWill Dietz <w@wdtz.org>2019-09-03 11:19:49 -0500
commitf0485a852418c31911c83b0ec474ffbd3fa008ef (patch)
tree1e8157c8095ef75e206d2e9e5759502ad1493858 /pkgs/tools/misc/fortune
parent460927aae77e7dddb204d7f87d3910450211eb8b (diff)
fortune: 2.6.2 -> 2.10.0, use official tarball
Diffstat (limited to 'pkgs/tools/misc/fortune')
-rw-r--r--pkgs/tools/misc/fortune/default.nix51
1 files changed, 26 insertions, 25 deletions
diff --git a/pkgs/tools/misc/fortune/default.nix b/pkgs/tools/misc/fortune/default.nix
index 871f113a41dd5..74c21d21fcc33 100644
--- a/pkgs/tools/misc/fortune/default.nix
+++ b/pkgs/tools/misc/fortune/default.nix
@@ -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
-  '';
-
-  postInstall = ''
-    mv $out/games/fortune $out/bin/fortune
-    rm -r $out/games
-  '';
+  cmakeFlags = [
+    "-DLOCALDIR=${placeholder "out"}/share/fortunes"
+  ];
+
+  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";