nixpkgs-suyu/pkgs/games/antsimulator/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1 KiB
Nix
Raw Normal View History

2021-04-06 02:02:41 +02:00
{ lib, stdenv, fetchFromGitHub, cmake, sfml }:
stdenv.mkDerivation rec {
pname = "antsimulator";
2021-08-10 13:05:35 +02:00
version = "3.1";
2021-04-06 02:02:41 +02:00
src = fetchFromGitHub {
owner = "johnBuffer";
repo = "AntSimulator";
rev = "v${version}";
2021-08-10 13:05:35 +02:00
sha256 = "sha256-1KWoGbdjF8VI4th/ZjAzASgsLEuS3xiwObulzxQAppA=";
2021-04-06 02:02:41 +02:00
};
nativeBuildInputs = [ cmake ];
buildInputs = [ sfml ];
2021-08-11 03:31:46 +02:00
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/"
'';
2021-04-06 02:02:41 +02:00
installPhase = ''
2021-08-11 03:31:46 +02:00
install -Dm644 -t $out/opt/antsimulator res/*
2021-04-06 02:02:41 +02:00
install -Dm755 ./AntSimulator $out/bin/antsimulator
'';
meta = with lib; {
homepage = "https://github.com/johnBuffer/AntSimulator";
description = "Simple Ants simulator";
license = licenses.free;
maintainers = with maintainers; [ ivar ];
platforms = platforms.unix;
};
}