Closed Radivarig closed 3 years ago
setupHook
will be called when a package is included in buildInputs
which makes it convenient to auto extend all needed shell variables with custom library paths without having to do it manually in the shellHook
.
The difference between nix and non-nix builds is that it puts the output in
/nix/store/../
and what would end up in/lib
on non-nix systems ends up in/nix/store/../lib
.In nix, if the
buildInputs
contains for examplepython
orguile
packages, shell variablesPYTHONPATH
andGUILE_LOAD_PATH
are automatically extended with the$out/lib/python${version}/site-packages
and$out/share/guile/site
of the derivation result,and same for(this is not true, a customLD_LIBRARY_PATH
with$out/lib
setupHook
is needed).Since opencog often places modules into
/lib/opencog
including those paths once somewhere is sufficient for all of/lib/opencog/*
to be available in the library path, but in nix this requires adding one$out/lib/opencog
per output.Example of this workaround is here: cogserver/default.nix and opencog/default.nix.
Note that some packages also write to
/lib/opencog/modules
or other paths, depending on the makefiles.