base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / an / antsimulator / package.nix
blob204b1c50f268bbe18f884598287aea39b79337c8
1 { lib, stdenv, fetchFromGitHub, cmake, sfml }:
3 stdenv.mkDerivation rec {
4   pname = "antsimulator";
5   version = "3.1";
7   src = fetchFromGitHub {
8     owner = "johnBuffer";
9     repo = "AntSimulator";
10     rev = "v${version}";
11     sha256 = "sha256-1KWoGbdjF8VI4th/ZjAzASgsLEuS3xiwObulzxQAppA=";
12   };
14   nativeBuildInputs = [ cmake ];
15   buildInputs = [ sfml ];
17   postPatch = ''
18     substituteInPlace src/main.cpp \
19       --replace "res/" "$out/opt/antsimulator/"
21     substituteInPlace include/simulation/config.hpp \
22       --replace "res/" "$out/opt/antsimulator/"
24     substituteInPlace include/render/colony_renderer.hpp \
25       --replace "res/" "$out/opt/antsimulator/"
26   '';
28   installPhase = ''
29     install -Dm644 -t $out/opt/antsimulator res/*
30     install -Dm755 ./AntSimulator $out/bin/antsimulator
31   '';
33   meta = with lib; {
34     homepage = "https://github.com/johnBuffer/AntSimulator";
35     description = "Simple Ants simulator";
36     mainProgram = "antsimulator";
37     license = licenses.mit;
38     maintainers = [ ];
39     platforms = platforms.unix;
40   };