/[gentoo-x86]/sys-apps/darwin-miscutils/darwin-miscutils-7.ebuild
Gentoo

Contents of /sys-apps/darwin-miscutils/darwin-miscutils-7.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Fri Mar 5 18:04:28 2010 UTC (9 years, 10 months ago) by grobian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +4 -5 lines
Convert to EAPI=3
(Portage version: 2.2.00.15738-prefix/cvs/Darwin powerpc)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/darwin-miscutils/darwin-miscutils-7.ebuild,v 1.5 2010/01/08 08:56:43 grobian Exp $
4
5 EAPI="3"
6
7 inherit toolchain-funcs eutils
8
9 MISC_VER=27
10 SHELL_VER=149
11 DEV_VER=52.1
12
13 DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Snow Leopard"
14 HOMEPAGE="http://www.opensource.apple.com/"
15 SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
16 http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
17 http://www.opensource.apple.com/darwinsource/tarballs/other/developer_cmds-${DEV_VER}.tar.gz"
18
19 LICENSE="BSD"
20 SLOT="0"
21 KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
22 IUSE=""
23
24 S=${WORKDIR}
25
26 src_prepare() {
27 cd "${S}"/shell_cmds-${SHELL_VER}
28 epatch "${FILESDIR}"/${PN}-6-w64.patch
29 }
30
31 src_compile() {
32 local flags=(
33 ${CFLAGS}
34 -I.
35 -D__FBSDID=__RCSID
36 -Wsystem-headers
37 -Du_int=uint32_t
38 -include stdint.h
39 ${LDFLAGS}
40 )
41
42 local TS=${S}/misc_cmds-${MISC_VER}
43 # tsort is provided by coreutils
44 for t in leave units calendar; do
45 cd "${TS}/${t}"
46 echo "in ${TS}/${t}:"
47 echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
48 $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
49 done
50 # compile cal separately
51 cd "${TS}/ncal"
52 echo "in ${TS}/ncal:"
53 echo "$(tc-getCC) ${flags[@]} -c calendar.c"
54 $(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
55 echo "$(tc-getCC) ${flags[@]} -c easter.c"
56 $(tc-getCC) ${flags[@]} -c easter.c || die "failed to compile cal"
57 echo "$(tc-getCC) ${flags[@]} -c ncal.c"
58 $(tc-getCC) ${flags[@]} -c ncal.c || die "failed to compile cal"
59 echo "$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o"
60 $(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o || die "failed to compile cal"
61
62 TS=${S}/shell_cmds-${SHELL_VER}
63 # only pick those tools not provided by coreutils, findutils
64 for t in \
65 alias apply getopt hostname jot kill \
66 lastcomm renice shlock time whereis;
67 do
68 echo "in ${TS}/${t}:"
69 echo "$(tc-getCC) ${flags[@]} -o ${t} ${t}.c"
70 cd "${TS}/${t}"
71 $(tc-getCC) ${flags[@]} -o ${t} ${t}.c || die "failed to compile $t"
72 done
73 # script and killall need additonal flags
74 for t in \
75 killall script
76 do
77 echo "in ${TS}/${t}:"
78 echo "$(tc-getCC) ${flags[@]} -o ${t} ${t}.c"
79 cd "${TS}/${t}"
80 $(tc-getCC) ${flags[@]} -o ${t} ${t}.c || die "failed to compile $t"
81 done
82 cd "${TS}/w"
83 sed -i -e '/#include <libutil.h>/d' w.c || die
84 echo "in ${TS}/w:"
85 echo "$(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
86 $(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
87 || die "failed to compile w"
88
89 TS=${S}/developer_cmds-${DEV_VER}
90 # only pick those tools that do not conflict (no ctags and indent)
91 # do not install lorder, mkdep and vgrind as they are a non-prefix-aware
92 # shell scripts
93 # don't install rpcgen, as it is heavily related to the OS it runs
94 # on (and this is the Leopard version)
95 for t in asa error hexdump unifdef what ; do
96 echo "in ${TS}/${t}:"
97 cd "${TS}/${t}"
98 echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
99 $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
100 done
101 }
102
103 src_install() {
104 mkdir -p "${ED}"/bin
105 mkdir -p "${ED}"/usr/bin
106
107 local TS=${S}/misc_cmds-${MISC_VER}
108 for t in leave units calendar ; do
109 cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
110 doman "${TS}/${t}/${t}.1"
111 done
112 # copy cal separately
113 cp "${TS}/ncal/cal" "${ED}"/usr/bin/
114 dosym /usr/bin/cal /usr/bin/ncal
115 doman "${TS}/ncal/ncal.1"
116 dosym /usr/share/man/man1/ncal.1 /usr/share/man/man1/cal.1
117
118 TS=${S}/shell_cmds-${SHELL_VER}
119 for t in \
120 alias apply getopt jot killall lastcomm \
121 renice script shlock time w whereis;
122 do
123 cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
124 [[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
125 [[ -f "${TS}/${t}/${t}.8" ]] && doman "${TS}/${t}/${t}.8"
126 done
127 cp "${TS}/w/w" "${ED}"/usr/bin/uptime
128 doman "${TS}/w/uptime.1"
129 for t in hostname kill; do
130 cp "${TS}/${t}/${t}" "${ED}"/bin/
131 doman "${TS}/${t}/${t}.1"
132 done
133
134 TS=${S}/developer_cmds-${DEV_VER}
135 for t in asa error hexdump unifdef what ; do
136 cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
137 doman "${TS}/${t}/${t}.1"
138 done
139 }

  ViewVC Help
Powered by ViewVC 1.1.20