diff options
author | Patai Gergely <patai.gergely@gmail.com> | 2016-01-13 20:57:42 +0200 |
---|---|---|
committer | Patai Gergely <patai.gergely@gmail.com> | 2016-01-13 20:57:42 +0200 |
commit | 5d869d1da1add07d926c06f6729b2ac49ed215ff (patch) | |
tree | 4a543d1f066d45b69b718449f9bb45986fdb514b | |
parent | 3b348023845eadeab94d6ffa9bcd50ea5af61e38 (diff) |
Added instructions to the readme.
-rw-r--r-- | README.md | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -1 +1,46 @@ | |||
1 | # lambdacube-gl | 1 | # lambdacube-gl |
2 | |||
3 | This is the Haskell OpenGL backend for LambdaCube. It depends on the [lambdacube-ir](https://github.com/lambdacube3d/lambdacube-ir) package. | ||
4 | |||
5 | ## Building instructions | ||
6 | |||
7 | Probably the easiest way to build this project is using [stack](https://github.com/commercialhaskell/stack/blob/master/doc/install_and_upgrade.md). | ||
8 | |||
9 | 1. Clone the [lambdacube-ir](https://github.com/lambdacube3d/lambdacube-ir) and [lambdacube-gl](https://github.com/lambdacube3d/lambdacube-gl) repositories under a common root (from now on `$LC_ROOT`). If you want to run the hello world example, clone [lambdacube-compiler](https://github.com/lambdacube3d/lambdacube-compiler) as well. | ||
10 | |||
11 | 2. If you are a Windows user, you must enable symlink support for `lambdacube-ir`. Start your Git shell as an administrator and run the following commands: | ||
12 | |||
13 | ``` | ||
14 | git config core.symlinks true | ||
15 | git reset --hard HEAD | ||
16 | ``` | ||
17 | |||
18 | 3. If you just want to build this package, simply execute `stack build` in `$LC_ROOT/lambdacube-gl`. If you want to run the hello world example, continue with the steps below | ||
19 | |||
20 | 4. Set up a local stack config in `$LC_ROOT`: | ||
21 | |||
22 | 1. Execute `stack init --resolver lts-4.1` to generate `stack.yaml`. | ||
23 | 2. Copy the `extra-deps` section from the stack config of `lambdacube-compiler` into the above file. The resulting file should look something like this (plus auto-generated comments): | ||
24 | |||
25 | ``` | ||
26 | resolver: lts-4.1 | ||
27 | packages: | ||
28 | - lambdacube-ir\lambdacube-ir.haskell\ | ||
29 | - lambdacube-gl\ | ||
30 | - lambdacube-compiler\ | ||
31 | extra-deps: | ||
32 | - indentation-0.2.1.1 | ||
33 | - pretty-compact-1.0 | ||
34 | flags: {} | ||
35 | extra-package-dbs: [] | ||
36 | ``` | ||
37 | |||
38 | 5. Execute `stack install GLFW-b` in `$LC_ROOT`. | ||
39 | |||
40 | 6. Copy `lambdacube-gl/examples` into `$LC_ROOT/examples` (so it's not part of the `lambdacube-gl` local stack, which doesn't see `lambdacube-compiler`). | ||
41 | |||
42 | 7. Copy `lambdacube-compiler/testdata/accept/{Prelude|Builtins|Internals}.lc` into `$LC_ROOT/examples` (sadly we don't have a standard way to handle these dependencies yet). | ||
43 | |||
44 | 8. In `$LC_ROOT/examples` execute `stack ghc -- --make Hello`. | ||
45 | |||
46 | 9. Run the resulting executable and enjoy the view. | ||