about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/fuzzylite/default.nix
blob: a3f70c062e867002768614bb80c7292b1522a65b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, ninja
, useFloat ? false
}:

stdenv.mkDerivation rec {
  pname = "fuzzylite";
  version = "6.0";

  src = fetchFromGitHub {
    owner = "fuzzylite";
    repo = "fuzzylite";
    rev = "v${version}";
    hash = "sha256-i1txeUE/ZSRggwLDtpS8dd4uuZfHX9w3zRH0gBgGXnk=";
  };
  sourceRoot = "${src.name}/fuzzylite";

  outputs = [ "out" "dev" ];

  postPatch = ''
    substituteInPlace CMakeLists.txt \
      --replace "-Werror" "-Wno-error"
  '';

  nativeBuildInputs = [
    cmake
    ninja
  ];

  cmakeFlags = [
    "-DFL_BUILD_TESTS:BOOL=OFF"
    "-DFL_USE_FLOAT:BOOL=${if useFloat then "ON" else "OFF"}"
  ];

  meta = with lib; {
    description = "A fuzzy logic control library in C++";
    homepage = "https://fuzzylite.com";
    changelog = "https://github.com/fuzzylite/fuzzylite/${src.rev}/release/CHANGELOG";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ azahi ];
    platforms = platforms.all;
  };
}