mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 22:20:51 +00:00
cdc5cf52c1
- use fixupOutputsHook to find libs in all outputs - don't rebase symlinks
25 lines
701 B
Bash
25 lines
701 B
Bash
fixupOutputHooks+=(_cygwinFixAutoImageBase)
|
|
|
|
_cygwinFixAutoImageBase() {
|
|
if [ "$dontRebase" == 1 ] || [ ! -d "$prefix" ]; then
|
|
return
|
|
fi
|
|
find "$prefix" -name "*.dll" -type f | while read DLL; do
|
|
if [ -f /etc/rebasenix.nextbase ]; then
|
|
NEXTBASE="$(</etc/rebasenix.nextbase)"
|
|
fi
|
|
NEXTBASE=${NEXTBASE:-0x62000000}
|
|
|
|
REBASE=(`/bin/rebase -i $DLL`)
|
|
BASE=${REBASE[2]}
|
|
SIZE=${REBASE[4]}
|
|
SKIP=$(((($SIZE>>16)+1)<<16))
|
|
|
|
echo "REBASE FIX: $DLL $BASE -> $NEXTBASE"
|
|
/bin/rebase -b $NEXTBASE $DLL
|
|
NEXTBASE="0x`printf %x $(($NEXTBASE+$SKIP))`"
|
|
|
|
echo $NEXTBASE > /etc/rebasenix.nextbase
|
|
done
|
|
}
|