Diff darwin-miscutils-6-r1 with a darwin-miscutils-8

/usr/portage/sys-apps/darwin-miscutils/darwin-miscutils-8.ebuild 2023-10-09 14:52:35.352368498 +0300
5 5

  
6 6
inherit toolchain-funcs epatch
7 7

  
8
MISC_VER=23
9
SHELL_VER=118
10
DEV_VER=49
8
MISC_VER=27
9
SHELL_VER=149
10
DEV_VER=53.1
11 11

  
12
DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Leopard"
12
DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Snow Leopard 10.6.3"
13 13
HOMEPAGE="http://www.opensource.apple.com/"
14 14
SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
15 15
	http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
......
23 23
S=${WORKDIR}
24 24

  
25 25
src_prepare() {
26
	epatch "${FILESDIR}"/${PN}-5-w.patch
27
	epatch "${FILESDIR}"/${PN}-5-stdlib.patch
26
	cd "${S}"/shell_cmds-${SHELL_VER}
28 27
	epatch "${FILESDIR}"/${PN}-6-w64.patch
29
	cd "${S}"/developer_cmds-${DEV_VER}
30
	epatch "${FILESDIR}"/${PN}-5-error.patch
31 28
	# deal with OSX Lion and above
29
	cd "${S}"/developer_cmds-${DEV_VER}
32 30
	sed -i -e 's/getline/ugetline/g' unifdef/unifdef.c || die
33 31

  
34 32
	eapply_user
35 33
}
36 34

  
37 35
src_compile() {
36
	local flags=(
37
		${CFLAGS}
38
		-I.
39
		-D__FBSDID=__RCSID
40
		-Wsystem-headers
41
		-Du_int=uint32_t
42
		-include stdint.h
43
		${LDFLAGS}
44
	)
45

  
38 46
	local TS=${S}/misc_cmds-${MISC_VER}
39 47
	# tsort is provided by corepatch
40 48
	for t in leave units calendar; do
41 49
		cd "${TS}/${t}"
42 50
		echo "in ${TS}/${t}:"
43
		echo "$(tc-getCC) -o ${t}" *.c
44
		$(tc-getCC) -o ${t} *.c || die "failed to compile $t"
51
		echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
52
		$(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
45 53
	done
46 54
	# compile cal separately
47 55
	cd "${TS}/ncal"
48 56
	echo "in ${TS}/ncal:"
49
	local flags
50
	flags[0]=-I.
51
	flags[1]=-D__FBSDID=__RCSID
52
	flags[2]=-Wsystem-headers
53 57
	echo "$(tc-getCC) ${flags[@]} -c calendar.c"
54 58
	$(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
55 59
	echo "$(tc-getCC) ${flags[@]} -c easter.c"
......
62 66
	TS=${S}/shell_cmds-${SHELL_VER}
63 67
	# only pick those tools not provided by corepatch, findutils
64 68
	for t in \
65
		alias apply getopt hostname jot kill \
66
		lastcomm renice shlock time whereis;
69
		alias apply getopt hostname jot kill killall \
70
		lastcomm renice script shlock time whereis;
67 71
	do
68 72
		echo "in ${TS}/${t}:"
69
		echo "$(tc-getCC) -o ${t} ${t}.c"
73
		echo "$(tc-getCC) ${flags[@]} -o ${t} ${t}.c"
70 74
		cd "${TS}/${t}"
71
		$(tc-getCC) -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) -D__FBSDID=__RCSID -o ${t} ${t}.c"
79
		cd "${TS}/${t}"
80
		$(tc-getCC) -D__FBSDID=__RCSID -o ${t} ${t}.c || die "failed to compile $t"
75
		$(tc-getCC) ${flags[@]} -o ${t} ${t}.c || die "failed to compile $t"
81 76
	done
82 77
	cd "${TS}/w"
78
	sed -i -e '/#include <libutil.h>/d' w.c || die
83 79
	echo "in ${TS}/w:"
84
	echo "$(tc-getCC) -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
85
	$(tc-getCC) -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
80
	echo "$(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
81
	$(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
86 82
		|| die "failed to compile w"
87 83

  
88 84
	TS=${S}/developer_cmds-${DEV_VER}
......
90 86
	# do not install lorder, mkdep and vgrind as they are a non-prefix-aware
91 87
	# shell scripts
92 88
	# don't install rpcgen, as it is heavily related to the OS it runs
93
	# on (and this is the Leopard version)
94
	for t in asa error hexdump unifdef what ; do
89
	# on (and this is the Snow Leopard version)
90
	for t in asa hexdump unifdef what ; do
95 91
		echo "in ${TS}/${t}:"
96
		cd "${TS}/${t}"
97
		sed -i -e '/^__FBSDID/d' *.c
98
		echo "$(tc-getCC) -o ${t}" *.c
99
		$(tc-getCC) -o ${t} *.c || die "failed to compile $t"
92
		cd "${TS}/${t}" || die
93
		echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
94
		$(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
100 95
	done
101 96
}
102 97

  
......
118 113
	TS=${S}/shell_cmds-${SHELL_VER}
119 114
	for t in \
120 115
		alias apply getopt jot killall lastcomm \
121
		renice script shlock su time w whereis;
116
		renice script shlock time w whereis;
122 117
	do
123 118
		cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
124 119
		[[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
......
132 127
	done
133 128

  
134 129
	TS=${S}/developer_cmds-${DEV_VER}
135
	for t in asa error hexdump unifdef what ; do
130
	for t in asa hexdump unifdef what ; do
136 131
		cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
137 132
		doman "${TS}/${t}/${t}.1"
138 133
	done
Thank you!