about summary refs log tree commit diff
path: root/nixpkgs/pkgs/games/otto-matic/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/games/otto-matic/default.nix')
-rw-r--r--nixpkgs/pkgs/games/otto-matic/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/games/otto-matic/default.nix b/nixpkgs/pkgs/games/otto-matic/default.nix
new file mode 100644
index 000000000000..800b97b2b86e
--- /dev/null
+++ b/nixpkgs/pkgs/games/otto-matic/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, SDL2, cmake, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "OttoMatic";
+  version = "4.0.1";
+
+  src = fetchFromGitHub {
+    owner = "jorio";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-0mqOAdAmJGxKa6yXktrbmdXkoQIliimq37iy9bCBZYg=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    cmake
+    makeWrapper
+  ];
+
+  buildInputs = [
+    SDL2
+  ];
+
+  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p "$out/bin"
+    mkdir -p "$out/share/OttoMatic"
+    mv Data ReadMe.txt "$out/share/OttoMatic/"
+    install -Dm755 {.,$out/bin}/OttoMatic
+    wrapProgram $out/bin/OttoMatic --chdir "$out/share/OttoMatic"
+    install -Dm644 $src/packaging/io.jor.ottomatic.desktop $out/share/applications/io.jor.ottomatic.desktop
+    install -Dm644 $src/packaging/io.jor.ottomatic.png $out/share/pixmaps/io.jor.ottomatic.png
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A port of Otto Matic, a 2001 Macintosh game by Pangea Software, for modern operating systems";
+    homepage = "https://github.com/jorio/OttoMatic";
+    license = licenses.cc-by-sa-40;
+    maintainers = with maintainers; [ lux ];
+    platforms = platforms.linux;
+  };
+}