Skip to content

Commit

Permalink
feature: installation --prefix via env var
Browse files Browse the repository at this point in the history
With `dune install` you must either provide the installation `--prefix`
or have `opam` installed. Unfortunately in some cases neither is an
option because we're in a non-Opam environment (e.g. Nix) and don't
control the invocation of Dune.

Providing an environment variable `DUNE_INSTALL_PREFIX` may alleviate
that pain.

Might help some suffering from #5455.

Signed-off-by: Ole Krüger <[email protected]>

ps-id: 2D3AA66B-4717-45EE-884B-F22F9D6008C8
  • Loading branch information
vapourismo authored and rgrinberg committed Apr 21, 2022
1 parent 921cf99 commit c4818a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.2.0 (Unreleased)
-----------------

- Allow to specify `--prefix` via the environment variable
`DUNE_INSTALL_PREFIX` (#5589, @vapourismo)

3.1.1 (19/04/2022)
------------------

Expand Down
4 changes: 3 additions & 1 deletion bin/install_uninstall.ml
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,9 @@ let install_uninstall ~what =
Arg.(
value
& opt (some string) None
& info [ "prefix" ] ~docv:"PREFIX"
& info [ "prefix" ]
~env:(env_var "DUNE_INSTALL_PREFIX")
~docv:"PREFIX"
~doc:
"Directory where files are copied. For instance binaries are \
copied into $(i,\\$prefix/bin), library files into \
Expand Down

0 comments on commit c4818a8

Please sign in to comment.