1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5, ninja
6, useFloat ? false
7}:
8
9stdenv.mkDerivation rec {
10 pname = "fuzzylite";
11 version = "6.0";
12
13 src = fetchFromGitHub {
14 owner = "fuzzylite";
15 repo = "fuzzylite";
16 rev = "v${version}";
17 hash = "sha256-i1txeUE/ZSRggwLDtpS8dd4uuZfHX9w3zRH0gBgGXnk=";
18 };
19 sourceRoot = "${src.name}/fuzzylite";
20
21 outputs = [ "out" "dev" ];
22
23 postPatch = ''
24 substituteInPlace CMakeLists.txt \
25 --replace "-Werror" "-Wno-error"
26 '';
27
28 nativeBuildInputs = [
29 cmake
30 ninja
31 ];
32
33 cmakeFlags = [
34 "-DFL_BUILD_TESTS:BOOL=OFF"
35 "-DFL_USE_FLOAT:BOOL=${if useFloat then "ON" else "OFF"}"
36 ];
37
38 meta = with lib; {
39 description = "Fuzzy logic control library in C++";
40 mainProgram = "fuzzylite";
41 homepage = "https://fuzzylite.com";
42 changelog = "https://github.com/fuzzylite/fuzzylite/${src.rev}/release/CHANGELOG";
43 license = licenses.gpl3Only;
44 maintainers = with maintainers; [ azahi ];
45 platforms = platforms.all;
46 };
47}