about summary refs log tree commit diff
path: root/nixpkgs/pkgs/games/antsimulator/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/games/antsimulator/default.nix')
-rw-r--r--nixpkgs/pkgs/games/antsimulator/default.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/games/antsimulator/default.nix b/nixpkgs/pkgs/games/antsimulator/default.nix
index b43b91d5cb99..bac481c88f35 100644
--- a/nixpkgs/pkgs/games/antsimulator/default.nix
+++ b/nixpkgs/pkgs/games/antsimulator/default.nix
@@ -2,20 +2,31 @@
 
 stdenv.mkDerivation rec {
   pname = "antsimulator";
-  version = "1.2";
+  version = "3.1";
 
   src = fetchFromGitHub {
     owner = "johnBuffer";
     repo = "AntSimulator";
     rev = "v${version}";
-    sha256 = "0wz80971rf86kb7mcnxwrq75vriwhmyir5s5n3wzml12rzfnj5f1";
+    sha256 = "sha256-1KWoGbdjF8VI4th/ZjAzASgsLEuS3xiwObulzxQAppA=";
   };
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ sfml ];
 
+  postPatch = ''
+    substituteInPlace src/main.cpp \
+      --replace "res/" "$out/opt/antsimulator/"
+
+    substituteInPlace include/simulation/config.hpp \
+      --replace "res/" "$out/opt/antsimulator/"
+
+    substituteInPlace include/render/colony_renderer.hpp \
+      --replace "res/" "$out/opt/antsimulator/"
+  '';
+
   installPhase = ''
-    mkdir -p $out/bin
+    install -Dm644 -t $out/opt/antsimulator res/*
     install -Dm755 ./AntSimulator $out/bin/antsimulator
   '';