Commit eb307705 authored by Alp Mestanogullari's avatar Alp Mestanogullari

make gargantext buildable with stack & cabal in a nix environment

I revamped the whole Nix infrastructure a bit to clearly delineate the bits
about providing a suitable environment (with respect to non Haskell deps) and
the shell and stack helper expressions, and moved it all under `nix/` to
make it easier to ignore (if not interested) or focus on (if interested) the Nix
infrastructure of this repository.

For some reason, this required changes that don't seem necessary in the
Docker environment, even though this all happens using the same GHC version
as used in the Docker environment/Stackage LTS snapshot.

The said changes correspond to the source repositories mentioned in the
cabal.project and stack.yaml files that have not been left untouched, for which
I either pointed to a fork I made, or a different commit that I pushed in a
dedicated branch (for the ISCPIF gitlab repositories to which I seemingly
have write access).

Many of the changes were about Haddock `-- |` style syntax being used in an
unexpected place, and this was making GHC's parser quite sad.

This commit doesn't (yet?) provide Nix infrastructure for building everything
in/through Nix, but shouldn't be too much work with something like haskell.nix,
which has suitable tooling to import stack.yaml or cabal.project based
project specifications and turn them into fully nixified builds, which might
or might not be desirable.
parent aa74cafa
Pipeline #1552 passed with stage
in 22 minutes and 24 seconds
......@@ -327,7 +327,7 @@ main = do
writePhylo phyloWithLinksFile phyloWithLinks
-- | probes
-- probes
-- writeFile ((outputPath config) <> (unpack $ phyloName config) <> "_synchronic_distance_cumu_jaccard.txt")
-- $ synchronicDistance' phylo 1
......
......@@ -24,7 +24,7 @@ import Gargantext.Prelude
import System.Environment (getArgs)
import Prelude (getLine)
-- | PosTag
-- PosTag
import Gargantext.Database.Action.Flow (indexAllDocumentsWithPosTag)
main :: IO ()
......
{ ghc
, pkgs ? import ./pinned-20.09.nix {}
}:
let
buildInputs = with pkgs; [
bzip2
git
gmp
gsl
igraph
liblapack
lzma
pcre
postgresql
xz
zlib
blas
gfortran7
gfortran7.cc.lib
];
libraryPaths = pkgs.lib.makeLibraryPath buildInputs;
in
pkgs.haskell.lib.buildStackProject rec {
inherit ghc;
inherit buildInputs;
name = "gargantext";
shellHook = ''
export LD_LIBRARY_PATH="${libraryPaths}"
export LIBRARY_PATH="${libraryPaths}"
'';
}
packages: .
allow-newer: base, accelerate
-- Patches
source-repository-package
type: git
location: https://github.com/delanoe/patches-map.git
tag: 76cae88f367976ff091e661ee69a5c3126b94694
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/patches-class.git
tag: 271ba32d6c940029dc653354dd7974a819f48e77
-- External Data API connectors
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/crawlers/pubmed.git
tag: a9d8e08a7ef82f90e29dfaced4071704a3163394
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/crawlers/isidore.git
tag: 3db385e767d2100d8abe900833c6e7de3ac55e1b
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/crawlers/istex.git
tag: daeae80365250c4bd539f0a65e271f9aa37f731f
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/crawlers/hal.git
tag: 020f5f9b308f5c23c925aedf5fb11f8b4728fb19
-- Graphs
source-repository-package
type: git
location: https://github.com/alpmestan/haskell-igraph.git
tag: 9f55eb36639c8e0965c8bc539a57738869f33e9a
-- Data mining
source-repository-package
type: git
location: https://github.com/delanoe/data-time-segment.git
tag: 10a416b9f6c443866b36479c3441ebb3bcdeb7ef
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/hlcm.git
tag: 6f0595d2421005837d59151a8b26eee83ebb67b5
source-repository-package
type: git
location: https://github.com/delanoe/hstatistics.git
tag: 90eef7604bb230644c2246eccd094d7bfefcb135
source-repository-package
type: git
location: https://github.com/paulrzcz/HSvm.git
tag: 3fe28b683aba5ddf05e3b5f8eced0bd05c5a29f9
-- servant
source-repository-package
type: git
location: https://github.com/delanoe/servant-static-th.git
tag: 8cb8aaf2962ad44d319fcea48442e4397b3c49e8
source-repository-package
type: git
location: https://github.com/alpmestan/servant-job.git
tag: e9a4c57ca3ddee450627ed251df942effb27e4be
-- Database libraries
source-repository-package
type: git
location: https://github.com/delanoe/haskell-opaleye.git
tag: 63ee65d974e9d20eaaf17a2e83652175988cbb79
source-repository-package
type: git
location: https://github.com/delanoe/hsparql.git
tag: 308c74b71a1abb0a91546fa57d353131248e3a7f
source-repository-package
type: git
location: https://github.com/alpmestan/rdf4h.git
tag: fc24987d3af348a677748f226e48d64779a694e9
-- Accelerate
source-repository-package
type: git
location: https://gitlab.iscpif.fr/anoe/accelerate.git
tag: f5c0e0071ec7b6532f9a9cd3eb33d14f340fbcc9
source-repository-package
type: git
location: https://gitlab.iscpif.fr/anoe/accelerate-utility.git
tag: 83ada76e78ac10d9559af8ed6bd4064ec81308e4
constraints: unordered-containers==0.2.13.*
\ No newline at end of file
......@@ -6,5 +6,5 @@ import (builtins.fetchGit {
url = "https://github.com/nixos/nixpkgs/";
# `git ls-remote https://github.com/nixos/nixpkgs-channels nixos-20.09`
ref = "refs/heads/nixos-20.09";
rev = "19db3e5ea2777daa874563b5986288151f502e27";
rev = "69f3a9705014ce75b0489404210995fb6f29836e";
})
import (builtins.fetchGit {
name = "nixos-21.05";
url = "https://github.com/nixos/nixpkgs";
ref = "refs/heads/nixos-21.05";
rev = "6613a30c5e3ee59753181512b4bedd4121569925";
})
{ pkgs ? import ./pinned-21.05.nix {} }:
rec {
inherit pkgs;
ghc = pkgs.haskell.compiler.ghc8104;
hsBuildInputs = [
ghc
pkgs.cabal-install
];
nonhsBuildInputs = with pkgs; [
bzip2
git
gmp
gsl
igraph
liblapack
lzma
pcre
pkgconfig
postgresql
xz
zlib
blas
gfortran7
gfortran7.cc.lib
];
libPaths = pkgs.lib.makeLibraryPath nonhsBuildInputs;
shellHook = ''
export LD_LIBRARY_PATH="${libPaths}"
export LIBRARY_PATH="${libPaths}"
'';
shell = pkgs.mkShell {
name = "gargantext-shell";
buildInputs = hsBuildInputs ++ nonhsBuildInputs;
inherit shellHook;
};
}
(import ./pkgs.nix {}).shell
let ourpkgs = import ./pkgs.nix {};
pkgs = ourpkgs.pkgs;
in
pkgs.haskell.lib.buildStackProject rec {
name = "gargantext";
ghc = ourpkgs.ghc;
buildInputs = ourpkgs.nonhsBuildInputs;
shellHook = ourpkgs.shellHook;
}
# this version of nixpkgs contains liblapack at 3.8.0
# this version of nixpkgs contains gsl at 2.5.0
import (
builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz";
sha256 = "0mhqhq21y5vrr1f30qd2bvydv4bbbslvyzclhw0kdxmkgg3z4c92";
}
)
# this version of nixpkgs contains liblapack at 3.8.0
# this version of nixpkgs contains gsl at 2.5.0
import (
builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/18.09.tar.gz";
sha256 = "1ib96has10v5nr6bzf7v8kw7yzww8zanxgw2qi1ll1sbv6kj6zpd";
}
)
{ pkgs ? import ./pinned-19.09.nix {} }:
pkgs.mkShell {
buildInputs = with pkgs; [
docker-compose
#glibc
#gmp
#gsl
#haskell-language-server
#igraph
#lorri
#pcre
#postgresql
#stack
#xz
];
}
......@@ -18,7 +18,7 @@ docker:
nix:
enable: false
add-gc-roots: true
shell-file: build-shell.nix
shell-file: nix/stack-shell.nix
allow-newer: true
......@@ -69,8 +69,8 @@ extra-deps:
# Graph libs
#- git: https://github.com/kaizhang/haskell-igraph.git
- git: https://github.com/delanoe/haskell-igraph.git
commit: 3c9dc79ff4de2ad7060ff3a527a774dff3aa6f4a
- git: https://github.com/alpmestan/haskell-igraph.git
commit: 9f55eb36639c8e0965c8bc539a57738869f33e9a
# Accelerate Linear Algebra and specific instances
# (UndecidableInstances for newer GHC version)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment