summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haubenwallner <haubi@gentoo.org>2020-03-11 15:26:12 +0100
committerMichael Haubenwallner <haubi@gentoo.org>2020-03-11 16:47:18 +0100
commitbdace9d42fa6b66f5524e1684c9a19b8d2117155 (patch)
tree5af295fd323c98914cac4df2210892d69328567f /profiles/prefix
parentprefix/winnt/profile.bashrc: rename funcs to winnt_ (diff)
downloadgentoo-bdace9d42fa6b66f5524e1684c9a19b8d2117155.tar.gz
gentoo-bdace9d42fa6b66f5524e1684c9a19b8d2117155.tar.bz2
gentoo-bdace9d42fa6b66f5524e1684c9a19b8d2117155.zip
prefix/winnt/profile.bashrc: no symlink usr/lib/NAME.dll
While moving usr/lib/NAME.dll into usr/bin/ is necessary, creating the symlink usr/lib/NAME.dll -> ../bin/NAME.dll is problematic, because the libtool .exe wrapper may add usr/lib to PATH, causing the native loader to fail when attempting to load a dll but discovering a cygwin symlink. Also, need to resolve symlinks while moving from usr/lib into usr/bin. Signed-off-by: Michael Haubenwallner <haubi@gentoo.org>
Diffstat (limited to 'profiles/prefix')
-rw-r--r--profiles/prefix/windows/winnt/profile.bashrc30
1 files changed, 21 insertions, 9 deletions
diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index c613a56cd982..215ad93a9430 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -175,18 +175,30 @@ winnt_post_src_install() {
eend $?
fi
done
- [[ -d usr/$(get_libdir) ]] &&
- find usr/$(get_libdir) -maxdepth 1 -type f -name '*.dll' |
- while read f
- do
- if [[ ! -f usr/bin/${f##*/} ]]; then
- ebegin "moving ${f} to usr/bin for native loader"
+ if [[ -d usr/$(get_libdir) ]]
+ then
+ # The native loader does not understand symlinks to dlls,
+ # seen to be created by dev-libs/icu eventually. For any
+ # dll we find in usr/lib we need to perform a real copy to
+ # usr/bin, to resolve potential symlinks (seen from icu),
+ # and perform the remove from usr/lib afterwards, to not
+ # break symlinks later on discovered by find.
+ local toremove=()
+ local f
+ while read f
+ do
+ [[ -f usr/bin/${f##*/} ]] && continue
+ ebegin "moving ${f} to usr/bin for the native loader"
dodir usr/bin || die
- mv -f "${f}" usr/bin/ || die
- ln -sf "../bin/${f##*/}" "${f}" || die
+ cp -f "${f}" usr/bin/ || die
eend $?
+ toremove=( "${toremove[@]}" "${f}" )
+ done < <(find usr/$(get_libdir) -maxdepth 1 -name '*.dll')
+ if [[ ${#toremove[@]} -gt 0 ]]
+ then
+ rm -f "${toremove[@]}" || die "removing dlls from usr/$(get_libdir) failed"
fi
- done
+ fi
}
winnt_setup_dllhelper_cp() {