summary refs log tree commit diff
path: root/pkgs/development/libraries/fuzzylite/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/fuzzylite/default.nix')
-rw-r--r--pkgs/development/libraries/fuzzylite/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/development/libraries/fuzzylite/default.nix b/pkgs/development/libraries/fuzzylite/default.nix
new file mode 100644
index 00000000000..b6c7767a8d6
--- /dev/null
+++ b/pkgs/development/libraries/fuzzylite/default.nix
@@ -0,0 +1,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 = "source/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;
+  };
+}