diff --git a/pkgs/development/libraries/alglib/default.nix b/pkgs/development/libraries/alglib/default.nix new file mode 100644 index 00000000000..1ff34a8d1f1 --- /dev/null +++ b/pkgs/development/libraries/alglib/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchurl, cmake, clang }: + +stdenv.mkDerivation rec { + pname = "alglib3"; + version = "3.18.0"; + + src = fetchurl { + url = "https://www.alglib.net/translator/re/alglib-${version}.cpp.gpl.tgz"; + sha256 = "0ag8dvcxzzp9riqvk4lhcbwhvh0lq54lbdnsbyr107rjfi2p1vlq"; + }; + + nativeBuildInputs = [ + cmake + clang + ]; + + patches = [ + ./patch-alglib-CMakeLists.patch + ]; + + meta = with lib; { + description = "Numerical analysis and data processing library"; + homepage = "https://www.alglib.net/"; + license = lib.licenses.gpl2Plus; + maintainers = [ maintainers.paperdigits ]; + longDescription = '' + ALGLIB is a cross-platform numerical analysis and data processing library. It supports several programming languages (C++, C#, Delphi) and several operating systems (Windows and POSIX, including Linux). ALGLIB features include: + + * Data analysis (classification/regression, statistics) + * Optimization and nonlinear solvers + * Interpolation and linear/nonlinear least-squares fitting + * Linear algebra (direct algorithms, EVD/SVD), direct and iterative linear solvers + * Fast Fourier Transform and many other algorithms + ''; + }; +} diff --git a/pkgs/development/libraries/alglib/patch-alglib-CMakeLists.patch b/pkgs/development/libraries/alglib/patch-alglib-CMakeLists.patch new file mode 100644 index 00000000000..b91a0c0aefd --- /dev/null +++ b/pkgs/development/libraries/alglib/patch-alglib-CMakeLists.patch @@ -0,0 +1,23 @@ +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,20 @@ ++cmake_minimum_required(VERSION 2.8) ++ ++project(alglib3 CXX) ++ ++file(GLOB_RECURSE sources src/*.cpp) ++file(GLOB_RECURSE headers src/*.h) ++ ++add_library(${PROJECT_NAME} STATIC ${sources} ${headers}) ++ ++install( ++ TARGETS ${PROJECT_NAME} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++ ++install( ++ FILES ${headers} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alglib ++) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45c87deb542..2c6a81382f9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1277,6 +1277,8 @@ with pkgs; aldo = callPackage ../applications/radio/aldo { }; + alglib = callPackage ../development/libraries/alglib { }; + almanah = callPackage ../applications/misc/almanah { }; alpine-make-vm-image = callPackage ../tools/virtualization/alpine-make-vm-image { };