Skip to content

Commit 65e7a4a

Browse files
committed
opt: install configuration
1 parent ffb0ec7 commit 65e7a4a

3 files changed

Lines changed: 24 additions & 11 deletions

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,18 @@ You can reference the E2E test in Ubuntu 20.04: [https://github.com/version-fox/
3636
brew install autoconf libxslt fop wxwidgets openssl
3737
```
3838

39-
You can reference the E2E test in MacOS 13: [https://github.com/version-fox/vfox-erlang/actions/workflows/e2e_test.yaml](https://github.com/version-fox/vfox-erlang/actions/workflows/e2e_test.yaml)
39+
You can reference the E2E test in MacOS 13: [https://github.com/version-fox/vfox-erlang/actions/workflows/e2e_test.yaml](https://github.com/version-fox/vfox-erlang/actions/workflows/e2e_test.yaml)
40+
41+
## Note
42+
43+
By default, vfox-erlang plugin will Build [EEP-48 documentation chunks](https://www.erlang.org/doc/apps/kernel/eep48_chapter) for get doc in REPL (eg: h(list).) and [lsp docs hint](https://github.com/elixir-lsp/vscode-elixir-ls/issues/284).
44+
45+
![erl get docs](./assets/get_docs_in_repl.png)
46+
47+
You cal also use the `OTP_CONFIGURE_ARGS` environment variable to control install behavior. reference this documentation [https://github.com/erlang/otp/blob/master/HOWTO/INSTALL.md#configuring-1](https://github.com/erlang/otp/blob/master/HOWTO/INSTALL.md#configuring-1) for more configuration. eg:
48+
49+
```shell
50+
# example
51+
export OTP_CONFIGURE_ARGS="--enable-jit --enable-kernel-poll"
52+
vfox install erlang@25.3.2.10
53+
```

assets/get_docs_in_repl.png

44.6 KB
Loading

hooks/post_install.lua

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@
44
function PLUGIN:PostInstall(ctx)
55
--- ctx.rootPath SDK installation directory
66
-- use ENV OTP_COMPILE_ARGS to control compile behavior
7-
local compile_args = os.getenv("OTP_COMPILE_ARGS") or ""
8-
print("Erlang/OTP compile with: %s", compile_args)
7+
local configure_args = os.getenv("OTP_CONFIGURE_ARGS") or ""
8+
print("Erlang/OTP compile configure args: %s", configure_args)
99

1010
-- use ENV OTP_BUILD_DOCS to control bytecode with docs chunks
11-
local with_docs_chunks = os.getenv("OTP_BUILD_DOCS") or ""
11+
local docs_target = os.getenv("DOC_TARGETS") or "chunks"
1212

13-
print("If you enable some Erlang/OTP features, maybe you can reference this guide: https://github.com/asdf-vm/asdf-erlang?tab=readme-ov-file#before-asdf-install")
13+
print("If you enable some Erlang/OTP features, maybe you can reference this guide: https://github.com/erlang/otp/blob/master/HOWTO/INSTALL.md#configuring-1")
1414
os.execute("sleep " .. tonumber(3))
1515

1616
local sdkInfo = ctx.sdkInfo['erlang']
1717
local path = sdkInfo.path
1818

19-
local install_erlang_cmd = "cd " .. path .. " && ./configure --prefix=" .. path .. "/release " .. compile_args .. "&& make && make install"
20-
-- install for IDE docs hits & type hits
21-
local install_erlang_docs_cmd = "cd " .. path .. " && make docs DOC_TARGETS=chunks && make release_docs DOC_TARGETS=chunks"
19+
local configure_cmd = "cd " .. path .. " && ./configure --prefix=" .. path .. "/release " .. configure_args
2220

23-
local status = os.execute(install_erlang_cmd .. " && " ..install_erlang_docs_cmd)
21+
local install_erlang_cmd = "cd " .. path .. "&& make && make install"
22+
-- install with docs chunk for IDE/REPL docs hits & type hits
23+
local install_erlang_docs_cmd = "cd " .. path .. " && make docs DOC_TARGETS=" .. docs_target .. " && make release_docs DOC_TARGETS=" .. docs_target
2424

25-
-- local status = os.execute("cd " .. path .. " && ./configure --prefix=" .. path .. "/release " .. compile_args .. "&& make && make install")
26-
-- status = os.execute("cd " .. path .. " && make docs DOC_TARGETS=chunks && make release_docs DOC_TARGETS=chunks")
25+
local status = os.execute(configure_cmd .. " && " .. install_erlang_cmd .. " && " ..install_erlang_docs_cmd)
2726
if status ~= 0 then
2827
error("Erlang/OTP install failed, please check the stdout for details. Make sure you have the required utilties: https://www.erlang.org/doc/installation_guide/install#required-utilities")
2928
end

0 commit comments

Comments
 (0)