Verified Commit a522479e authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-openalex

parents b6c47c1a aeed0f7b
Pipeline #4311 canceled with stages
......@@ -13,6 +13,7 @@ if [[ $1 == "dev" ]] ;
echo "DEV install"
env LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 stack --nix install --no-install-ghc --skip-ghc-check --no-haddock-deps
else
echo "PROD install (with documentation)"
env LANG=C.UTF-8 stack install --haddock --nix --test --no-install-ghc --skip-ghc-check --no-haddock-deps
echo "PROD install (with documentation)"
nix-shell --run "cabal install"
#env LANG=C.UTF-8 stack install --haddock --nix --test --no-install-ghc --skip-ghc-check --no-haddock-deps
fi
#!/usr/bin/env bash
hpack
cabal v2-update 'hackage.haskell.org,2023-06-25T00:00:00Z'
cabal v2-install hpack-0.35.0 --overwrite-policy=always
cabal v2-install stack2cabal-1.0.14 --overwrite-policy=always
stack2cabal --no-run-hpack -p '2023-06-25'
......@@ -357,3 +357,87 @@ ON context_node_ngrams(context_id, ngrams_id);
CREATE INDEX IF NOT EXISTS node_stories_ngrams_id_idx
ON node_stories(ngrams_id);
----
-- Version 0.0.6.9.9.6.4.sql
-- ADD triggers
CREATE OR REPLACE FUNCTION check_node_stories_json()
RETURNS TRIGGER AS $$
DECLARE
missing_ngrams_exist boolean;
BEGIN
WITH child_ngrams as
(SELECT jsonb_array_elements_text(NEW.ngrams_repo_element->'children') AS term),
parent_ngrams AS
(SELECT NEW.ngrams_repo_element->>'root' AS term),
ngrams_child_parent AS
(SELECT child_ngrams.term, ngrams.terms
FROM child_ngrams
LEFT JOIN ngrams ON child_ngrams.term = ngrams.terms
WHERE ngrams.terms IS NULL
UNION
SELECT parent_ngrams.term, ngrams.terms
FROM parent_ngrams
LEFT JOIN ngrams ON parent_ngrams.term = ngrams.terms
WHERE ngrams.terms IS NULL
AND parent_ngrams.term IS NOT NULL)
SELECT EXISTS(SELECT * FROM ngrams_child_parent) INTO missing_ngrams_exist;
IF missing_ngrams_exist THEN
RAISE EXCEPTION 'node_stories: ngrams are missing: %', row_to_json(NEW);
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE TRIGGER check_node_stories_json_trg
AFTER INSERT OR UPDATE
ON node_stories
FOR EACH ROW
EXECUTE PROCEDURE check_node_stories_json();
CREATE OR REPLACE FUNCTION check_ngrams_json()
RETURNS TRIGGER AS $$
DECLARE
missing_ngrams_exist boolean;
BEGIN
WITH child_ngrams as
(SELECT jsonb_array_elements_text(ngrams_repo_element->'children') AS term
FROM node_stories
WHERE term = OLD.terms),
parent_ngrams AS
(SELECT ngrams_repo_element->>'root' AS term
FROM node_stories
WHERE term = OLD.terms),
child_parent_ngrams AS
(SELECT * FROM child_ngrams
UNION SELECT * FROM parent_ngrams)
SELECT EXISTS(SELECT * FROM child_parent_ngrams) INTO missing_ngrams_exist;
IF missing_ngrams_exist THEN
RAISE EXCEPTION 'ngrams are missing: %', row_to_json(OLD);
END IF;
RETURN OLD;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE TRIGGER check_ngrams_json_trg
AFTER DELETE
ON ngrams
FOR EACH ROW
EXECUTE PROCEDURE check_ngrams_json();
......@@ -28,7 +28,7 @@ data-files:
test-data/ngrams/GarganText_NgramsTerms-QuantumComputing.json
test-data/phylo/bpa_phylo_test.json
test-data/phylo/open_science.json
.clippy.dhall
library
exposed-modules:
Gargantext
......
{ mkDerivation, array, base, bytestring, Cabal-syntax, containers
, deepseq, directory, filepath, lib, mtl, parsec, pretty, process
, text, time, transformers, unix
}:
mkDerivation {
pname = "Cabal";
version = "3.10.1.0";
sha256 = "0bdbab8e4c3178016fb0f070d8b62bc3067f93afabfbd3aa17c8065d0ecc98ee";
setupHaskellDepends = [ mtl parsec ];
libraryHaskellDepends = [
array base bytestring Cabal-syntax containers deepseq directory
filepath mtl parsec pretty process text time transformers unix
];
doCheck = false;
doHaddock = false;
homepage = "http://www.haskell.org/cabal/";
description = "A framework for packaging Haskell software";
license = lib.licenses.bsd3;
}
{ mkDerivation, array, base, binary, bytestring, containers
, deepseq, directory, filepath, lib, mtl, parsec, pretty, text
, time, transformers, unix
}:
mkDerivation {
pname = "Cabal-syntax";
version = "3.10.1.0";
sha256 = "3b80092355327768a0de8298ac50ee906b7e82462e2ba14542730573b453f522";
libraryHaskellDepends = [
array base binary bytestring containers deepseq directory filepath
mtl parsec pretty text time transformers unix
];
homepage = "http://www.haskell.org/cabal/";
description = "A library for working with .cabal files";
license = lib.licenses.bsd3;
doCheck = false;
doHaddock = false;
}
{ mkDerivation, array, async, base, base16-bytestring, binary
, bytestring, Cabal, Cabal-described ? null, cabal-install-solver
, Cabal-QuickCheck ? null, Cabal-syntax, Cabal-tree-diff ? null, containers
, cryptohash-sha256, directory, echo, edit-distance, exceptions
, filepath, hackage-security, hashable, HTTP, lib, lukko, mtl
, network-uri, parsec, pretty, pretty-show, process, QuickCheck
, random, regex-base, regex-posix, resolv, safe-exceptions, stm
, tagged, tar, tasty, tasty-expected-failure, tasty-golden
, tasty-hunit, tasty-quickcheck, text, time, tree-diff, unix, zlib
}:
mkDerivation {
pname = "cabal-install";
version = "3.10.1.0";
sha256 = "995de368555449230e0762b259377ed720798717f4dd26a4fa711e8e41c7838d";
revision = "1";
editedCabalFile = "0h1ra9kw7mk70202whiphbdyvknm7jbhqhkgw4h8abb1sgffhs3n";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
array async base base16-bytestring binary bytestring Cabal
cabal-install-solver Cabal-syntax containers cryptohash-sha256
directory echo edit-distance exceptions filepath hackage-security
hashable HTTP lukko mtl network-uri parsec pretty process random
regex-base regex-posix resolv safe-exceptions stm tar text time
unix zlib
];
executableHaskellDepends = [
base Cabal Cabal-syntax directory filepath
];
testHaskellDepends = [
array base bytestring Cabal Cabal-described cabal-install-solver
Cabal-QuickCheck Cabal-syntax Cabal-tree-diff containers directory
filepath hashable mtl network-uri pretty-show QuickCheck random
tagged tar tasty tasty-expected-failure tasty-golden tasty-hunit
tasty-quickcheck time tree-diff zlib
];
doCheck = false;
doHaddock = false;
enableExecutableProfiling = false;
postInstall = ''
mkdir -p $out/share/bash-completion
mv bash-completion $out/share/bash-completion/completions
'';
homepage = "http://www.haskell.org/cabal/";
description = "The command-line interface for Cabal and Hackage";
license = lib.licenses.bsd3;
mainProgram = "cabal";
}
{ mkDerivation, array, base, bytestring, Cabal, Cabal-syntax
, containers, edit-distance, filepath, lib, mtl, pretty, tasty
, tasty-hunit, tasty-quickcheck, transformers
}:
mkDerivation {
pname = "cabal-install-solver";
version = "3.10.1.0";
sha256 = "2c0d9edd4ccd746e9bf8ab4f92b1ecffe2f56eae29395c67ef5ca091a6f49f37";
revision = "1";
editedCabalFile = "1l3qhaiv0m2xc5vscggd2drinam1k4x0l3vfvvz15xrpvxypdv4d";
libraryHaskellDepends = [
array base bytestring Cabal Cabal-syntax containers edit-distance
filepath mtl pretty transformers
];
testHaskellDepends = [
base Cabal Cabal-syntax tasty tasty-hunit tasty-quickcheck
];
homepage = "http://www.haskell.org/cabal/";
description = "The command-line interface for Cabal and Hackage";
license = lib.licenses.bsd3;
doCheck = false;
doHaddock = false;
}
{ mkDerivation, base, filepath, lib, time, unix }:
mkDerivation {
pname = "directory";
version = "1.3.7.0";
sha256 = "9f86bd60a4909eef66907c15fc108883439b8fba3b428fb56aaa056631b62d10";
revision = "2";
editedCabalFile = "13krvs6zfswr3xndysq1bg7mz9n8mm1w7p4zcx8xjs0jqkm8hiyl";
libraryHaskellDepends = [ base filepath time unix ];
testHaskellDepends = [ base filepath time unix ];
description = "Platform-agnostic library for filesystem operations";
license = lib.licenses.bsd3;
doCheck = false;
doHaddock = false;
}
{ mkDerivation, aeson, base, base16-bytestring, base64-bytestring
, bytestring, Cabal, Cabal-syntax, containers, cryptohash-sha256
, directory, ed25519, filepath, ghc-prim, lib, lukko, mtl, network
, network-uri, parsec, pretty, QuickCheck, tar, tasty, tasty-hunit
, tasty-quickcheck, template-haskell, temporary, text, time
, transformers, unordered-containers, vector, zlib
}:
mkDerivation {
pname = "hackage-security";
version = "0.6.2.3";
sha256 = "52ee0576971955571d846b8e6c09638f89f4f7881f4a95173e44ccc0d856a066";
revision = "3";
editedCabalFile = "1vdmpklil8a6r03ixzch5d36ngimmq5q8931i8bg9f7hh8nmq8jv";
libraryHaskellDepends = [
base base16-bytestring base64-bytestring bytestring Cabal
Cabal-syntax containers cryptohash-sha256 directory ed25519
filepath ghc-prim lukko mtl network network-uri parsec pretty tar
template-haskell time transformers zlib
];
testHaskellDepends = [
aeson base bytestring Cabal Cabal-syntax containers network-uri
QuickCheck tar tasty tasty-hunit tasty-quickcheck temporary text
time unordered-containers vector zlib
];
homepage = "https://github.com/haskell/hackage-security";
description = "Hackage security library";
license = lib.licenses.bsd3;
doCheck = false;
doHaddock = false;
}
{ mkDerivation, base, bytestring, deepseq, directory, filepath, lib
, unix
}:
mkDerivation {
pname = "process";
version = "1.6.15.0";
sha256 = "44b31b6cd3129893ac1a007573dedb69dde667fa06ee108526d58f08b1a1f7ab";
libraryHaskellDepends = [ base deepseq directory filepath unix ];
testHaskellDepends = [ base bytestring directory ];
description = "Process libraries";
license = lib.licenses.bsd3;
doCheck = false;
doHaddock = false;
}
......@@ -3,6 +3,23 @@
rec {
inherit pkgs;
ghc = pkgs.haskell.compiler.ghc8107;
haskell1 = pkgs.haskell // {
packages = pkgs.haskell.packages // {
ghc8107 = pkgs.haskell.packages.ghc8107.override {
overrides = self: super: {
directory = self.callPackage ./overlays/directory-1.3.7.0.nix {};
process = self.callPackage ./overlays/process-1.6.15.0.nix {};
hackage-security = self.callPackage ./overlays/hackage-security-0.6.2.3.nix {};
Cabal = self.callPackage ./overlays/Cabal-3.10.1.0.nix {};
Cabal-syntax = self.callPackage ./overlays/Cabal-syntax-3.10.1.0.nix {};
cabal-install-solver = self.callPackage ./overlays/cabal-install-solver-3.10.1.0.nix {};
cabal-install = self.callPackage ./overlays/cabal-install-3.10.1.0.nix {};
};
};
};
};
cabal_install_3_10_1_0 = pkgs.haskell.lib.compose.justStaticExecutables haskell1.packages.ghc8107.cabal-install;
igraph_0_10_4 = pkgs.igraph.overrideAttrs (finalAttrs: previousAttrs: {
version = "0.10.4";
......@@ -60,7 +77,7 @@ rec {
});
hsBuildInputs = [
ghc
pkgs.cabal-install
cabal_install_3_10_1_0
];
nonhsBuildInputs = with pkgs; [
bzip2
......
......@@ -47,6 +47,7 @@ data-files:
- test-data/ngrams/GarganText_NgramsTerms-QuantumComputing.json
- test-data/phylo/bpa_phylo_test.json
- test-data/phylo/open_science.json
- .clippy.dhall
library:
source-dirs: src
ghc-options:
......
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