about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/mu/muparser/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/mu/muparser/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/mu/muparser/package.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/mu/muparser/package.nix b/nixpkgs/pkgs/by-name/mu/muparser/package.nix
new file mode 100644
index 000000000000..12d0c6492233
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/mu/muparser/package.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, llvmPackages
+}:
+
+stdenv.mkDerivation rec {
+  pname = "muparser";
+  version = "2.3.4";
+
+  src = fetchFromGitHub {
+    owner = "beltoforion";
+    repo = "muparser";
+    rev = "v${version}";
+    hash = "sha256-hutmmhw7BHAwbDKBiK+3Yw833GL0rPGlVjlO7XzTii0=";
+  };
+
+  postPatch = ''
+    substituteInPlace muparser.pc.in \
+      --replace "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" "@CMAKE_INSTALL_FULL_LIBDIR@" \
+      --replace "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" "@CMAKE_INSTALL_FULL_INCLUDEDIR@"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = lib.optionals stdenv.cc.isClang [
+    llvmPackages.openmp
+  ];
+
+  meta = {
+    description = "An extensible high performance math expression parser library written in C++";
+    homepage = "https://beltoforion.de/en/muparser/";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ wegank ];
+    platforms = lib.platforms.unix;
+  };
+}