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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Sun Jun 26 12:30:57 2011 UTC (8 years, 7 months ago) by grobian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +4 -1 lines
(Try to) resolve naming conflict on OSX Lion, bug #372751

(Portage version: 2.2.01.18826-prefix/cvs/Darwin powerpc)

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

  ViewVC Help
Powered by ViewVC 1.1.20