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

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


Attachments
Proposed llvm-gcc-9999.ebuild for prefix (llvm-gcc-9999-prefix.patch,2.42 KB, patch)
2010-08-23 09:56 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-20 12:11:19 UTC
The following changes were necessary for llvm-gcc-2.7-r1 to properly install on Prefix systems.  The dependency changes and install_name_tool bit are necessary for OSX only.

Please review and accept the changes, or raise issues that you would like to see fixed.  Thanks.


Index: llvm-gcc-2.7-r1.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-devel/llvm-gcc/llvm-gcc-2.7-r1.ebuild,v
retrieving revision 1.1
diff -u -r1.1 llvm-gcc-2.7-r1.ebuild
--- llvm-gcc-2.7-r1.ebuild      20 May 2010 12:57:26 -0000      1.1
+++ llvm-gcc-2.7-r1.ebuild      20 Aug 2010 12:09:31 -0000
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm-gcc/llvm-gcc-2.7-r1.ebuild,v 1.1 2010/05/20 12:57:26 voyageur Exp $
 
-EAPI=2
+EAPI=3
 inherit libtool flag-o-matic gnuconfig multilib
 
 LLVM_GCC_VERSION=4.2
@@ -14,13 +14,13 @@
 
 LICENSE="GPL-2"
 SLOT=0
-KEYWORDS="~amd64 ~ppc ~x86"
+KEYWORDS="~amd64 ~ppc ~x86 ~ppc-macos"
 IUSE="bootstrap fortran multilib nls objc objc++ test"
 
 RDEPEND=">=sys-devel/llvm-$PV"
 DEPEND="${RDEPEND}
        >=sys-apps/texinfo-4.2-r4
-       >=sys-devel/binutils-2.18
+       || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
        >=sys-devel/bison-1.875
        test? ( dev-util/dejagnu
                sys-devel/autogen )"
@@ -65,10 +65,10 @@
        use objc && EXTRALANGS="${EXTRALANGS},objc"
        use objc++ && EXTRALANGS="${EXTRALANGS},obj-c++"
 
-       ECONF_SOURCE="${S}" econf --prefix=/usr/$(get_libdir)/${PN}-${MY_PV} \
+       ECONF_SOURCE="${S}" econf --prefix="${EPREFIX}"/usr/$(get_libdir)/${PN}-${MY_PV} \
                $(use_enable multilib) \
                --program-prefix=${PN}-${MY_PV}- \
-               --enable-llvm=/usr --enable-languages=c,c++${EXTRALANGS} \
+               --enable-llvm="${EPREFIX}"/usr --enable-languages=c,c++${EXTRALANGS} \
                || die "configure failed"
 }
 
@@ -98,20 +98,27 @@
        done
 
        emake DESTDIR="${D}" install || die "installation failed"
-       rm -rf "${D}"/usr/share/man/man7
+       rm -rf "${ED}"/usr/share/man/man7
        if ! use nls; then
                einfo "nls USE flag disabled, not installing locale files"
-               rm -rf "${D}"/usr/share/locale
+               rm -rf "${ED}"/usr/share/locale
        fi
 
        # Add some symlinks
        dodir /usr/bin
-       cd "${D}/usr/bin"
+       cd "${ED}/usr/bin"
        for X in c++ g++ cpp gcc gcov gccbug ; do
-               ln -s /usr/$(get_libdir)/${PN}-${MY_PV}/bin/${PN}-${MY_PV}-${X}  llvm-${X}
+               ln -s "${EPREFIX}"/usr/$(get_libdir)/${PN}-${MY_PV}/bin/${PN}-${MY_PV}-${X}  llvm-${X}
        done
        use fortran && \
-               ln -s /usr/$(get_libdir)/${PN}-${MY_PV}/bin/${PN}-${MY_PV}-gfortran llvm-gfortran
+               ln -s "${EPREFIX}"/usr/$(get_libdir)/${PN}-${MY_PV}/bin/${PN}-${MY_PV}-gfortran llvm-gfortran
+
+       # 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
+               local f=$(echo "${ED}"usr/$(get_libdir)/${PN}-${MY_PV}/lib/gcc/${CHOST}/${LLVM_GCC_VERSION}*/libstdc++.dylib)
+               install_name_tool -id "/${f#${D}}" "${f}"
+       fi
 }
 
 gcc_do_filter_flags() {
Comment 1 Fabian Groffen gentoo-dev 2010-08-21 11:07:21 UTC
hmmm, llvm-gcc seems not to include the prefix include paths, so this ebuild is not yet "done".
Comment 2 Fabian Groffen gentoo-dev 2010-08-22 18:23:55 UTC
ok, I missed one important configure argument to make the compiler look for includes in the Prefix (first).  See corrected diff below:

Index: llvm-gcc-2.7-r1.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-devel/llvm-gcc/llvm-gcc-2.7-r1.ebuild,v
retrieving revision 1.1
diff -u -r1.1 llvm-gcc-2.7-r1.ebuild
--- llvm-gcc-2.7-r1.ebuild      20 May 2010 12:57:26 -0000      1.1
+++ llvm-gcc-2.7-r1.ebuild      22 Aug 2010 18:20:45 -0000
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm-gcc/llvm-gcc-2.7-r1.ebuild,v 1.1 2010/05/20 12:57:26 voyageur Exp $
 
-EAPI=2
+EAPI=3
 inherit libtool flag-o-matic gnuconfig multilib
 
 LLVM_GCC_VERSION=4.2
@@ -14,13 +14,13 @@
 
 LICENSE="GPL-2"
 SLOT=0
-KEYWORDS="~amd64 ~ppc ~x86"
+KEYWORDS="~amd64 ~ppc ~x86 ~ppc-macos"
 IUSE="bootstrap fortran multilib nls objc objc++ test"
 
 RDEPEND=">=sys-devel/llvm-$PV"
 DEPEND="${RDEPEND}
        >=sys-apps/texinfo-4.2-r4
-       >=sys-devel/binutils-2.18
+       || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
        >=sys-devel/bison-1.875
        test? ( dev-util/dejagnu
                sys-devel/autogen )"
@@ -65,10 +65,11 @@
        use objc && EXTRALANGS="${EXTRALANGS},objc"
        use objc++ && EXTRALANGS="${EXTRALANGS},obj-c++"
 
-       ECONF_SOURCE="${S}" econf --prefix=/usr/$(get_libdir)/${PN}-${MY_PV} \
+       ECONF_SOURCE="${S}" econf --prefix="${EPREFIX}"/usr/$(get_libdir)/${PN}-${MY_PV} \
                $(use_enable multilib) \
                --program-prefix=${PN}-${MY_PV}- \
-               --enable-llvm=/usr --enable-languages=c,c++${EXTRALANGS} \
+               --enable-llvm="${EPREFIX}"/usr --enable-languages=c,c++${EXTRALANGS} \
+               $(use prefix && echo "--with-local-prefix=${EPREFIX}/usr") \
                || die "configure failed"
 }
 
@@ -98,20 +99,27 @@
        done
 
        emake DESTDIR="${D}" install || die "installation failed"
-       rm -rf "${D}"/usr/share/man/man7
+       rm -rf "${ED}"/usr/share/man/man7
        if ! use nls; then
                einfo "nls USE flag disabled, not installing locale files"
-               rm -rf "${D}"/usr/share/locale
+               rm -rf "${ED}"/usr/share/locale
        fi
 
        # Add some symlinks
        dodir /usr/bin
-       cd "${D}/usr/bin"
+       cd "${ED}/usr/bin"
        for X in c++ g++ cpp gcc gcov gccbug ; do
-               ln -s /usr/$(get_libdir)/${PN}-${MY_PV}/bin/${PN}-${MY_PV}-${X}  llvm-${X}
+               ln -s "${EPREFIX}"/usr/$(get_libdir)/${PN}-${MY_PV}/bin/${PN}-${MY_PV}-${X}  llvm-${X}
        done
        use fortran && \
-               ln -s /usr/$(get_libdir)/${PN}-${MY_PV}/bin/${PN}-${MY_PV}-gfortran llvm-gfortran
+               ln -s "${EPREFIX}"/usr/$(get_libdir)/${PN}-${MY_PV}/bin/${PN}-${MY_PV}-gfortran llvm-gfortran
+
+       # 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
+               local f=$(echo "${ED}"usr/$(get_libdir)/${PN}-${MY_PV}/lib/gcc/${CHOST}/${LLVM_GCC_VERSION}*/libstdc++.dylib)
+               install_name_tool -id "/${f#${D}}" "${f}"
+       fi
 }
 
 gcc_do_filter_flags() {
Comment 3 Matthias Maier gentoo-dev 2010-08-23 09:56:55 UTC
Created attachment 244189 [details, diff]
Proposed llvm-gcc-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 4 Bernard Cafarelli gentoo-dev 2010-08-25 15:40:04 UTC
I can't say a lot on the Prefix-specific parts, for the other changes, they're good to go!
Comment 5 Fabian Groffen gentoo-dev 2010-08-26 07:05:08 UTC
committed, thanks