Diff darwin-miscutils-11 with a darwin-miscutils-12

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

  
6 6
inherit toolchain-funcs
7 7

  
8
# from macOS 10.12
9
MISC_VER=33
10
SHELL_VER=198
11
# from DT 8.1
8
# from macOS 10.13
9
MISC_VER=34
10
SHELL_VER=203
11
# from DT 8.2.1
12 12
DEV_VER=63
13 13
# from 10.7.4
14
MD_VER=147 # 148 in 10.8 has no md, bug #428530
14
MD_VER=147 # adv_cmds-148 in 10.8 has no md, bug #428530
15 15

  
16
DESCRIPTION="Miscellaneous commands used on macOS, Sierra 10.12"
16
DESCRIPTION="Miscellaneous commands used on macOS, High Sierra 10.13"
17 17
HOMEPAGE="https://www.opensource.apple.com/"
18 18
SRC_URI="https://opensource.apple.com/tarballs/misc_cmds/misc_cmds-${MISC_VER}.tar.gz
19 19
	https://opensource.apple.com/tarballs/shell_cmds/shell_cmds-${SHELL_VER}.tar.gz
20 20
	https://opensource.apple.com/tarballs/developer_cmds/developer_cmds-${DEV_VER}.tar.gz
21 21
	https://opensource.apple.com/source/adv_cmds/adv_cmds-${MD_VER}/md/md.c -> adv_cmds-md-${MD_VER}.c
22
	https://opensource.apple.com/source/adv_cmds/adv_cmds-${MD_VER}/md/md.1 -> adv_cmds-md-${MD_VER}.1"
22
	https://opensource.apple.com/source/adv_cmds/adv_cmds-${MD_VER}/md/md.1 -> adv_cmds-md-${MD_VER}.1
23
	https://642666.bugs.gentoo.org/attachment.cgi?id=511988 -> adv_cmds-md-${MD_VER}-compile.patch"
23 24

  
24 25
LICENSE="BSD"
25 26
SLOT="0"
26 27
KEYWORDS="~arm64-macos ~ppc-macos ~x64-macos"
27 28
IUSE=""
28 29

  
30
# for ncal
31
DEPEND="sys-libs/ncurses:="
32
RDEPEND="${DEPEND}"
33

  
29 34
S=${WORKDIR}
30 35

  
31 36
src_prepare() {
......
33 38
	eapply "${FILESDIR}"/${PN}-6-w64.patch
34 39

  
35 40
	mkdir -p "${S}"/adv_cmds-${MD_VER}/md || die
36
	cp "${DISTDIR}"/adv_cmds-md-${MD_VER}.c \
37
		"${S}"/adv_cmds-${MD_VER}/md/md.c || die
38
	cp "${DISTDIR}"/adv_cmds-md-${MD_VER}.1 \
39
		"${S}"/adv_cmds-${MD_VER}/md/md.1 || die
41
	cd "${S}"/adv_cmds-${MD_VER} || die
42
	cp "${DISTDIR}"/adv_cmds-md-${MD_VER}.c md/md.c || die
43
	cp "${DISTDIR}"/adv_cmds-md-${MD_VER}.1 md/md.1 || die
44
	eapply "${DISTDIR}"/adv_cmds-md-${MD_VER}-compile.patch
45
	eapply "${FILESDIR}"/${PN}-12-md-register.patch
40 46

  
47
	cd "${S}"
41 48
	eapply_user
42 49
}
43 50

  
......
46 53
		${CFLAGS}
47 54
		-I.
48 55
		-D__FBSDID=__RCSID
49
		-Wsystem-headers
50 56
		-Du_int=uint32_t
51 57
		-include stdint.h
52
		${LDFLAGS}
53 58
	)
54 59

  
60
	v() {
61
		echo "$*"
62
		$@
63
	}
64

  
55 65
	local TS=${S}/misc_cmds-${MISC_VER}
56 66
	# tsort is provided by coreutils
57 67
	for t in leave units calendar; do
58 68
		cd "${TS}/${t}"
59 69
		echo "in ${TS}/${t}:"
60
		echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
61
		$(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
70
		v $(tc-getCC) ${flags[@]} -o ${t} ${LDFLAGS} *.c || die
62 71
	done
63 72
	# compile cal separately
64 73
	cd "${TS}/ncal"
65 74
	echo "in ${TS}/ncal:"
66
	echo "$(tc-getCC) ${flags[@]} -c calendar.c"
67
	$(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
68
	echo "$(tc-getCC) ${flags[@]} -c easter.c"
69
	$(tc-getCC) ${flags[@]} -c easter.c || die "failed to compile cal"
70
	echo "$(tc-getCC) ${flags[@]} -c ncal.c"
71
	$(tc-getCC) ${flags[@]} -c ncal.c || die "failed to compile cal"
72
	echo "$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o"
73
	$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o || die "failed to compile cal"
75
	v $(tc-getCC) ${flags[@]} -c calendar.c || die
76
	v $(tc-getCC) ${flags[@]} -c easter.c || die
77
	v $(tc-getCC) ${flags[@]} -c ncal.c || die
78
	v $(tc-getCC) -o cal ${LDFLAGS} -lncurses calendar.o easter.o ncal.o || die
74 79

  
75 80
	TS=${S}/shell_cmds-${SHELL_VER}
76 81
	# only pick those tools not provided by coreutils, findutils
......
79 84
		lastcomm renice script shlock time whereis;
80 85
	do
81 86
		echo "in ${TS}/${t}:"
82
		echo "$(tc-getCC) ${flags[@]} -o ${t} *.c"
83 87
		cd "${TS}/${t}"
84
		$(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
88
		v $(tc-getCC) ${flags[@]} -o ${t} ${LDFLAGS} *.c || die
85 89
	done
86 90
	cd "${TS}/w"
87 91
	sed -i -e '/#include <libutil.h>/d' w.c || die
88 92
	echo "in ${TS}/w:"
89
	echo "$(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w *.c"
90
	$(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w *.c \
91
		|| die "failed to compile w"
93
	v $(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 ${LDFLAGS} -lresolv -o w *.c || die
92 94

  
93 95
	TS=${S}/developer_cmds-${DEV_VER}
94 96
	# only pick those tools that do not conflict (no ctags and indent)
95 97
	# do not install lorder, mkdep and vgrind as they are a non-prefix-aware
96 98
	# shell scripts
97 99
	# don't install rpcgen, as it is heavily related to the OS it runs
98
	# on (and this is the Sierra version)
100
	# on (and this is the High Sierra version)
99 101
	for t in asa unifdef what ; do
100 102
		echo "in ${TS}/${t}:"
101 103
		cd "${TS}/${t}" || die
102
		echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
103
		$(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
104
		v $(tc-getCC) ${flags[@]} -o ${t} ${LDFLAGS} *.c || die
104 105
	done
105 106

  
106 107
	# provide this one for gcc-apple
......
108 109
	for t in md ; do
109 110
		echo "in ${TS}/${t}:"
110 111
		cd "${TS}/${t}" || die
111
		echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
112
		$(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
112
		v $(tc-getCC) ${flags[@]} -o ${t} ${LDFLAGS} *.c || die
113 113
	done
114 114
}
115 115

  
116 116
src_install() {
117
	mkdir -p "${ED}"/bin
118
	mkdir -p "${ED}"/usr/bin
117
	mkdir -p "${ED}"/{,usr/}bin
119 118

  
120 119
	local TS=${S}/misc_cmds-${MISC_VER}
121 120
	for t in leave units calendar ; do
......
123 122
		doman "${TS}/${t}/${t}.1"
124 123
	done
125 124
	# copy cal separately
126
	cp "${TS}/ncal/cal" "${ED}"/usr/bin/
127
	dosym /usr/bin/cal /usr/bin/ncal
125
	cp "${TS}/ncal/cal" "${ED}"/usr/bin/ncal
126
	dosym ncal /usr/bin/cal
128 127
	doman "${TS}/ncal/ncal.1"
129
	dosym /usr/share/man/man1/ncal.1 /usr/share/man/man1/cal.1
128
	dosym ncal.1 /usr/share/man/man1/cal.1
130 129

  
131 130
	TS=${S}/shell_cmds-${SHELL_VER}
132 131
	for t in \
Thank you!