To build Matterhorn from source, there are two options:
-
Clone the repo and follow the "Build from repo" instructions below, or
-
Fetch the latest
.tar.gz
source from GitHub and follow the "Build from tarball" instructions below.
In either case, first follow these steps:
- Install ghcup.
- Install GHC with
ghcup install
. - Install Cabal with
ghcup install-cabal
. - Add
~/.ghcup/bin
to yourPATH
. - Run
cabal new-update
On Ubuntu systems, you may need to first install the zlib1g-dev
package.
Before building Matterhorn from source, you'll need a GitHub account. By default, a GitHub account is necessary to fetch the submodule sources. (If you need to do a source build but don't have an SSH key present for GitHub access, you'll need to change the submodule URLs; see below.)
- Clone the
matterhorn
source:git clone [email protected]:matterhorn-chat/matterhorn.git
cd matterhorn
- Fetch submodules with
git submodule update --init
- Do a local build with
./build.sh
or build a release with./scripts/local-mkrelease.sh
. - Local builds can be run with
./run.sh
; to run a binary release, just unpack the archive and run thematterhorn
binary found therein.
The repository comes configured with submodules that use SSH URLs to
fetch from GitHub. If you need to use HTTPS URLs (e.g. if you don't have
an SSH key present for GitHub access or don't have a GitHub account),
you'll need to edit the .gitmodules
file and convert the submodule
URLs to HTTPS. Then run git submodule sync
.
- Unpack the latest
.tar.gz
release from GitHub. cd matterhorn-<VERSION>
rm cabal.project
- Do a local build with
./build.sh
or build a release with./scripts/local-mkrelease.sh
. - Local builds can be run with
./run.sh
; to run a binary release, just unpack the archive and run thematterhorn
binary found therein.