/[gentoo-x86]/eclass/freebsd.eclass
Gentoo

Contents of /eclass/freebsd.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (show annotations) (download)
Sat Nov 24 11:22:44 2012 UTC (21 months, 3 weeks ago) by aballier
Branch: MAIN
Changes since 1.23: +2 -1 lines
Add epatch_user support in freebsd_do_patches, bug #444506 by Yuta SATOH

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/freebsd.eclass,v 1.23 2012/05/24 11:19:53 aballier Exp $
4 #
5 # Diego Pettenò <flameeyes@gentoo.org>
6
7 inherit versionator eutils flag-o-matic bsdmk
8
9 LICENSE="BSD"
10 HOMEPAGE="http://www.freebsd.org/"
11
12 # Define global package names
13 LIB="freebsd-lib-${PV}"
14 BIN="freebsd-bin-${PV}"
15 CONTRIB="freebsd-contrib-${PV}"
16 SHARE="freebsd-share-${PV}"
17 UBIN="freebsd-ubin-${PV}"
18 USBIN="freebsd-usbin-${PV}"
19 CRYPTO="freebsd-crypto-${PV}"
20 LIBEXEC="freebsd-libexec-${PV}"
21 SBIN="freebsd-sbin-${PV}"
22 GNU="freebsd-gnu-${PV}"
23 ETC="freebsd-etc-${PV}"
24 SYS="freebsd-sys-${PV}"
25 INCLUDE="freebsd-include-${PV}"
26 RESCUE="freebsd-rescue-${PV}"
27 CDDL="freebsd-cddl-${PV}"
28
29 # Release version (5.3, 5.4, 6.0, etc)
30 RV="$(get_version_component_range 1-2)"
31
32 if [[ ${PN} != "freebsd-share" ]] && [[ ${PN} != freebsd-sources ]]; then
33 IUSE="profile"
34 fi
35
36 #unalias -a
37 alias install-info='/usr/bin/bsdinstall-info'
38
39 EXPORT_FUNCTIONS src_compile src_install src_unpack
40
41 # doperiodic <kind> <file> ...
42 doperiodic() {
43 local kind=$1
44 shift
45
46 ( # dont want to pollute calling env
47 insinto /etc/periodic/${kind}
48 insopts -m 0755
49 doins "$@"
50 )
51 }
52
53 freebsd_get_bmake() {
54 local bmake
55 bmake=$(get_bmake)
56 [[ ${CBUILD} == *-freebsd* ]] || bmake="${bmake} -m /usr/share/mk/freebsd"
57
58 echo "${bmake}"
59 }
60
61 freebsd_do_patches() {
62 if [[ ${#PATCHES[@]} -gt 1 ]] ; then
63 for x in "${PATCHES[@]}"; do
64 epatch "${x}"
65 done
66 else
67 for x in ${PATCHES} ; do
68 epatch "${x}"
69 done
70 fi
71 epatch_user
72 }
73
74 freebsd_rename_libraries() {
75 ebegin "Renaming libraries"
76 # We don't use libtermcap, we use libncurses
77 find "${S}" -name Makefile -print0 | xargs -0 \
78 sed -i -e 's:-ltermcap:-lncurses:g; s:{LIBTERMCAP}:{LIBNCURSES}:g'
79 # flex provides libfl, not libl
80 find "${S}" -name Makefile -print0 | xargs -0 \
81 sed -i -e 's:-ll$:-lfl:g; s:-ll :-lfl :g; s:{LIBL}:{LIBFL}:g'
82 # ncurses provides libncursesw not libcursesw
83 find "${S}" -name Makefile -print0 | xargs -0 \
84 sed -i -e 's:-lcursesw:-lncursesw:g'
85 # we use expat instead of bsdxml
86 find "${S}" -name Makefile -print0 | xargs -0 \
87 sed -i -e 's:-lbsdxml:-lexpat:g'
88
89 eend $?
90 }
91
92 freebsd_src_unpack() {
93 unpack ${A}
94 cd "${S}"
95
96 dummy_mk ${REMOVE_SUBDIRS}
97
98 freebsd_do_patches
99 freebsd_rename_libraries
100 }
101
102 freebsd_src_compile() {
103 use profile && filter-flags "-fomit-frame-pointer"
104 use profile || mymakeopts="${mymakeopts} NO_PROFILE= "
105
106 mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= NO_FSCHG="
107
108 # Many things breaks when using ricer flags here
109 [[ -z "${NOFLAGSTRIP}" ]] && strip-flags
110
111 # Make sure to use FreeBSD definitions while crosscompiling
112 [[ -z "${BMAKE}" ]] && BMAKE="$(freebsd_get_bmake)"
113
114 # Create objdir if MAKEOBJDIRPREFIX is defined, so that we can make out of
115 # tree builds easily.
116 if [[ -n "${MAKEOBJDIRPREFIX}" ]] ; then
117 mkmake obj || die
118 fi
119
120 bsdmk_src_compile
121 }
122
123 freebsd_src_install() {
124 use profile || mymakeopts="${mymakeopts} NO_PROFILE= "
125
126 mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= NO_FSCHG="
127
128 [[ -z "${BMAKE}" ]] && BMAKE="$(freebsd_get_bmake)"
129
130 bsdmk_src_install
131 }

  ViewVC Help
Powered by ViewVC 1.1.20