the nix way

On linux, install either jack1 or jack2. JACK support is mostly untested and probably doesn’t work, since I don’t do music on linux. Get in touch if you can help with linux support.

Install nix and cachix. I upload build results to cachix so if you use that you can avoid building them. Of course if you like building you can skip all the cachix steps:

### Standard nix install, skip if you already have nix:
bash <(curl -L https://nixos.org/nix/install)
# On my laptop, nix installed with a max-jobs of 32, which is nuts on a
# laptop with only 4 cores, and totally wedges it up.
# Edit /etc/nix/nix.conf and possibly get max-jobs under control.

### Install cachix, skip if you like building:
nix-env -iA cachix -f https://cachix.org/api/v1/install
# Configure nix to use my cachix cache.
# sudo is necessary because it wants to modify /etc/nix/nix.conf.
sudo cachix use elaforge
# Get nix-daemon to see the new config.  This may be unnecessary if
# you did a single user nix install above:
systemd-linux> sudo systemctl restart nix-daemon
osx> sudo launchctl stop org.nixos.nix-daemon
osx> sudo launchctl start org.nixos.nix-daemon

### Actually do the install:
tools/nix-enter

This will download tons of stuff, and drop you in a subshell where that stuff is available. After this you’ll need to run tools/nix-enter whenever you want to build. I use a special color on PS1 when SHLVL > 1 to indicate the subshell.

On OS X, by default you do not even have to install the commandline compiler tools, because it will use the ones from nix.

This gets the “everything” build including “im” below. Since my build file is a mess, the non-im build is broken and I don’t feel like fixing it at the moment. I’ll probably just make the everything build the only build, now that nix makes it easy.

Now do the rest of the build steps, same as “the traditional way” below:

Ignore the rest of this file!

the traditional way

This is a lot more work than the nix way!

Non-Haskell dependencies

Haskell dependencies

You can do this either the cabal v1 way or the v2 way.

cabal v2 way

Cabal v2 is supposed to replace v1 some day. It has some problems I’m hopefully able to work around. Firstly, it can’t build hlibgit2 from hackage, but can from head. Or at least it couldn’t when I wrote this. So clone that to some local directory, and update cabal.project to point to that path if it’s not /usr/local/src. Then build dependencies with:

cabal v2-configure
cabal v2-build --only-dep

If configure is unhappy about versions, remove cabal.project.freeze and try again. Then do mkmk and continue the steps documented above. Hopefully this is enough to make it work!

cabal v1 way

I’m going to call this obsolete and delete it.

stack way

I removed this because no one ever used it. There’s not much reason to use stack any more.

音, Im, Synth

These are all names for the offline synthesizer. It requires a bunch of extra dependencies. If you did the nix way, then you’ll already have them.

Otherwise, here are old docs for installing by hand, the non-nix way:

First you need more non-haskell dependencies. Get the -dev versions as usual:

Misc

tools/run_profile expects ps2pdf in the path, which is part of ghostscript. It’s fine if it’s not, but you’ll get ps instead of pdf. Help with heap profiling would be very welcome!