sys-freebsd: Remove 10.2.
[gentoo.git] / sys-freebsd / boot0 / boot0-9.1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=2
6
7 inherit bsdmk freebsd flag-o-matic
8
9 DESCRIPTION="FreeBSD's bootloader"
10 SLOT="0"
11 KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
12
13 IUSE="bzip2 ieee1394 tftp zfs"
14
15 SRC_URI="mirror://gentoo/${SYS}.tar.bz2
16         mirror://gentoo/${LIB}.tar.bz2
17         mirror://gentoo/${CONTRIB}.tar.bz2"
18
19 RDEPEND=""
20 DEPEND="=sys-freebsd/freebsd-mk-defs-${RV}*
21         =sys-freebsd/freebsd-lib-${RV}*"
22
23 S="${WORKDIR}/sys/boot"
24
25 PATCHES=( "${FILESDIR}/${PN}-9.2-gcc46.patch"
26         "${FILESDIR}/${PN}-add-nossp-cflags.patch" )
27
28 boot0_use_enable() {
29         use ${1} && mymakeopts="${mymakeopts} LOADER_${2}_SUPPORT=\"yes\""
30 }
31
32 pkg_setup() {
33         boot0_use_enable ieee1394 FIREWIRE
34         boot0_use_enable zfs ZFS
35         boot0_use_enable tftp TFTP
36         boot0_use_enable bzip2 BZIP2
37 }
38
39 src_prepare() {
40         sed -e '/-fomit-frame-pointer/d' -e '/-mno-align-long-strings/d' \
41                 -i "${S}"/i386/boot2/Makefile \
42                 -i "${S}"/i386/gptboot/Makefile \
43                 -i "${S}"/i386/gptzfsboot/Makefile \
44                 -i "${S}"/i386/zfsboot/Makefile || die
45 }
46
47 src_compile() {
48         strip-flags
49         append-flags "-fno-strict-aliasing"
50
51         cd "${WORKDIR}/lib/libstand" || die
52         freebsd_src_compile
53
54         cd "${S}"
55         CFLAGS="${CFLAGS} -I${WORKDIR}/lib/libstand"
56         LDFLAGS="${LDFLAGS} -L${WORKDIR}/lib/libstand"
57         export LIBSTAND="${WORKDIR}/lib/libstand/libstand.a"
58         NOFLAGSTRIP="yes" freebsd_src_compile
59 }
60
61 src_install() {
62         dodir /boot/defaults
63         mkinstall FILESDIR=/boot || die "mkinstall failed"
64 }