From 0ad74d9538e2c84be02f97512a09b34f75fbdd74 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Fri, 18 Nov 2022 17:54:57 +0000 Subject: [PATCH] docs: CLI compilation (#1359) * docs: CLI compilation * update * remove BETA * amend CLI build steps --- docs/CLI.md | 36 +++++++++++++++++++------------ docs/CONTRIBUTING.md | 11 ++++------ scripts/cabal.project.local.linux | 9 ++++++++ scripts/cabal.project.local.mac | 9 ++++++++ 4 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 scripts/cabal.project.local.linux create mode 100644 scripts/cabal.project.local.mac diff --git a/docs/CLI.md b/docs/CLI.md index f2f38ce180..555999f34f 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -85,29 +85,37 @@ move %APPDATA%/local/bin/simplex-chat.exe On Linux, you can build the chat executable using [docker build with custom output](https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs): ```shell -$ git clone git@github.com:simplex-chat/simplex-chat.git -$ cd simplex-chat -$ git checkout stable -$ DOCKER_BUILDKIT=1 docker build --output ~/.local/bin . +git clone git@github.com:simplex-chat/simplex-chat.git +cd simplex-chat +git checkout stable +DOCKER_BUILDKIT=1 docker build --output ~/.local/bin . ``` -> **Please note:** If you encounter `` version `GLIBC_2.28' not found `` error, rebuild it with `haskell:8.10.4-stretch` base image (change it in your local [Dockerfile](Dockerfile)). +> **Please note:** If you encounter `` version `GLIBC_2.28' not found `` error, rebuild it with `haskell:8.10.7-stretch` base image (change it in your local [Dockerfile](Dockerfile)). -#### Using Haskell stack +#### In any OS -Install [Haskell stack](https://docs.haskellstack.org/en/stable/README/): +1. Install [Haskell GHCup](https://www.haskell.org/ghcup/), GHC 8.10.7 and cabal: ```shell -curl -sSL https://get.haskellstack.org/ | sh +curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh ``` -and build the project: +2. Build the project: ```shell -$ git clone git@github.com:simplex-chat/simplex-chat.git -$ cd simplex-chat -$ git checkout stable -$ stack install +git clone git@github.com:simplex-chat/simplex-chat.git +cd simplex-chat +git checkout stable +# on Linux +apt-get update && apt-get install -y build-essential libgmp3-dev zlib1g-dev +cp scripts/cabal.project.local.linux cabal.project.local +# or on MacOS: +# brew install openssl@1.1 +# cp scripts/cabal.project.local.mac cabal.project.local +# you may need to amend cabal.project.local to point to the actual openssl location +cabal update +cabal install ``` ## Usage @@ -140,7 +148,7 @@ You can still talk to people using default or any other server - it only affects Run `simplex-chat -h` to see all available options. -### Access messaging servers via Tor (BETA) +### Access messaging servers via Tor Install Tor and run it as SOCKS5 proxy on port 9050, e.g. on Mac you can: diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 9ae8ec9512..b7067c0352 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -5,12 +5,9 @@ Add `cabal.project.local` to project root with the location of OpenSSL headers and libraries and flag setting encryption mode: ``` -ignore-project: False - -package direct-sqlcipher - extra-include-dirs: /opt/homebrew/opt/openssl@3/include - extra-lib-dirs: /opt/homebrew/opt/openssl@3/lib - flags: +openssl +cp scripts/cabal.project.local.mac cabal.project.local +# or +# cp scripts/cabal.project.local.linux cabal.project.local ``` -OpenSSL can be installed with `brew install openssl` +OpenSSL can be installed with `brew install openssl@1.1` diff --git a/scripts/cabal.project.local.linux b/scripts/cabal.project.local.linux new file mode 100644 index 0000000000..d5a06b7d81 --- /dev/null +++ b/scripts/cabal.project.local.linux @@ -0,0 +1,9 @@ +ignore-project: False + +# amend to point to the actual openssl location +package direct-sqlcipher + extra-include-dirs: /usr/local/opt/openssl@1.1/include + extra-lib-dirs: /usr/local/opt/openssl@1.1/lib + flags: +openssl + +test-show-details: direct diff --git a/scripts/cabal.project.local.mac b/scripts/cabal.project.local.mac new file mode 100644 index 0000000000..15db6c611c --- /dev/null +++ b/scripts/cabal.project.local.mac @@ -0,0 +1,9 @@ +ignore-project: False + +# amend to point to the actual openssl location +package direct-sqlcipher + extra-include-dirs: /opt/homebrew/opt/openssl@1.1/include + extra-lib-dirs: /opt/homebrew/opt/openssl@1.1/lib + flags: +openssl + +test-show-details: direct