1{ lib, stdenv, fetchFromGitHub, pkg-config, jansson }:
2
3let
4 libsailing = fetchFromGitHub {
5 owner = "sails-simulator";
6 repo = "libsailing";
7 rev = "9b2863ff0c539cd23d91b0254032a7af9c840574";
8 sha256 = "06rcxkwgms9sxqr1swnnc4jnvgs0iahm4cksd475yd1bp5p1gq6j";
9 };
10in
11stdenv.mkDerivation rec {
12 version = "0.3.0";
13 pname = "sailsd";
14 src = fetchFromGitHub {
15 owner = "sails-simulator";
16 repo = "sailsd";
17 rev = version;
18 sha256 = "1s4nlffp683binbdxwwzbsci61kbjylbcr1jf44sv1h1r5d5js05";
19 };
20
21 nativeBuildInputs = [ pkg-config ];
22 buildInputs = [ jansson libsailing ];
23
24 INSTALL_PATH = "$(out)";
25
26 postUnpack = ''
27 rmdir $sourceRoot/libsailing
28 cp -r ${libsailing} $sourceRoot/libsailing
29 chmod 755 -R $sourceRoot/libsailing
30 '';
31
32 patchPhase = ''
33 substituteInPlace Makefile \
34 --replace gcc cc
35 '';
36
37 meta = with lib; {
38 description = "Simulator daemon for autonomous sailing boats";
39 homepage = "https://github.com/sails-simulator/sailsd";
40 license = licenses.gpl3;
41 longDescription = ''
42 Sails is a simulator designed to test the AI of autonomous sailing
43 robots. It emulates the basic physics of sailing a small single sail
44 boat'';
45 maintainers = with maintainers; [ kragniz ];
46 platforms = platforms.all;
47 };
48}