Skip to content

Commit f40d7e6

Browse files
committed
add mathpresso
1 parent 7e6294d commit f40d7e6

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

default.nix

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
linasm = pkgs.callPackage ./pkgs/linasm { };
2828

29+
mathpresso = pkgs.callPackage ./pkgs/mathpresso { };
30+
2931
pareto = pkgs.python39Packages.callPackage ./pkgs/pareto { };
3032

3133
pmlb = pkgs.python39Packages.callPackage ./pkgs/pmlb { };

pkgs/mathpresso/default.nix

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{ stdenv, lib, fetchFromGitHub, cmake }:
2+
let
3+
asmjit_src = fetchFromGitHub {
4+
repo = "asmjit";
5+
owner = "asmjit";
6+
rev = "70e80b18a5cc05d566e6c90dde200472c9325113";
7+
sha256 = "0if6npdx1qxvxdlkvnil8lqx3vclx2i2bliyj5xrl1ha0vnffmws";
8+
};
9+
in
10+
stdenv.mkDerivation {
11+
pname = "mathpresso";
12+
version = "git";
13+
14+
#buildInputs = [ asmjit ];
15+
16+
nativeBuildInputs = [ cmake ];
17+
cmakeFlags = [ "-DASMJIT_DIR=${asmjit_src}" ];
18+
19+
20+
src = fetchFromGitHub {
21+
repo = "mathpresso";
22+
owner = "kobalicek";
23+
rev = "abb3cd67e530aeb09a03beae60f802a4b0f3fd6d";
24+
sha256 = "1nh173kb1n00z5p11gamnl5lxk8g0lw1l8pncj9gdbvrcyyksaxh";
25+
};
26+
27+
installPhase = ''
28+
mkdir -p $out/lib
29+
mkdir -p $out/include
30+
install -m 755 ./libmathpresso.so $out/lib
31+
install -m 644 $src/src/mathpresso/mathpresso.h $out/include
32+
'';
33+
34+
meta = with lib; {
35+
description = "Mathematical expression parser and JIT compiler";
36+
license = licenses.zlib;
37+
platforms = platforms.unix;
38+
#maintainers = with maintainers; [ xxx ];
39+
};
40+
}

0 commit comments

Comments
 (0)