Lines 9-25
Link Here
|
9 |
DESCRIPTION="FreeBSD kernel sources" |
9 |
DESCRIPTION="FreeBSD kernel sources" |
10 |
SLOT="0" |
10 |
SLOT="0" |
11 |
|
11 |
|
12 |
IUSE="+build-generic dtrace profile" |
12 |
IUSE="+build-generic +clang debug dtrace profile zfs" |
13 |
|
13 |
|
14 |
if [[ ${PV} != *9999* ]]; then |
14 |
if [[ ${PV} != *9999* ]]; then |
15 |
KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd" |
15 |
KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd" |
16 |
SRC_URI="mirror://gentoo/${SYS}.tar.bz2" |
16 |
SRC_URI="mirror://gentoo/${SYS}.tar.bz2" |
17 |
fi |
17 |
fi |
18 |
|
18 |
|
19 |
RDEPEND="dtrace? ( >=sys-freebsd/freebsd-cddl-9.2_rc1 ) |
19 |
RDEPEND="clang? ( sys-devel/clang ) |
|
|
20 |
dtrace? ( >=sys-freebsd/freebsd-cddl-9.2_rc1 ) |
20 |
=sys-freebsd/freebsd-mk-defs-${RV}* |
21 |
=sys-freebsd/freebsd-mk-defs-${RV}* |
21 |
!sys-freebsd/virtio-kmod" |
22 |
!sys-freebsd/virtio-kmod |
|
|
23 |
!sys-fs/fuse4bsd" |
22 |
DEPEND="build-generic? ( |
24 |
DEPEND="build-generic? ( |
|
|
25 |
clang? ( sys-devel/clang ) |
23 |
dtrace? ( >=sys-freebsd/freebsd-cddl-9.2_rc1 ) |
26 |
dtrace? ( >=sys-freebsd/freebsd-cddl-9.2_rc1 ) |
24 |
>=sys-freebsd/freebsd-usbin-9.1 |
27 |
>=sys-freebsd/freebsd-usbin-9.1 |
25 |
=sys-freebsd/freebsd-mk-defs-${RV}* |
28 |
=sys-freebsd/freebsd-mk-defs-${RV}* |
Lines 29-40
Link Here
|
29 |
|
32 |
|
30 |
S="${WORKDIR}/sys" |
33 |
S="${WORKDIR}/sys" |
31 |
|
34 |
|
32 |
KERN_BUILD=GENERIC |
35 |
KERN_BUILD=GENTOO |
33 |
|
36 |
|
34 |
PATCHES=( "${FILESDIR}/${PN}-9.0-disable-optimization.patch" |
37 |
PATCHES=( "${FILESDIR}/${PN}-9.0-disable-optimization.patch" |
35 |
"${FILESDIR}/${PN}-9.2-gentoo.patch" |
38 |
"${FILESDIR}/${PN}-10.0-gentoo.patch" |
36 |
"${FILESDIR}/${PN}-6.0-flex-2.5.31.patch" |
39 |
"${FILESDIR}/${PN}-6.0-flex-2.5.31.patch" |
37 |
"${FILESDIR}/${PN}-6.1-ntfs.patch" |
|
|
38 |
"${FILESDIR}/${PN}-7.1-types.h-fix.patch" |
40 |
"${FILESDIR}/${PN}-7.1-types.h-fix.patch" |
39 |
"${FILESDIR}/${PN}-8.0-subnet-route-pr40133.patch" |
41 |
"${FILESDIR}/${PN}-8.0-subnet-route-pr40133.patch" |
40 |
"${FILESDIR}/${PN}-7.1-includes.patch" |
42 |
"${FILESDIR}/${PN}-7.1-includes.patch" |
Lines 42-48
Link Here
|
42 |
"${FILESDIR}/${PN}-9.2-gentoo-gcc.patch" |
44 |
"${FILESDIR}/${PN}-9.2-gentoo-gcc.patch" |
43 |
"${FILESDIR}/${PN}-7.0-tmpfs_whiteout_stub.patch" ) |
45 |
"${FILESDIR}/${PN}-7.0-tmpfs_whiteout_stub.patch" ) |
44 |
|
46 |
|
|
|
47 |
pkg_setup() { |
48 |
# Force set CC=clang. when using gcc, aesni fails to build. |
49 |
use clang && export CC=clang |
50 |
use zfs || mymakeopts="${mymakeopts} WITHOUT_CDDL=" |
51 |
} |
52 |
|
45 |
src_prepare() { |
53 |
src_prepare() { |
|
|
54 |
local conf="${S}/$(tc-arch-kernel)/conf/${KERN_BUILD}" |
55 |
|
46 |
# This replaces the gentoover patch, it doesn't need reapply every time. |
56 |
# This replaces the gentoover patch, it doesn't need reapply every time. |
47 |
sed -i -e 's:^REVISION=.*:REVISION="'${PVR}'":' \ |
57 |
sed -i -e 's:^REVISION=.*:REVISION="'${PVR}'":' \ |
48 |
-e 's:^BRANCH=.*:BRANCH="Gentoo":' \ |
58 |
-e 's:^BRANCH=.*:BRANCH="Gentoo":' \ |
Lines 50-57
Link Here
|
50 |
"${S}/conf/newvers.sh" |
60 |
"${S}/conf/newvers.sh" |
51 |
|
61 |
|
52 |
# __FreeBSD_cc_version comes from FreeBSD's gcc. |
62 |
# __FreeBSD_cc_version comes from FreeBSD's gcc. |
53 |
# on 9.0-RELEASE it's 900001. |
63 |
# on 10.0-RELEASE it's 1000001. |
54 |
sed -e "s:-D_KERNEL:-D_KERNEL -D__FreeBSD_cc_version=900001:g" \ |
64 |
sed -e "s:-D_KERNEL:-D_KERNEL -D__FreeBSD_cc_version=1000001:g" \ |
55 |
-i "${S}/conf/kern.pre.mk" \ |
65 |
-i "${S}/conf/kern.pre.mk" \ |
56 |
-i "${S}/conf/kmod.mk" || die "Couldn't set __FreeBSD_cc_version" |
66 |
-i "${S}/conf/kmod.mk" || die "Couldn't set __FreeBSD_cc_version" |
57 |
|
67 |
|
Lines 60-65
Link Here
|
60 |
-i "${S}/conf/kern.pre.mk" \ |
70 |
-i "${S}/conf/kern.pre.mk" \ |
61 |
-i "${S}/conf/kmod.mk" || die |
71 |
-i "${S}/conf/kmod.mk" || die |
62 |
|
72 |
|
|
|
73 |
# Set the kernel configuration using USE flags. |
74 |
cp -f "${FILESDIR}/config-GENTOO" "${conf}" || die |
75 |
use debug || echo 'nomakeoptions DEBUG' >> "${conf}" |
76 |
use dtrace || echo 'nomakeoptions WITH_CTF' >> "${conf}" |
77 |
|
63 |
# Only used with USE=build-generic, let the kernel build with its own flags, its safer. |
78 |
# Only used with USE=build-generic, let the kernel build with its own flags, its safer. |
64 |
unset LDFLAGS CFLAGS CXXFLAGS ASFLAGS KERNEL |
79 |
unset LDFLAGS CFLAGS CXXFLAGS ASFLAGS KERNEL |
65 |
} |
80 |
} |
Lines 74-85
Link Here
|
74 |
|
89 |
|
75 |
src_compile() { |
90 |
src_compile() { |
76 |
if use build-generic ; then |
91 |
if use build-generic ; then |
77 |
local myconf |
|
|
78 |
use dtrace || myconf="-DNO_CTF " |
79 |
|
80 |
cd "${S}/$(tc-arch-kernel)/compile/${KERN_BUILD}" || die |
92 |
cd "${S}/$(tc-arch-kernel)/compile/${KERN_BUILD}" || die |
81 |
freebsd_src_compile depend ${myconf} |
93 |
freebsd_src_compile depend |
82 |
freebsd_src_compile ${myconf} |
94 |
freebsd_src_compile |
83 |
else |
95 |
else |
84 |
einfo "Nothing to compile.." |
96 |
einfo "Nothing to compile.." |
85 |
fi |
97 |
fi |