public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michael Haubenwallner" <haubi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
Date: Wed, 11 Mar 2020 15:51:04 +0000 (UTC)	[thread overview]
Message-ID: <1583941638.bdace9d42fa6b66f5524e1684c9a19b8d2117155.haubi@gentoo> (raw)

commit:     bdace9d42fa6b66f5524e1684c9a19b8d2117155
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 11 14:26:12 2020 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 15:47:18 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdace9d4

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 <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 30 +++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index c613a56cd98..215ad93a943 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() {


             reply	other threads:[~2020-03-11 15:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 15:51 Michael Haubenwallner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-19 15:02 [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/ Sergei Trofimovich
2020-03-11 15:51 Michael Haubenwallner
2020-03-11 15:51 Michael Haubenwallner
2020-03-11 15:51 Michael Haubenwallner
2020-03-11 15:51 Michael Haubenwallner
2019-06-24 12:15 Michael Haubenwallner
2019-06-24 11:08 Michael Haubenwallner
2019-06-24 11:08 Michael Haubenwallner
2019-03-20  8:39 Michael Haubenwallner
2019-03-13  8:22 Michał Górny
2018-06-11  1:53 Matt Turner
2018-01-24 16:23 Michael Haubenwallner
2017-10-02 14:32 Michael Haubenwallner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1583941638.bdace9d42fa6b66f5524e1684c9a19b8d2117155.haubi@gentoo \
    --to=haubi@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox