fix: Dynamically find Erlang erts include directory
Find the erts include path dynamically instead of relying on erlang.version which may not match the actual erts version. This fixes 'erl_nif.h' file not found error.
This commit is contained in:
parent
1ad737e010
commit
f42e2b00c9
1 changed files with 3 additions and 5 deletions
|
|
@ -26,15 +26,13 @@ stdenv.mkDerivation {
|
|||
erlang
|
||||
];
|
||||
|
||||
# Set Erlang include path for NIF headers
|
||||
preBuild = ''
|
||||
export ERL_INCLUDE_PATH="${erlang}/lib/erlang/erts-${erlang.version}/include"
|
||||
'';
|
||||
|
||||
# Build using the existing Makefile
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# Find the actual erts include directory
|
||||
export ERL_INCLUDE_PATH=$(find ${erlang}/lib/erlang -type d -name "erts-*" | head -1)/include
|
||||
|
||||
cd c_src
|
||||
make -j$NIX_BUILD_CORES
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue