terminusdb: fix baked-in sandbox paths in Prolog saved state
This commit is contained in:
@@ -100,6 +100,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
substituteInPlace $cargoDepsCopy/*/tikv-jemalloc-sys-*/build.rs \
|
||||
--replace-fail 'format!("{orig_makeflags} {makeflags}")' \
|
||||
'format!("{makeflags} {orig_makeflags}")'
|
||||
|
||||
# Hardcode terminus_home to a Nix store path that will exist both
|
||||
# at compile time (via the symlink in preBuild) and at runtime.
|
||||
substituteInPlace src/load_paths.pl \
|
||||
--replace-fail "top_level_directory(TopDir)," \
|
||||
"TopDir = '$out/share/terminusdb',"
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
@@ -151,6 +157,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
preBuild = ''
|
||||
export TERMINUSDB_GIT_HASH=$(cat $src/COMMIT)
|
||||
export TERMINUSDB_JWT_ENABLED=true
|
||||
|
||||
# Point terminus_home at the build directory during compilation
|
||||
# so the Rust dylib and Prolog sources are findable.
|
||||
mkdir -p $out/share/terminusdb
|
||||
ln --symbolic --force --no-target-directory $PWD/src $out/share/terminusdb/src
|
||||
'';
|
||||
|
||||
# Required for Prolog initialisation
|
||||
@@ -160,6 +171,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
runHook preInstall
|
||||
installBin terminusdb
|
||||
installManPage $src/docs/terminusdb.1
|
||||
|
||||
# Replace with the Nix store source so schema files are findable
|
||||
# at runtime (the build directory no longer exists).
|
||||
ln --symbolic --force --no-target-directory $src/src $out/share/terminusdb/src
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user