-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
67 lines (66 loc) · 1.75 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ system ? builtins.currentSystem, pkgs ? import <nixpkgs> { inherit system; }
}:
let
pkgs = import (fetchTarball {
url =
"https://github.com/NixOS/nixpkgs/archive/0034715d703ee02226c5708c263583a82539f2ea.tar.gz";
sha256 = "02jg1qwr3f8xagfwv5j8asyajwwgl1zmj6xaj5yfxd30l33d62y5";
}) { inherit system; };
in let
ocamlPackages = pkgs.ocaml-ng.ocamlPackages_5_2; #.overrideScope' (self: super: {
# ocaml = super.ocaml.override { flambdaSupport = true; }; });
ctypes-foreign = pkgs.lib.overrideDerivation (ocamlPackages.ctypes-foreign)
(old: {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
});
in pkgs.clangStdenv.mkDerivation {
name = "ocaml_pari";
nativeBuildInputs = (with ocamlPackages; [
ocaml
findlib
dune_3
merlin
utop
# ppx_cstubs
ctypes
containers
mdx
odoc
ocaml-lsp
hacl-star
hex
iter
qcheck
memtrace
ocamlformat
]) ++ (with pkgs; [
bison
gnumake
pkg-config
#gcc
gmp
gmpxx
#libcxx
# for linux
#glibc
#glibc.static
clang # for i-shiny objects
#nixfmt-rfc-style
ocamlformat
llvmPackages.clang-unwrapped
llvmPackages.llvm
]);
dontDetectOcamlConflicts = true;
buildInputs =
(with ocamlPackages; [ core ppx_expect ctypes odoc ctypes-foreign ]);
#LD_LIBRARY_PATH = "${pkgs.glibc}/lib:${pkgs.glibc.static}/lib";
NIX_LDFLAGS = [ "-lc -lm" ]
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ "-no_compact_unwind" ];
NIX_CFLAGS_COMPILE =
# Silence errors (-Werror) for unsupported flags on MacOS.
pkgs.lib.optionals pkgs.stdenv.isDarwin [
"-Wno-unused-command-line-argument"
"-Wmacro-redefined"
"-Wincompatible-pointer-types-discards-qualifiers"
];
}