]> Git — Sourcephile - gargantext.git/blob - nix/pkgs.nix
[FIX] admin
[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 haskell1 = pkgs.haskell // {
7 packages = pkgs.haskell.packages // {
8 ghc8107 = pkgs.haskell.packages.ghc8107.override {
9 overrides = self: super: {
10 directory = self.callPackage ./overlays/directory-1.3.7.0.nix {};
11 process = self.callPackage ./overlays/process-1.6.15.0.nix {};
12 hackage-security = self.callPackage ./overlays/hackage-security-0.6.2.3.nix {};
13 Cabal = self.callPackage ./overlays/Cabal-3.10.1.0.nix {};
14 Cabal-syntax = self.callPackage ./overlays/Cabal-syntax-3.10.1.0.nix {};
15 cabal-install-solver = self.callPackage ./overlays/cabal-install-solver-3.10.1.0.nix {};
16 cabal-install = self.callPackage ./overlays/cabal-install-3.10.1.0.nix {};
17 };
18 };
19 };
20 };
21 cabal_install_3_10_1_0 = pkgs.haskell.lib.compose.justStaticExecutables haskell1.packages.ghc8107.cabal-install;
22
23 igraph_0_10_4 = pkgs.igraph.overrideAttrs (finalAttrs: previousAttrs: {
24 version = "0.10.4";
25
26 src = pkgs.fetchFromGitHub {
27 owner = "igraph";
28 repo = "igraph";
29 rev = "0.10.4";
30 hash = "sha256-LsTOxUktGZcp46Ec9QH3+9C+VADMYTZZCjKF1gp36xk=";
31 };
32
33 postPatch = ''
34 echo "0.10.4" > IGRAPH_VERSION
35 '';
36
37 outputs = [ "out" "doc" ];
38
39 buildInputs = [
40 pkgs.arpack
41 pkgs.blas
42 pkgs.glpk
43 pkgs.gmp
44 pkgs.lapack
45 pkgs.libxml2
46 pkgs.plfit
47 ] ++ pkgs.lib.optionals pkgs.stdenv.cc.isClang [
48 pkgs.llvmPackages.openmp
49 ];
50
51 cmakeFlags = [
52 "-DIGRAPH_USE_INTERNAL_BLAS=OFF"
53 "-DIGRAPH_USE_INTERNAL_LAPACK=OFF"
54 "-DIGRAPH_USE_INTERNAL_ARPACK=OFF"
55 "-DIGRAPH_USE_INTERNAL_GLPK=OFF"
56 "-DIGRAPH_USE_INTERNAL_GMP=OFF"
57 "-DIGRAPH_USE_INTERNAL_PLFIT=OFF"
58 "-DIGRAPH_GLPK_SUPPORT=ON"
59 "-DIGRAPH_GRAPHML_SUPPORT=ON"
60 "-DIGRAPH_OPENMP_SUPPORT=ON"
61 "-DIGRAPH_ENABLE_LTO=AUTO"
62 "-DIGRAPH_ENABLE_TLS=ON"
63 "-DBUILD_SHARED_LIBS=ON"
64 ];
65
66 postInstall = ''
67 mkdir -p "$out/share"
68 cp -r doc "$out/share"
69 '';
70
71 postFixup = previousAttrs.postFixup + ''
72 CUR_DIR=$PWD
73 cd "$out/include/igraph" && cp *.h ../
74 cd $CUR_DIR
75 '';
76
77 });
78 hsBuildInputs = [
79 ghc
80 cabal_install_3_10_1_0
81 ];
82 nonhsBuildInputs = with pkgs; [
83 bzip2
84 czmq
85 docker-compose
86 git
87 gmp
88 gsl
89 #haskell-language-server
90 hlint
91 libffi
92 lapack
93 lzma
94 pcre
95 pkgconfig
96 postgresql
97 xz
98 zlib
99 blas
100 gfortran7
101 # gfortran7.cc.lib
102 expat
103 icu
104 graphviz
105 llvm_9
106 igraph_0_10_4
107 libpqxx
108 libsodium
109 ] ++ ( lib.optionals stdenv.isDarwin [
110 darwin.apple_sdk.frameworks.Accelerate
111 ]);
112 libPaths = pkgs.lib.makeLibraryPath nonhsBuildInputs;
113 shellHook = ''
114 export LD_LIBRARY_PATH="${pkgs.gfortran7.cc.lib}:${libPaths}:$LD_LIBRARY_PATH"
115 export LIBRARY_PATH="${pkgs.gfortran7.cc.lib}:${libPaths}"
116 '';
117 shell = pkgs.mkShell {
118 name = "gargantext-shell";
119 buildInputs = hsBuildInputs ++ nonhsBuildInputs;
120 inherit shellHook;
121 };
122 }