Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107998 - zlib-1.2.3 does not install under OS X
Summary: zlib-1.2.3 does not install under OS X
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Mac OSX (show other bugs)
Hardware: PPC OS X
: High normal (vote)
Assignee: Gentoo for Mac OS X
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-03 10:54 UTC by Maurice Volaski
Modified: 2007-06-29 12:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for zlib-1.2.3.ebuild (zlib.patch,1.44 KB, patch)
2005-10-03 12:10 UTC, Fabian Groffen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maurice Volaski 2005-10-03 10:54:00 UTC
It appears that mysql-4.1.14 requires >=sys-libs/zlib-1.2.3.

I tried installing it and it errored

gcc -O2 -pipe -fPIC -DUSE_MMAP   -c -o minigzip.o minigzip.c
ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o 
inftrees.o inffast.o 
gcc -dynamiclib -install_name /lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.3  -o 
libz.1.2.3.dylib adler32.lo compress.lo crc32.lo gzio.lo uncompr.lo deflate.lo trees.lo zutil.lo inflate.lo 
infback.lo inftrees.lo inffast.lo -lc
rm -f libz.dylib libz.1.dylib
ln -s libz.1.2.3.dylib libz.dylib
ln -s libz.1.2.3.dylib libz.1.dylib
gcc -O2 -pipe -fPIC -DUSE_MMAP -o example example.o -L. libz.1.2.3.dylib
gcc -O2 -pipe -fPIC -DUSE_MMAP -o minigzip minigzip.o -L. libz.1.2.3.dylib
>>> Test phase [not enabled]: sys-libs/zlib-1.2.3

>>> Install zlib-1.2.3 into /var/tmp/portage/zlib-1.2.3/image/ category sys-libs
cp libz.a libz.1.2.3.dylib /var/tmp/portage/zlib-1.2.3/image//lib
cd /var/tmp/portage/zlib-1.2.3/image//lib; chmod 755 libz.a libz.1.2.3.dylib
cd /var/tmp/portage/zlib-1.2.3/image//lib; if test -f libz.1.2.3.dylib; then \
  rm -f libz.dylib libz.1.dylib; \
  ln -s libz.1.2.3.dylib libz.dylib; \
  ln -s libz.1.2.3.dylib libz.1.dylib; \
  (ldconfig || true)  >/dev/null 2>&1; \
fi
cp zlib.3 /var/tmp/portage/zlib-1.2.3/image//usr/share/man/man3
chmod 644 /var/tmp/portage/zlib-1.2.3/image//usr/share/man/man3/zlib.3
cp zlib.h zconf.h /var/tmp/portage/zlib-1.2.3/image//usr/include
chmod 644 /var/tmp/portage/zlib-1.2.3/image//usr/include/zlib.h /var/tmp/portage/zlib-1.2.3/
image//usr/include/zconf.h
/usr/lib/portage/bin/dolib: libz.so.1.2.3 does not exist


It appears that something called libz.1.2.3.dylib is created and this thing may in fact, be the missing 
libz.so.1.2.3 but no symlink is made to that file, so the remainder of the installation fails.
Comment 1 Andy Kissner 2005-10-03 11:33:54 UTC
Can you post:
-The USE flags you compiled with
-emerge info
Comment 2 Maurice Volaski 2005-10-03 11:56:42 UTC
Only USE flags in use are below:


!!! Relying on the shell to locate gcc, this may break
!!! DISTCC, installing gcc-config and setting your current gcc
!!! profile will fix this
Portage 2.0.51.19 (default-darwin/macos/10.3, gcc-3.3, libsystem-7.1-r0, 7.8.0 Power Macintosh)
===============================================================
==
System uname: 7.8.0 Power Macintosh powerpc
macos-20041118
Python:               [2.3 (#1, Sep 13 2003, 00:49:11)]
distcc 2.0.1-zeroconf powerpc-apple-darwin7.0 (protocol 1) (default port 3632) [disabled]
dev-lang/python:     [Not Present]
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  [Not Present]
sys-devel/libtool:   [Not Present]
virtual/os-headers:  7.1
ACCEPT_KEYWORDS="ppc-macos"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe"
CHOST="powerpc-apple-darwin"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/
qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/
gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="ppc emboss ncurses nls opengl ppc-macos userland_Darwin kernel_Darwin elibc_Darwin"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 3 Fabian Groffen gentoo-dev 2005-10-03 12:10:36 UTC
Created attachment 69804 [details, diff]
patch for zlib-1.2.3.ebuild

ah, I see the problem.	It was not keyworded by the way.  But the ebuild uses
fixed .so targets.

It collides with the system install on Tiger.

Can you try if the attached patch works for you?
Comment 4 Maurice Volaski 2005-10-03 13:05:46 UTC
It worked.
Comment 5 Fabian Groffen gentoo-dev 2005-10-03 13:08:23 UTC
did it collide on Panther for you?  Is collision-protect enabled?

Does MySQL compile against it successfully?
Comment 6 Maurice Volaski 2005-10-03 13:17:43 UTC
No, above I actually meant that portage said it installed it successfully,  but there is no libz.so.1.2.3 
anywhere on the system.

/lib contains
-rwxr-xr-x  1 root  portage  77360  3 Oct 16:10 libz.1.2.3.dylib
lrwxrwxrwx  1 root  wheel       16  3 Oct 16:10 libz.1.dylib -> libz.1.2.3.dylib
lrwxrwxrwx  1 root  wheel       16  3 Oct 16:10 libz.dylib -> libz.1.2.3.dylib
lrwxrwxrwx  1 root  wheel       13  3 Oct 16:02 libz.so -> libz.so.1.2.3

and /usr/lib/ contains

-rwxr-xr-x  1 root  wheel  56416  8 Jul 14:06 libz.1.1.3.dylib
-rwxr-xr-x  1 root  wheel  56200  8 Jul 14:06 libz.1.dylib
-rw-r--r--  1 root  wheel  86416  3 Oct 16:10 libz.a
-rwxr-xr-x  1 root  wheel    294  3 Oct 16:10 libz.dylib
-rwxr-xr-x  1 root  wheel    291  3 Oct 16:02 libz.so

Note I manually edited the ebuild because I couldn't seem to get the patch command to patch to work 
right.

I have FEATURES="-collision-protect" because that thing drives me crazy, won't even let me emerge 
new versions of portage. 
Comment 7 Fabian Groffen gentoo-dev 2005-10-03 13:29:16 UTC
(In reply to comment #6)
> No, above I actually meant that portage said it installed it successfully, 
but there is no libz.so.1.2.3 
> anywhere on the system.

that is correct, as it should install a libz.1.2.3.dylib and some files like below:

> /lib contains
> -rwxr-xr-x  1 root  portage  77360  3 Oct 16:10 libz.1.2.3.dylib
> lrwxrwxrwx  1 root  wheel       16  3 Oct 16:10 libz.1.dylib -> libz.1.2.3.dylib
> lrwxrwxrwx  1 root  wheel       16  3 Oct 16:10 libz.dylib -> libz.1.2.3.dylib

this file shouldn't be here:

> lrwxrwxrwx  1 root  wheel       13  3 Oct 16:02 libz.so -> libz.so.1.2.3
> 
> and /usr/lib/ contains
> 
> -rwxr-xr-x  1 root  wheel  56416  8 Jul 14:06 libz.1.1.3.dylib
> -rwxr-xr-x  1 root  wheel  56200  8 Jul 14:06 libz.1.dylib
> -rw-r--r--  1 root  wheel  86416  3 Oct 16:10 libz.a
> -rwxr-xr-x  1 root  wheel    294  3 Oct 16:10 libz.dylib
> -rwxr-xr-x  1 root  wheel    291  3 Oct 16:02 libz.so

hmmm... either this .so is a left over from a previous install, or I screwed up
the ebuild somehow.  Given the times I assume the former.

> Note I manually edited the ebuild because I couldn't seem to get the patch
command to patch to work 
> right.

The mysql ebuild I assume?

> I have FEATURES="-collision-protect" because that thing drives me crazy, won't
even let me emerge 
> new versions of portage. 

That's a known bug.  I hope you know some things may break.  I'm interested
whether for instance gnutls is able to link against the zlib just installed with
use flag "zlib".
Comment 8 Maurice Volaski 2005-10-03 13:36:09 UTC
No, the zlib ebuild. Here's the manually edited ebuild file:

inherit eutils flag-o-matic multilib

DESCRIPTION="Standard (de)compression library"
HOMEPAGE="http://www.gzip.org/zlib/"
SRC_URI="http://www.gzip.org/zlib/${P}.tar.bz2
        http://www.zlib.net/${P}.tar.bz2"

LICENSE="ZLIB"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ~ppc-macos ppc64 s390 sh sparc x86"
IUSE="build"

RDEPEND=""

pkg_setup() {
        tc-export CC RANLIB
        export AR="$(tc-getAR) rc"
}

src_unpack() {
        unpack ${A}

        cd "${S}"
        # Make sure we link with glibc at all times
        epatch "${FILESDIR}"/${PN}-1.2.1-glibc.patch
        # Needed for Alpha and prelink
        epatch "${FILESDIR}"/${PN}-1.2.1-build-fPIC.patch
        # Only export global symbols, bug #32764
        epatch "${FILESDIR}"/${PN}-1.2.2-mapfile.patch
        # The configure script can be kind of dumb #55434
        epatch "${FILESDIR}"/${PN}-1.2.1-configure.patch
        # fix shared library test on -fPIC dependant archs
        epatch "${FILESDIR}"/${PN}-1.2.1-fPIC.patch
}

src_compile() {
        ./configure --shared --prefix=/usr --libdir=/$(get_libdir) || die
        emake || die
}

src_install() {
        einstall libdir="${D}"/$(get_libdir) || die
        rm "${D}"/$(get_libdir)/libz.a
        insinto /usr/include
        doins zconf.h zlib.h

        if ! use build ; then
                doman zlib.3
                dodoc FAQ README ChangeLog
                docinto txt
                dodoc algorithm.txt
        fi

        # we don't need the static lib in /lib
        # as it's only for compiling against
        dolib libz.a

        # all the shared libs go into /lib
        # for NFS based /usr
        into /
        dolib libz$(get_libname ${PV})
        ( cd "${D}"/$(get_libdir) ; chmod 755 libz.so.* ; chmod 755 libz.*.dylib )
        dosym libz$(get_libname ${PV}) /$(get_libdir)/libz$(get_libname)
        dosym libz$(get_libname ${PV}) /$(get_libdir)/libz$(get_libname 1)
        gen_usr_ldscript libz$(get_libname)

}
Comment 9 Fabian Groffen gentoo-dev 2005-10-03 13:38:53 UTC
ok, which line did you change?
Comment 10 Maurice Volaski 2005-10-03 13:43:32 UTC
Several lines

inherit eutils flag-o-matic multilib

KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ~ppc-macos ppc64 s390 sh sparc x86"

dolib libz$(get_libname ${PV})
( cd "${D}"/$(get_libdir) ; chmod 755 libz.so.* ; chmod 755 libz.*.dylib )
dosym libz$(get_libname ${PV}) /$(get_libdir)/libz$(get_libname)
dosym libz$(get_libname ${PV}) /$(get_libdir)/libz$(get_libname 1)
gen_usr_ldscript libz$(get_libname)
Comment 11 Fabian Groffen gentoo-dev 2005-10-03 22:22:22 UTC
ok, but that looks just as my patch to me
Comment 12 Maurice Volaski 2005-10-04 10:45:20 UTC
I changed the symlink libz.so point the dylib file, but it didn't help.

mysql ebuild still complains:

checking for zlib compression library... configure: error: headers or binaries were not found in /usr/
{include,lib}
Comment 13 Maurice Volaski 2005-10-06 11:58:52 UTC
What are these configure programs looking for when they look for zlib?

Apache also gets stuck:

checking for zlib library... not found
checking whether to enable mod_deflate... configure: error: mod_deflate has been
requested but can not be built due to prerequisite failures

!!! ERROR: net-www/apache-2.0.54-r31 failed.
Comment 14 Maurice Volaski 2005-10-10 15:30:56 UTC
This bug I just posted, http://bugs.gentoo.org/show_bug.cgi?id=108777, looks
similar.


Comment 15 Fabian Groffen gentoo-dev 2007-06-29 12:04:36 UTC
use prefix.
http://www.gentoo.org/proj/en/gentoo-alt/prefix