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