Fix emacsWithPackages after 7f3ca3e21a
.
This is hacky but it does the job, resurrects findInputs from before staging merge
This commit is contained in:
parent
1b0f696d10
commit
0f925943fd
|
@ -55,12 +55,46 @@ stdenv.mkDerivation {
|
|||
deps = runCommand "emacs-packages-deps"
|
||||
{ inherit explicitRequires lndir emacs; }
|
||||
''
|
||||
findInputsOld() {
|
||||
local pkg="$1"; shift
|
||||
local var="$1"; shift
|
||||
local propagatedBuildInputsFiles=("$@")
|
||||
|
||||
# TODO(@Ericson2314): Restore using associative array once Darwin
|
||||
# nix-shell doesn't use impure bash. This should replace the O(n)
|
||||
# case with an O(1) hash map lookup, assuming bash is implemented
|
||||
# well :D.
|
||||
local varSlice="$var[*]"
|
||||
# ''${..-} to hack around old bash empty array problem
|
||||
case "''${!varSlice-}" in
|
||||
*" $pkg "*) return 0 ;;
|
||||
esac
|
||||
unset -v varSlice
|
||||
|
||||
eval "$var"'+=("$pkg")'
|
||||
|
||||
if ! [ -e "$pkg" ]; then
|
||||
echo "build input $pkg does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local file
|
||||
for file in "''${propagatedBuildInputsFiles[@]}"; do
|
||||
file="$pkg/nix-support/$file"
|
||||
[[ -f "$file" ]] || continue
|
||||
|
||||
local pkgNext
|
||||
for pkgNext in $(< "$file"); do
|
||||
findInputsOld "$pkgNext" "$var" "''${propagatedBuildInputsFiles[@]}"
|
||||
done
|
||||
done
|
||||
}
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/share/emacs/site-lisp
|
||||
|
||||
local requires
|
||||
for pkg in $explicitRequires; do
|
||||
findInputs $pkg requires propagated-user-env-packages
|
||||
findInputsOld $pkg requires propagated-user-env-packages
|
||||
done
|
||||
# requires now holds all requested packages and their transitive dependencies
|
||||
|
||||
|
|
Loading…
Reference in a new issue