|
4 | 4 | function PLUGIN:PostInstall(ctx) |
5 | 5 | --- ctx.rootPath SDK installation directory |
6 | 6 | -- 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) |
9 | 9 |
|
10 | 10 | -- 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" |
12 | 12 |
|
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") |
14 | 14 | os.execute("sleep " .. tonumber(3)) |
15 | 15 |
|
16 | 16 | local sdkInfo = ctx.sdkInfo['erlang'] |
17 | 17 | local path = sdkInfo.path |
18 | 18 |
|
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 |
22 | 20 |
|
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 |
24 | 24 |
|
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) |
27 | 26 | if status ~= 0 then |
28 | 27 | 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") |
29 | 28 | end |
|
0 commit comments