Skip to content

Instantly share code, notes, and snippets.

@doublec
Created May 28, 2014 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doublec/e49bb07b5a3f63a8746e to your computer and use it in GitHub Desktop.
Save doublec/e49bb07b5a3f63a8746e to your computer and use it in GitHub Desktop.
Building AliceML on NixOS

Add the following to your ~/.nixpkgs/config.nix:

alicemlEnv = pkgs.myEnvFun {
  name = "alicemlEnv";
  buildInputs = [ stdenv gcc smlnj libtool gnumake381 autoconf automake111x
                  zlib file which zsh vimWrapper gmp m4 gnome.gtk
                  gnome.libgnomecanvas pango sqlite libxml2 pkgconfig ];
  extraCmds = ''
   LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${gcc.gcc}/lib64
   for i in $nativeBuildInputs; do
     LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$i/lib
   done
   export LD_LIBRARY_PATH
   unset http_proxy
 '';
};

Execute:

$ nix-env -i env-alicemlEnv

Clone the aliceml repository and use the nix branch:

$ git clone git://github.com/doublec/aliceml
$ cd aliceml
$ git checkout -b nix origin/nix

Load the Nix AliceML environment:

$ load-env-alicemlEnv

Run the top level Makefile:

$ make

Add the following to the PATH after running make:

$ export PATH=$PATH:`pwd`/build/distro/bin

You can set this path after exiting the Nix AliceML environment if desired. It runs fine outside of it once build.

Run it and try some things:

$ alice
Alice 1.4 ("Kraftwerk 'Equaliser' Album") mastered 2014/05/28
### loaded signature from x-alice:/lib/system/Print
### loaded signature from x-alice:/lib/tools/Inspector
### loaded signature from x-alice:/lib/distribution/Remote
- 2+3;
val it : int = 5
- inspect 5;
...GUI inspector starts...
- exit();

Ideally I'd have a build definition that installs it in the users profile but I haven't got this working yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment