uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
78
pkgs/development/interpreters/tcl/tcl-package-hook.sh
Normal file
78
pkgs/development/interpreters/tcl/tcl-package-hook.sh
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
# This hook ensures that we do the following in post-fixup:
|
||||
# * wrap any installed executables with a wrapper that configures TCLLIBPATH
|
||||
# * write a setup hook that extends the TCLLIBPATH of any anti-dependencies
|
||||
|
||||
tclWrapperArgs=( ${tclWrapperArgs-} )
|
||||
|
||||
# Add a directory to TCLLIBPATH, provided that it exists
|
||||
_addToTclLibPath() {
|
||||
local tclPkg="$1"
|
||||
if [[ -z "$tclPkg" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ ! -d "$tclPkg" ]]; then
|
||||
>&2 echo "can't add $tclPkg to TCLLIBPATH; that directory doesn't exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$tclPkg" == *" "* ]]; then
|
||||
tclPkg="{$tclPkg}"
|
||||
fi
|
||||
|
||||
if [[ -z "${TCLLIBPATH-}" ]]; then
|
||||
export TCLLIBPATH="$tclPkg"
|
||||
else
|
||||
if [[ "$TCLLIBPATH" != *"$tclPkg "* && "$TCLLIBPATH" != *"$tclPkg" ]]; then
|
||||
export TCLLIBPATH="${TCLLIBPATH} $tclPkg"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Locate any directory containing an installed pkgIndex file
|
||||
findInstalledTclPkgs() {
|
||||
local -r newLibDir="${!outputLib}/lib"
|
||||
if [[ ! -d "$newLibDir" ]]; then
|
||||
>&2 echo "Assuming no loadable tcl packages installed ($newLibDir does not exist)"
|
||||
return
|
||||
fi
|
||||
echo "$(find "$newLibDir" -name pkgIndex.tcl -exec dirname {} \;)"
|
||||
}
|
||||
|
||||
# Wrap any freshly-installed binaries and set up their TCLLIBPATH
|
||||
wrapTclBins() {
|
||||
if [[ -z "${TCLLIBPATH-}" ]]; then
|
||||
echo "skipping automatic Tcl binary wrapping (nothing to do)"
|
||||
return
|
||||
fi
|
||||
|
||||
local -r tclBinsDir="${!outputBin}/bin"
|
||||
if [[ ! -d "$tclBinsDir" ]]; then
|
||||
echo "No outputBin found, not using any TCLLIBPATH wrapper"
|
||||
return
|
||||
fi
|
||||
|
||||
tclWrapperArgs+=(--prefix TCLLIBPATH ' ' "$TCLLIBPATH")
|
||||
|
||||
find "$tclBinsDir" -type f -executable -print |
|
||||
while read -r someBin; do
|
||||
echo "Adding TCLLIBPATH wrapper for $someBin"
|
||||
wrapProgram "$someBin" "${tclWrapperArgs[@]}"
|
||||
done
|
||||
}
|
||||
|
||||
# Generate hook to adjust TCLLIBPATH in anti-dependencies
|
||||
writeTclLibPathHook() {
|
||||
local -r hookPath="${!outputLib}/nix-support/setup-hook"
|
||||
mkdir -p "$(dirname "$hookPath")"
|
||||
|
||||
typeset -f _addToTclLibPath >> "$hookPath"
|
||||
local -r tclPkgs=$(findInstalledTclPkgs)
|
||||
while IFS= read -r tclPkg; do
|
||||
echo "_addToTclLibPath \"$tclPkg\"" >> "$hookPath"
|
||||
_addToTclLibPath "$tclPkg" true
|
||||
done <<< "$tclPkgs"
|
||||
}
|
||||
|
||||
postFixupHooks+=(writeTclLibPathHook)
|
||||
postFixupHooks+=(wrapTclBins)
|
||||
Loading…
Add table
Add a link
Reference in a new issue