Skip to content

Commit

Permalink
lispPackages: A less aggressive way to manipulate ASDF search path, a…
Browse files Browse the repository at this point in the history
…s suggested by Fare
  • Loading branch information
7c6f434c committed Nov 22, 2017
1 parent a1e340f commit 4db842f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 6 additions & 2 deletions pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
Expand Up @@ -70,8 +70,12 @@ esac

NIX_LISP_ASDF_REGISTRY_CODE="
(progn
#+asdf3 (setf asdf:*default-source-registries*
'(asdf/source-registry:environment-source-registry))
(setf asdf:*source-registry-parameter*
'(:source-registry
$(for p in $NIX_LISP_ASDF_PATHS; do
echo "(:tree \"$p\")"
done)
:inherit-configuration))
(asdf:initialize-source-registry)
)
"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/lisp-modules/define-package.nix
Expand Up @@ -29,7 +29,7 @@ let
echo "source '$path_config_script'" >> "$config_script"
echo "fi" >> "$config_script"
echo "if test -z \"\''${_''${outhash}_NIX_LISP_PATH_CONFIG}\"; then export _''${outhash}_NIX_LISP_PATH_CONFIG=1; " >> "$path_config_script"
echo "for i in \"''${CL_SOURCE_REGISTRY//:/\" \"}\" \"$out/lib/common-lisp/${args.baseName}/\" ; do echo \"\$CL_SOURCE_REGISTRY\" | grep -E \"(^|:)\$i(:|\\\$)\" >/dev/null || export CL_SOURCE_REGISTRY=\"\$CL_SOURCE_REGISTRY\''${CL_SOURCE_REGISTRY:+:}\$i\"; done;" >> "$path_config_script"
echo "export NIX_LISP_ASDF_PATHS=\"$( ( echo "\$NIX_LISP_ASDF_PATHS"; echo "$NIX_LISP_ASDF_PATHS"; echo "$out/lib/common-lisp/${args.baseName}" ) | grep . | sort | uniq)\"" >> "$path_config_script"
test -n "$LD_LIBRARY_PATH" &&
echo "export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH\''${LD_LIBRARY_PATH:+:}\"'$LD_LIBRARY_PATH'" >> "$path_config_script"
test -n "$NIX_LISP_LD_LIBRARY_PATH" &&
Expand Down
8 changes: 2 additions & 6 deletions pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix
Expand Up @@ -28,13 +28,8 @@ in
propagatedBuildInputs = [pkgs.fuse];
overrides = y : (x.overrides y) // {
configurePhase = ''
export SAVED_CL_SOURCE_REGISTRY="$CL_SOURCE_REGISTRY"
export CL_SOURCE_REGISTRY="$CL_SOURCE_REGISTRY:$PWD"
export makeFlags="$makeFlags LISP=common-lisp.sh"
'';
preInstall = ''
export CL_SOURCE_REGISTRY="$SAVED_CL_SOURCE_REGISTRY"
'';
};
};
hunchentoot = addNativeLibs [pkgs.openssl];
Expand Down Expand Up @@ -65,7 +60,8 @@ in
overrides = y: (x.overrides y) // {
linkedSystems = [];
postInstall = ((x.overrides y).postInstall or "") + ''
export CL_SOURCE_REGISTRY="$CL_SOURCE_REGISTRY:$out/lib/common-lisp/query-fs"
export NIX_LISP_ASDF_PATHS="$NIX_LISP_ASDF_PATHS
$out/lib/common-lisp/query-fs"
export HOME=$PWD
"$out/bin/query-fs-lisp-launcher.sh" --eval '(asdf:make :query-fs)' \
--eval "(progn $(for i in $linkedSystems; do echo "(asdf:make :$i)"; done) )" \
Expand Down

0 comments on commit 4db842f

Please sign in to comment.