about summary refs log tree commit diff
path: root/pkgs/applications/misc/johnny-reborn
diff options
context:
space:
mode:
authorPedroHLC ☭ <root@pedrohlc.com>2023-07-13 13:11:45 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-07-13 21:23:57 -0300
commitf3783908dd381e5abc2a34daffcb8b4d816562e4 (patch)
tree0b969bdaed4baf314cb5f0ad278c18f0cbbe150b /pkgs/applications/misc/johnny-reborn
parent58ee7a1f3f291cd5c6feb257413c36116ee6760f (diff)
johnny-reborn: init at unstable-2020-12-06
Diffstat (limited to 'pkgs/applications/misc/johnny-reborn')
-rw-r--r--pkgs/applications/misc/johnny-reborn/default.nix38
-rw-r--r--pkgs/applications/misc/johnny-reborn/with-data.nix63
2 files changed, 101 insertions, 0 deletions
diff --git a/pkgs/applications/misc/johnny-reborn/default.nix b/pkgs/applications/misc/johnny-reborn/default.nix
new file mode 100644
index 0000000000000..5a512b0466e76
--- /dev/null
+++ b/pkgs/applications/misc/johnny-reborn/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, SDL2
+}:
+
+stdenv.mkDerivation {
+  pname = "johnny-reborn-engine";
+  version = "unstable-2020-12-06";
+
+  src = fetchFromGitHub {
+    owner = "jno6809";
+    repo = "jc_reborn";
+    rev = "524a5803e4fa65f840379c781f40ce39a927032e";
+    hash = "sha256-YKAOCgdRnvNMzL6LJVXN0pLvjyJk4Zv/RCqGtDPFR90=";
+  };
+
+  makefile = "Makefile.linux";
+
+  buildInputs = [ SDL2 ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out
+    cp jc_reborn $out/
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "An open-source engine for the classic \"Johnny Castaway\" screensaver (engine only)";
+    homepage = "https://github.com/jno6809/jc_reborn";
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ pedrohlc ];
+    inherit (SDL2.meta) platforms;
+  };
+}
diff --git a/pkgs/applications/misc/johnny-reborn/with-data.nix b/pkgs/applications/misc/johnny-reborn/with-data.nix
new file mode 100644
index 0000000000000..1e53edaa5b85a
--- /dev/null
+++ b/pkgs/applications/misc/johnny-reborn/with-data.nix
@@ -0,0 +1,63 @@
+{ lib
+, stdenvNoCC
+, fetchFromGitHub
+, fetchzip
+, johnny-reborn-engine
+, makeWrapper
+}:
+
+stdenvNoCC.mkDerivation {
+  pname = "johnny-reborn";
+  inherit (johnny-reborn-engine) version;
+
+  srcs =
+    let
+      sounds = fetchFromGitHub {
+        owner = "nivs1978";
+        repo = "Johnny-Castaway-Open-Source";
+        rev = "be6afefd43a3334acc66fc9d777c162c8bfb9558";
+        hash = "sha256-rtZVCn4KbEBVwaSQ4HZhMoDEI5Q9IPj9SZywgAx0MPY=";
+      };
+
+      resources = fetchzip {
+        name = "scrantic-source";
+        url = "https://archive.org/download/johnny-castaway-screensaver/scrantic-run.zip";
+        hash = "sha256-Q9chCYReOQEmkTyIkYo+D+OXYUqxPNOOEEmiFh8yaw4=";
+        stripRoot = false;
+      };
+    in
+    [
+      sounds
+      resources
+    ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  sourceRoot = "source";
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out
+    cp -t $out/ \
+      ../scrantic-source/RESOURCE.* \
+      JCOS/Resources/sound*.wav
+
+    makeWrapper \
+      ${johnny-reborn-engine}/jc_reborn \
+      $out/jc_reborn \
+      --chdir $out
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "An open-source engine for the classic \"Johnny Castaway\" screensaver (ready to use, with resources)";
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ pedrohlc ];
+    inherit (johnny-reborn-engine.meta) homepage platforms;
+  };
+}