Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 333387 - Please review Prefix changes to sys-devel/llvm
Summary: Please review Prefix changes to sys-devel/llvm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All OS X
: High normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: prefix-gx86 332605 333617
  Show dependency tree
 
Reported: 2010-08-19 06:22 UTC by Fabian Groffen
Modified: 2010-08-26 07:00 UTC (History)
1 user (show)

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


Attachments
Proposed llvm-9999.ebuild for prefix (llvm-9999-prefix.patch,2.08 KB, patch)
2010-08-23 08:45 UTC, Matthias Maier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2010-08-19 06:22:03 UTC
The following changes are necessary for llvm-2.7 to compile and install properly on an OS X Prefix system.  The install_name_tool bit and dependency changes are OS X specific, but the rest of the changes is for supporting Prefix.

Excuse the normal diff, CVS is no longer working here (I'm plagued by IPv6)

--- llvm-2.7.ebuild     2010-06-01 21:36:53.000000000 +0200
+++ llvm-2.7.ebuild     2010-08-18 22:20:04.957480000 +0200
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-2.7.ebuild,v 1.2 2010/06/01 19:29:46 voyageur Exp $
 
-EAPI="2"
+EAPI="3"
 inherit eutils multilib toolchain-funcs
 
 DESCRIPTION="Low Level Virtual Machine"
@@ -11,7 +11,7 @@
 
 LICENSE="UoI-NCSA"
 SLOT="0"
-KEYWORDS="~amd64 ~ppc ~x86"
+KEYWORDS="~amd64 ~ppc ~x86 ~ppc-macos"
 IUSE="alltargets debug +libffi llvm-gcc ocaml test udis86"
 
 DEPEND="dev-lang/perl
@@ -20,8 +20,8 @@
        >=sys-devel/bison-1.28
        !~sys-devel/bison-1.85
        !~sys-devel/bison-1.875
-       >=sys-devel/gcc-3.0
-       >=sys-devel/binutils-2.18
+       || ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.1.2 )
+       || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
        libffi? ( virtual/libffi )
        ocaml? ( dev-lang/ocaml )
        test? ( dev-util/dejagnu )
@@ -69,7 +69,7 @@
        # care of this.
        einfo "Fixing install dirs"
        sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \
-               -e 's,^PROJ_etcdir.*,PROJ_etcdir := /etc/llvm,' \
+               -e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
                -e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir), \
                -i Makefile.config.in || die "Makefile.config sed failed"
 
@@ -110,7 +110,7 @@
        local LLVM_GCC_DRIVER=nope ; local LLVM_GPP_DRIVER=nope
        if use llvm-gcc ; then
                if has_version sys-devel/llvm-gcc; then
-                       LLVM_GCC_DIR=$(ls -d ${ROOT}/usr/$(get_libdir)/llvm-gcc* 2> /dev/null)
+                       LLVM_GCC_DIR=$(ls -d ${EROOT}/usr/$(get_libdir)/llvm-gcc* 2> /dev/null)
                        LLVM_GCC_DRIVER=$(find ${LLVM_GCC_DIR} -name 'llvm*-gcc' 2> /dev/null)
                        if [[ -z ${LLVM_GCC_DRIVER} ]] ; then
                                die "failed to find installed llvm-gcc, LLVM_GCC_DIR=${LLVM_GCC_DIR}"
@@ -149,4 +149,13 @@
 
 src_install() {
        emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
+
+       # Fix install_names on Darwin.  The build system is too complicated
+       # to just fix this, so we correct it post-install
+       if [[ ${CHOST} == *-darwin* ]] ; then
+               for lib in lib{LLVMHello,LTO,profile_rt}.dylib ; do
+                       install_name_tool -id "${EPREFIX}"/usr/lib/${lib} \
+                               "${ED}"/usr/lib/${lib}
+               done
+       fi
 }
Comment 1 Matthias Maier gentoo-dev 2010-08-23 08:45:21 UTC
Created attachment 244165 [details, diff]
Proposed llvm-9999.ebuild for prefix

This is Fabian's patch applied to the 9999-ebuild. (It would be very nice to have the svn-version in the prefix too :) )
Compiles and runs fine on a ~amd64-linux - host.
Can someone with a Darwin - target please review whether the changes work as intended?
Comment 2 Bernard Cafarelli gentoo-dev 2010-08-25 15:21:07 UTC
Looks fine to me!
Comment 3 Fabian Groffen gentoo-dev 2010-08-26 07:00:57 UTC
committed, thanks!