about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-09-13 10:47:27 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-09-15 02:40:50 +0000
commitf61a9fa77930dc473f721c61529b80a76cd8a124 (patch)
tree09ca7f2188a329c415de9a5ffd5d9e50a81fd879 /pkgs
parent4b790413b4cb67615f2efcdde5066d9c57138369 (diff)
robotfindskitten: refactor
- Use finalAttrs
- Change source to github
- Split output
- Add meta.mainProgram
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/games/robotfindskitten/default.nix49
1 files changed, 34 insertions, 15 deletions
diff --git a/pkgs/games/robotfindskitten/default.nix b/pkgs/games/robotfindskitten/default.nix
index 382c2ef71ae28..a955d337753ef 100644
--- a/pkgs/games/robotfindskitten/default.nix
+++ b/pkgs/games/robotfindskitten/default.nix
@@ -1,30 +1,49 @@
-{ lib, stdenv, fetchurl, pkg-config, ncurses }:
-
-with lib;
-stdenv.mkDerivation rec {
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, ncurses
+, pkg-config
+, texinfo
+}:
 
+stdenv.mkDerivation (finalAttrs: {
   pname = "robotfindskitten";
   version = "2.8284271.702";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/project/rfk/robotfindskitten-POSIX/ship_it_anyway/${pname}-${version}.tar.gz";
-    sha256 = "1bwrkxm83r9ajpkd6x03nqvmdfpf5vz6yfy0c97pq3v3ykj74082";
+  src = fetchFromGitHub {
+    owner = "robotfindskitten";
+    repo = "robotfindskitten";
+    rev = finalAttrs.version;
+    hash = "sha256-z6//Yfp3BtJAtUdY05m1eKVrTdH19MvK7LZOwX5S1CM=";
   };
 
-  nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ ncurses ];
+  outputs = [ "out" "man" "info" ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    texinfo
+  ];
+
+  buildInputs = [
+    ncurses
+  ];
 
-  makeFlags = [ "execgamesdir=$(out)/bin" ];
+  makeFlags = [
+    "execgamesdir=$(out)/bin"
+  ];
 
   postInstall = ''
-    install -Dm644 {nki,$out/share/games/robotfindskitten}/vanilla.nki
+    install -Dm644 nki/vanilla.nki -t $out/share/games/robotfindskitten/
   '';
 
   meta = {
     description = "Yet another zen simulation; A simple find-the-kitten game";
     homepage = "http://robotfindskitten.org/";
-    license = licenses.gpl2;
-    maintainers = [ maintainers.AndersonTorres ];
-    platforms = platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    mainProgram = "robotfindskitten";
+    maintainers = [ lib.maintainers.AndersonTorres ];
+    platforms = lib.platforms.unix;
   };
-}
+})