| 1 |
# Copyright 1999-2005 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header$
|
| 4 |
|
| 5 |
inherit freebsd-utils flag-o-matic
|
| 6 |
|
| 7 |
BASE_VER="5.3"
|
| 8 |
MY_PATCH=${PN}-${BASE_VER}
|
| 9 |
GNU="freebsd-gnu-${PV}"
|
| 10 |
GCC="freebsd-gcc-3.4.2"
|
| 11 |
BINUTILS="freebsd-binutils-2.15"
|
| 12 |
|
| 13 |
DESCRIPTION="Contributed sources for FreeBSD. Includes programs and libraries"
|
| 14 |
SRC_URI="mirror://gentoo/${GNU}.tar.bz2
|
| 15 |
mirror://gentoo/${GCC}.tar.bz2
|
| 16 |
mirror://gentoo/${BINUTILS}.tar.bz2
|
| 17 |
mirror://gentoo/${P}.tar.bz2"
|
| 18 |
|
| 19 |
# Must be checked
|
| 20 |
LICENSE="BSD GPL-2 AS-IS"
|
| 21 |
KEYWORDS="~x86-fbsd"
|
| 22 |
|
| 23 |
DEPEND="virtual/libc
|
| 24 |
kerberos? ( virtual/krb5 )
|
| 25 |
ssl? ( =freebsd-crypto-5.3* )"
|
| 26 |
|
| 27 |
PROVIDE="virtual/gzip"
|
| 28 |
|
| 29 |
S=${WORKDIR}/gnu
|
| 30 |
|
| 31 |
IUSE="nocxx objc ssl kerberos"
|
| 32 |
|
| 33 |
pkg_setup() {
|
| 34 |
if use kerberos && ! use ssl; then
|
| 35 |
error "You can't install with kerberos support and no ssl support"
|
| 36 |
fi
|
| 37 |
|
| 38 |
use nocxx && mymakeopts="${mymakeopts} NO_CXX= "
|
| 39 |
use objc || mymakeopts="${mymakeopts} NO_OBJC= "
|
| 40 |
# Fortran support seems not to be enable in any case
|
| 41 |
# use fortran || mymakeopts="${mymakeopts} NO_FORTRAN= "
|
| 42 |
|
| 43 |
#Placeholder to disable cvs compilation, as we can't disable
|
| 44 |
|
| 45 |
# it for now else it will broke everything.
|
| 46 |
# Same for gdb
|
| 47 |
# use cvs || mymakeopts="${mymakeopts} NO_CVS= "
|
| 48 |
# use gdb || mymakeopts="${mymakeopts} NO_GDB= "
|
| 49 |
|
| 50 |
use ssl || mymakeopts="${mymakeopts} NO_OPENSSL= NOCRYPT= "
|
| 51 |
use kerberos || mymakeopts="${mymakeopts} NO_KERBEROS= "
|
| 52 |
}
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
src_unpack() {
|
| 57 |
unpack ${P}.tar.bz2
|
| 58 |
unpack ${GNU}.tar.bz2
|
| 59 |
unpack ${GCC}.tar.bz2
|
| 60 |
unpack ${BINUTILS}.tar.bz2
|
| 61 |
|
| 62 |
# Patch to avoid compilation of gcc, binutils and gdb
|
| 63 |
cd ${S}/usr.bin
|
| 64 |
epatch ${FILESDIR}/${MY_PATCH}-ubin-makefile_new.patch
|
| 65 |
|
| 66 |
|
| 67 |
# Compilation related patches
|
| 68 |
cd ${S}/usr.bin/groff/contrib/mm
|
| 69 |
epatch ${FILESDIR}/${MY_PATCH}-ubin-groff_mm-makefile.patch
|
| 70 |
|
| 71 |
cd ${S}/usr.bin/groff/tmac
|
| 72 |
epatch ${FILESDIR}/${MY_PATCH}-ubin-groff_tmac-makefile.patch
|
| 73 |
|
| 74 |
cd ${S}/usr.bin/groff/src/utils/indxbib
|
| 75 |
epatch ${FILESDIR}/${MY_PATCH}-ubin-groff_src_indxbib-makefile.patch
|
| 76 |
|
| 77 |
# Installation related patches
|
| 78 |
cd ${S}/lib/csu
|
| 79 |
epatch ${FILESDIR}/${MY_PATCH}-lib_csu-makefile.patch
|
| 80 |
|
| 81 |
cd ${S}/lib/libdialog
|
| 82 |
epatch ${FILESDIR}/${MY_PATCH}-libdialog-makefile.patch
|
| 83 |
|
| 84 |
cd ${S}/usr.bin/groff/font
|
| 85 |
epatch ${FILESDIR}/${MY_PATCH}-ubin-groff_font-makefile.patch
|
| 86 |
}
|
| 87 |
|
| 88 |
src_compile() {
|
| 89 |
# -pg and -fomit-frame-pointer are incompatible
|
| 90 |
filter-flags "-fomit-frame-pointer"
|
| 91 |
|
| 92 |
# Set emake to gmake
|
| 93 |
#emake="/usr/bin/gmake"
|
| 94 |
|
| 95 |
# It does not build without this
|
| 96 |
unset CFLAGS
|
| 97 |
unset CXXFLAGS
|
| 98 |
|
| 99 |
bsdmake ojb objlink
|
| 100 |
|
| 101 |
einfo "Building object/headers dependencies for this package"
|
| 102 |
cd ${S}/usr.bin/cc/cc_tools
|
| 103 |
bsdmake || die "make cc_tools failed"
|
| 104 |
einfo "Building binutils static libraries for this package"
|
| 105 |
cd ${S}/usr.bin/binutils
|
| 106 |
fmake || die "make binutils failed"
|
| 107 |
|
| 108 |
cd ${S}
|
| 109 |
|
| 110 |
#CXX=c++ gmake -j1 || die "emake failed"
|
| 111 |
einfo "Buiding package now"
|
| 112 |
fmake || die "emake failed"
|
| 113 |
}
|
| 114 |
|
| 115 |
src_install() {
|
| 116 |
fmake DESTDIR=${D} install || die "Install failed"
|
| 117 |
einfo "Moving headers to standard format"
|
| 118 |
move_headers
|
| 119 |
move_headers ${D}/usr/include/c++/3.4/bits ${D}/tmp/include/bits/
|
| 120 |
|
| 121 |
sleep 5
|
| 122 |
|
| 123 |
}
|
| 124 |
|
| 125 |
# This function removes the files installed inside directories in
|
| 126 |
# /usr/include/c++/3.4 and install them as files inside the same dir (like
|
| 127 |
# FreeBSD does)
|
| 128 |
move_headers() {
|
| 129 |
if [ $# -lt 2 ] ; then
|
| 130 |
HEADERPATH=${D}/usr/include/c++/3.4/
|
| 131 |
HEADERTMP=${D}/tmp/include
|
| 132 |
else
|
| 133 |
HEADERPATH=$1
|
| 134 |
HEADERTMP=$2
|
| 135 |
fi
|
| 136 |
einfo HEADERPATH = ${HEADERPATH}
|
| 137 |
einfo HEADERTMP = ${HEADERTMP}
|
| 138 |
sleep 5
|
| 139 |
|
| 140 |
cd $HEADERPATH
|
| 141 |
mkdir -p $HEADERTMP
|
| 142 |
for FILE in * ; do
|
| 143 |
if [ -d $FILE ] ; then
|
| 144 |
if [ $FILE != "bits" ] && [ $FILE != "ext" ] &&
|
| 145 |
[ $FILE != "debug" ] && [ $FILE != "backward" ] ; then
|
| 146 |
cd $FILE
|
| 147 |
for i in * ; do
|
| 148 |
einfo "Moving $i to $HEADERTMP/$FILE"
|
| 149 |
mv $i $HEADERTMP/$FILE
|
| 150 |
done
|
| 151 |
cd ..
|
| 152 |
rm -rf $FILE
|
| 153 |
fi
|
| 154 |
fi
|
| 155 |
done
|
| 156 |
|
| 157 |
cd $HEADERTMP
|
| 158 |
ls
|
| 159 |
mv * $HEADERPATH
|
| 160 |
rm -rf $HEADERTMP
|
| 161 |
sleep 5
|
| 162 |
}
|