Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fortune-mod update from 1.99.1 to 2.6.2 #55107

Closed
Vonfry opened this issue Feb 3, 2019 · 3 comments · Fixed by #55171
Closed

fortune-mod update from 1.99.1 to 2.6.2 #55107

Vonfry opened this issue Feb 3, 2019 · 3 comments · Fixed by #55171

Comments

@Vonfry
Copy link
Member

Vonfry commented Feb 3, 2019

Issue description

The version on nixpkgs is too old.

Scripts

I try to make a pull request for this, but it is failed to build. I have no idea how to fix it.

patch:

diff --git a/pkgs/tools/misc/fortune/default.nix b/pkgs/tools/misc/fortune/default.nix
index 8e955733598..81256cd0e6d 100644
--- a/pkgs/tools/misc/fortune/default.nix
+++ b/pkgs/tools/misc/fortune/default.nix
@@ -1,28 +1,25 @@
-{ stdenv, fetchurl, recode }:
+{ stdenv, fetchurl, cmake, recode }:

 stdenv.mkDerivation {
-  name = "fortune-mod-1.99.1";
+  name = "fortune-mod-2.6.2";

   src = fetchurl {
-    url = http://ftp.de.debian.org/debian/pool/main/f/fortune-mod/fortune-mod_1.99.1.orig.tar.gz;
-    sha256 = "1kpa2hgbglj5dbfasvl9wc1q3xpl91mqn3sfby46r4rwyzhswlgw";
+    url = https://github.com/shlomif/fortune-mod/archive/fortune-mod-2.6.2.tar.gz;
+    sha256 = "89223bb649ea62b030527f181539182d6a17a1a43b0cc499a52732b839f7b691";
   };

-  buildInputs = [ recode ];
+  sourceRoot = "fortune-mod-fortune-mod-2.6.2/fortune-mod";

-  preConfigure = ''
-    sed -i "s|/usr/|$out/|" Makefile
+  buildInputs = [ cmake recode ];
+
+  configureScript = ''
+    cmake -DCMAKE_INSTALL_PREFIX=$out .
   '';

   preBuild = ''
     makeFlagsArray=("CC=$CC" "REGEXDEFS=-DHAVE_REGEX_H -DPOSIX_REGEX" "LDFLAGS=")
   '';

-  postInstall = ''
-    mv $out/games/fortune $out/bin/fortune
-    rmdir $out/games
-  '';
-
   meta = with stdenv.lib; {
     description = "A program that displays a pseudorandom message from a database of quotations";
     license = licenses.bsdOriginal;

The failure is mainly that cmake cannot find a command defined in another cmake file.

But if I run cmake within nix-shell -p recode cmake, it successes. And have another error with make.

This may fix shlomif/fortune-mod#33.

@cleverca22
Copy link
Contributor

CMake Warning at cmake/shlomif_common_bootstrap.cmake:7 (MESSAGE):
  Could not find Shlomif_Common.cmake - you can find it here:
  https://bitbucket.org/shlomif/shlomif-cmake-modules/overview ; trying to
  download it for you.
Call Stack (most recent call first):
  CMakeLists.txt:3 (INCLUDE)

cmake is trying to download things at build-time, and nix is blocking network access
cmake then silently omits the network error, and tries to use the file it doesnt have

@cleverca22
Copy link
Contributor

https://github.com/shlomif/fortune-mod/blob/master/fortune-mod/cmake/shlomif_common_bootstrap.cmake#L8
this file will need to be fetched using fetchurl and then copied to the right spot in preConfigure

@shlomif
Copy link

shlomif commented Feb 5, 2019

Hi all!

Note that I provide release tar.xz s here: https://www.shlomifish.org/open-source/projects/fortune-mod/arcs/ . Perhaps I should attach them to the github tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants