Apparently, *-macos cannot link against -lcrypt because "it is in the system's C library". I made a tested and working patch for x64-macos, but it should also work for any *-macos. I tried to add every other *-macos arch, but I might have missed some, please review. (see also: bug 330229 for the 5.0.6 ebuild request)
Created attachment 240457 [details, diff] Avoid *-macos to link against -lcrypt
I guess in this case it is better to match CHOST=*darwin* or so.
Created attachment 240475 [details, diff] Use chost instead of a long list of use *-macos Also note that every sed in this ebuild haven't || die clause, I'm not sure if it's a good thing or not.
@base-system: This patch cannot go upstream because upstream says "You should fix the Makefile for your platform" or so.
And isn't it possible to, well, fix the makefile for that platform in a way that does not require patching? I could try to talk with Md about this but it's somewhat unlikely I can get anything done regarding that. Mike?
dont bind to a CHOST. simply test if -lcrypt is available and if it isnt, sed it out from the makefile. the whois maintainer is known to be a pita to work with.
(In reply to comment #5) > I could try to talk with Md about this but it's somewhat unlikely I can get > anything done regarding that. Mike? Looks vain, indeed. See http://trac.macports.org/attachment/ticket/14951/whois-4.7.26.txt for a two years old email discussion between a guy from darwinport and Md.
Hmmm, any suggestions on what to use, Mike? test-flag-CC doesn't work, since it doesn't perform the linking step. Can't use ld directly IMO, since it is guaranteed to be different (non-GNU) in this case. Should we write a test function to perform a link step through the compiler? (Usually autoconf is so good at this :( )
This patch works for me on Darwin: diff -u -r1.7 whois-5.0.8.ebuild --- whois-5.0.8.ebuild 1 Mar 2011 00:33:08 -0000 1.7 +++ whois-5.0.8.ebuild 15 Dec 2011 19:50:28 -0000 @@ -28,6 +28,9 @@ else sed -i -e '/ENABLE_NLS/s:define:undef:' config.h fi + + echo "int main() {}" | gcc -xc -o /dev/null - -lcrypt >& /dev/null \ + || sed -i -e 's/-lcrypt//' Makefile } src_configure() { :;} # expected no-op @@ -41,7 +44,7 @@ } src_install() { - emake BASEDIR="${ED}" prefix=/usr install || die + emake BASEDIR="${D}" prefix="${EPREFIX}"/usr install || die insinto /etc doins whois.conf dodoc README debian/changelog
s/gcc/$(tc-getCC) ${CFLAGS} ${LDFLAGS}/ i've been toying around with making some toolchain funcs for probing headers/libraries, but haven't produced anything i'm happy with yet.
Ok, fix added like that, keyworded, so all done now.