added haskell build instruction

This commit is contained in:
2025-06-06 15:43:48 +01:00
parent 54a675e0c0
commit 4c7deb948f
5 changed files with 35 additions and 2 deletions

1
.gitignore vendored
View File

@@ -31,6 +31,7 @@ server/docker/containers/
# generic folder to ignore
export/
exports/
# Any testing file
*test

View File

@@ -96,7 +96,7 @@ main =
p2prcAPI :: P2PRCapi
p2prcAPI =
MkP2PRCapi
{ startServer = spawnProcP2PRC p2prcCmdName [ MkOptAtomic "--s" ]
{ startServer = spawnProcP2PRC p2prcCmdName [ MkOptAtomic "-s" ]
, execListServers =
execProcP2PRCParser [ MkOptAtomic "--ls" ] MkEmptyStdInput

View File

@@ -116,5 +116,5 @@ eitherErrorDecode esa =
-- assumes the program is ran inside the haskell module in p2prc's repo
-- assumes that last path segment is "haskell" and that p2prc binary's name is "p2p-rendering-computation"
p2prcCmdName :: String
p2prcCmdName = "p2prc"
p2prcCmdName = "p2p-rendering-computation"

View File

@@ -14,6 +14,9 @@ sharedObjects:
python:
sh build-python-package.sh
haskell:
sh build-haskell.sh
clean:
go clean -modcache
rm -fr .go-build vendor result*

29
build-haskell.sh Normal file
View File

@@ -0,0 +1,29 @@
# This bash script consists of the manaul build script of haskell
go build .
# Unset p2prc path
unset p2prc
# Enter the haskell project
cd Bindings/haskell
# Remove exsisting export build
rm -rf exports
# Create exports directory
mkdir exports
# Copy current haskell project into the folder
cp -rf . exports/
# Copy p2prc binary inside haskell folder
cp ../../p2p-rendering-computation exports/
cd exports
# Set p2prc variable
echo export P2PRC=$PWD
export P2PRC=$PWD
./p2p-rendering-computation --dc
echo "Run the following commands in the directory: ${PWD}"
echo "To build: cabal build"
echo "To run sample program: cabal run"