]> gitweb.factorcode.org Git - factor.git/commit
shell.nix: supply `wrapFactor` helper to make standalone factor binary
authortimor <timor.dd@googlemail.com>
Wed, 20 May 2020 15:04:01 +0000 (17:04 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 May 2020 17:11:26 +0000 (17:11 +0000)
commit655f54af19915225a44ceba874538167515cd110
tree72f21c5aa79b68f6da0b2eb4b71747953df9e907
parent802bb073b053605638b1cc350adb2e47e41c75aa
shell.nix: supply `wrapFactor` helper to make standalone factor binary

This adds the shell function `wrapFactor`.  This function is intended to wrap
the result of calling `build.sh` in the shell environment so it can be executed
outside of the nix shell.

Example:

```
$ nix-shell
[nix-shell] $ ./build.sh bootstrap
...build factor vm and image...
[nix-shell] $ wrapFactor .
exit
$ ./factor
```

`wrapFactor` takes the path to the factor root dir as argument, and expects the
binary `factor` and the image file `factor.image` there and uses Nixpkgs'
`makeWrapper` to wrap the `factor` executable in-place with the correct
`LD_LIBRARY_PATH`.  Afterwards, the factor executable can be called outside of
the nix-shell environment.
shell.nix