Commit e7f9cf26 authored by Julien Moutinho's avatar Julien Moutinho

build: add support for `haskell.nix`

parent 71548e0b
......@@ -45,3 +45,8 @@ devops/docker/js-cache
cabal.project.local
gargantext_profile_out.dot
# Nix
!flake.lock
cabal.project.flake
nix/cache/roots
This diff is collapsed.
This diff is collapsed.
From 64cd06549f19ad447f18a45d872b59b2b2db9135 Mon Sep 17 00:00:00 2001
From: Julien Moutinho <julm+gargantext@sourcephile.fr>
Date: Wed, 28 Jun 2023 23:07:32 +0200
Subject: [PATCH] remove test using removed `realBandedGramian`
---
test/Test.hs | 1 -
test/Test/Data/Array/Accelerate/Arithmetic/Sparse.hs | 7 -------
2 files changed, 8 deletions(-)
diff --git a/test/Test.hs b/test/Test.hs
index ebc140f..ea736ee 100644
--- a/test/Test.hs
+++ b/test/Test.hs
@@ -10,7 +10,6 @@ import Test.QuickCheck (quickCheck)
test :: IO ()
test = mapM_ (\(msg,act) -> putStr (msg++": ") >> act) $
("sparseMatrix", quickCheck (\(Mod.Blind x) -> Sparse.multiplication x)) :
- ("bandedGramian", quickCheck (\(Mod.Blind x) -> Sparse.bandedGramian x)) :
("flattenMatrix", quickCheck (\(Mod.Blind x) -> LinAlg.flattenMatrix x)) :
("restoreMatrix", quickCheck (\(Mod.Blind x) -> LinAlg.restoreMatrix x)) :
("flattenRestoreMatrix", quickCheck (\(Mod.Blind x) -> LinAlg.flattenRestoreMatrix x)) :
diff --git a/test/Test/Data/Array/Accelerate/Arithmetic/Sparse.hs b/test/Test/Data/Array/Accelerate/Arithmetic/Sparse.hs
index da497dd..15e7e51 100644
--- a/test/Test/Data/Array/Accelerate/Arithmetic/Sparse.hs
+++ b/test/Test/Data/Array/Accelerate/Arithmetic/Sparse.hs
@@ -73,10 +73,3 @@ instance (QC.Arbitrary a, A.Elt a) => QC.Arbitrary (BandGramian a) where
return $
BandGramian (A.lift width)
(Sparse.Rows (A.lift cols) (A.use m))
-
-
-bandedGramian :: BandGramian Word32 -> Bool
-bandedGramian (BandGramian width m) =
- Sparse.multiplyColumnsRows (Sparse.transposeRows m) m
- =!=
- BandMatrix.flattenSymmetric (Sparse.realBandedGramian width m)
--
2.40.1
From d925fe838d4b4ebf7f2f39ddcdd3c4a6c5b0e938 Mon Sep 17 00:00:00 2001
From: Julien Moutinho <julm+c2hs@sourcephile.fr>
Date: Wed, 13 Mar 2024 22:50:59 +0100
Subject: [PATCH 2/2] fix GHC path to support cross-compiling
---
src/C2HS/Gen/Bind.hs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/C2HS/Gen/Bind.hs b/src/C2HS/Gen/Bind.hs
index fc2a3d0..d97e16f 100644
--- a/src/C2HS/Gen/Bind.hs
+++ b/src/C2HS/Gen/Bind.hs
@@ -134,6 +134,7 @@ import qualified Foreign.Storable as Storable (Storable(alignment),
Storable(sizeOf))
import Foreign (Ptr, FunPtr)
import Foreign.C
+import GHC.Paths (ghc)
-- Language.C / compiler toolkit
import Language.C.Data.Position
@@ -3136,7 +3137,7 @@ cCompiler = unsafePerformIO $ do
case mcc of
Just cc -> return cc
Nothing -> do
- (code, stdout, _) <- readProcessWithExitCode "ghc" ["--info"] ""
+ (code, stdout, _) <- readProcessWithExitCode ghc ["--info"] ""
when (code /= ExitSuccess) $
error "Failed to determine C compiler from 'ghc --info'!"
let vals = read stdout :: [(String, String)]
--
2.42.0
--- a/lib/cgraph/scan.l
+++ b/lib/cgraph/scan.l
@@ -32,7 +32,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
-// #define YY_BUF_SIZE 128000
+#define YY_BUF_SIZE 128000
#define GRAPH_EOF_TOKEN '@' /* lex class must be defined below */
/* this is a workaround for linux flex */
static int line_num = 1;
\ No newline at end of file
......@@ -18,8 +18,10 @@ import qualified Test.Database.Operations as DB
startCoreNLPServer :: IO ProcessHandle
startCoreNLPServer = do
devNull <- openFile "/dev/null" WriteMode
let p = proc "./startServer.sh" []
(_, _, _, hdl) <- (createProcess $ p { cwd = Just "devops/coreNLP/stanford-corenlp-current"
-- Make the CoreNLP server configurable by an envvar, eg. set by nix develop
startServer <- lookupEnv "GARGANTEXT_CORENLP_SERVER"
let p = proc (fromMaybe "./startServer.sh" <$> startServer) []
(_, _, _, hdl) <- (createProcess $ p { cwd = maybe (Just "devops/coreNLP/stanford-corenlp-current") Nothing startServer
, delegate_ctlc = True
, create_group = True
, std_out = UseHandle devNull
......
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