diff --git a/pkgs/tools/misc/fortune/default.nix b/pkgs/tools/misc/fortune/default.nix index 871f113a41dd..74c21d21fcc3 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 - ''; + 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";