]> Git — Sourcephile - gargantext.git/blob - nix/pkgs.nix
resolve the conflict
[gargantext.git] / nix / pkgs.nix
1 { pkgs ? import ./pinned-22.05.nix {} }:
2
3 rec {
4 inherit pkgs;
5 ghc = pkgs.haskell.compiler.ghc8107;
6 igraph_0_10_4 = pkgs.igraph.overrideAttrs (finalAttrs: previousAttrs: {
7 version = "0.10.4";
8
9 src = pkgs.fetchFromGitHub {
10 owner = "igraph";
11 repo = "igraph";
12 rev = "0.10.4";
13 hash = "sha256-LsTOxUktGZcp46Ec9QH3+9C+VADMYTZZCjKF1gp36xk=";
14 };
15
16 postPatch = ''
17 echo "0.10.4" > IGRAPH_VERSION
18 '';
19
20 outputs = [ "out" "doc" ];
21
22 buildInputs = [
23 pkgs.arpack
24 pkgs.blas
25 pkgs.glpk
26 pkgs.gmp
27 pkgs.lapack
28 pkgs.libxml2
29 pkgs.plfit
30 ] ++ pkgs.lib.optionals pkgs.stdenv.cc.isClang [
31 pkgs.llvmPackages.openmp
32 ];
33
34 cmakeFlags = [
35 "-DIGRAPH_USE_INTERNAL_BLAS=OFF"
36 "-DIGRAPH_USE_INTERNAL_LAPACK=OFF"
37 "-DIGRAPH_USE_INTERNAL_ARPACK=OFF"
38 "-DIGRAPH_USE_INTERNAL_GLPK=OFF"
39 "-DIGRAPH_USE_INTERNAL_GMP=OFF"
40 "-DIGRAPH_USE_INTERNAL_PLFIT=OFF"
41 "-DIGRAPH_GLPK_SUPPORT=ON"
42 "-DIGRAPH_GRAPHML_SUPPORT=ON"
43 "-DIGRAPH_OPENMP_SUPPORT=ON"
44 "-DIGRAPH_ENABLE_LTO=AUTO"
45 "-DIGRAPH_ENABLE_TLS=ON"
46 "-DBUILD_SHARED_LIBS=ON"
47 ];
48
49 postInstall = ''
50 mkdir -p "$out/share"
51 cp -r doc "$out/share"
52 '';
53
54 postFixup = previousAttrs.postFixup + ''
55 CUR_DIR=$PWD
56 cd "$out/include/igraph" && cp *.h ../
57 cd $CUR_DIR
58 '';
59
60 });
61 hsBuildInputs = [
62 ghc
63 pkgs.cabal-install
64 ];
65 nonhsBuildInputs = with pkgs; [
66 bzip2
67 czmq
68 docker-compose
69 git
70 gmp
71 gsl
72 #haskell-language-server
73 hlint
74 libffi
75 lapack
76 lzma
77 pcre
78 pkgconfig
79 postgresql
80 xz
81 zlib
82 blas
83 gfortran7
84 # gfortran7.cc.lib
85 expat
86 icu
87 graphviz
88 llvm_9
89 igraph_0_10_4
90 ] ++ ( lib.optionals stdenv.isDarwin [
91 darwin.apple_sdk.frameworks.Accelerate
92 ]);
93 libPaths = pkgs.lib.makeLibraryPath nonhsBuildInputs;
94 shellHook = ''
95 export LD_LIBRARY_PATH="${pkgs.gfortran7.cc.lib}:${libPaths}:$LD_LIBRARY_PATH"
96 export LIBRARY_PATH="${pkgs.gfortran7.cc.lib}:${libPaths}"
97 '';
98 shell = pkgs.mkShell {
99 name = "gargantext-shell";
100 buildInputs = hsBuildInputs ++ nonhsBuildInputs;
101 inherit shellHook;
102 };
103 }