Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/timezone-data/
Date: Wed, 30 Nov 2022 04:14:41
Message-Id: 1669781617.bbc000577ac274fd99264855600ea6420b843106.sam@gentoo
1 commit: bbc000577ac274fd99264855600ea6420b843106
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 30 04:08:07 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 30 04:13:37 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bbc00057
7
8 sys-libs/timezone-data: add 2022g
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-libs/timezone-data/Manifest | 2 +
13 sys-libs/timezone-data/timezone-data-2022g.ebuild | 197 ++++++++++++++++++++++
14 2 files changed, 199 insertions(+)
15
16 diff --git a/sys-libs/timezone-data/Manifest b/sys-libs/timezone-data/Manifest
17 index c6a733f3a621..f77fe1d38129 100644
18 --- a/sys-libs/timezone-data/Manifest
19 +++ b/sys-libs/timezone-data/Manifest
20 @@ -1,2 +1,4 @@
21 DIST tzcode2022f.tar.gz 284816 BLAKE2B 3bfcc25323edbdd41aadcbb5c8b0d9179a809a87b22afc9dda88a53c6daab742778956af7aa30722429d34601fb2ad3c4222c48497e0a429926cd05b79b9acfb SHA512 3e2ef91b972f1872e3e8da9eae9d1c4638bfdb32600f164484edd7147be45a116db80443cd5ae61b5c34f8b841e4362f4beefd957633f6cc9b7def543ed6752b
22 +DIST tzcode2022g.tar.gz 287901 BLAKE2B b67bb2020913c57cc6bc68d231c53ba645b95305256065e2645bce3b0d71adfaea865ed9bf40f1ec3b4a73aad7e6c48f5ecd0895de6e2d69bed6113d6b579e26 SHA512 5188edd8d05238a88da734cf78fadfb57640d4db3e7a0a9dddd70e3071e16b6eebc2e2ab17109b7dafafae68abfbc857df481cfdc3ffe63f7eb1569ea0b5997a
23 DIST tzdata2022f.tar.gz 436352 BLAKE2B 8081972005ac84034957bb85013b373df67937c3f811e33c44fad7ecee0f504b946766fdb1f525d0512b9a8d8e727ee3d8d44640ff55bed3fcd1f3fb3c464c17 SHA512 72d05d05be999075cdf57b896c0f4238b1b862d4d0ed92cc611736592a4ada14d47bd7f0fc8be39e7938a7f5940a903c8af41e87859482bcfab787d889d429f6
24 +DIST tzdata2022g.tar.gz 439731 BLAKE2B 582b79cc2317d27f3883042cbca25801397d9e2808ad8d3a340017d635372ef20316ce646a25a43b0ea5d4024841b54925ecc4510613295c39c28647989645cb SHA512 7f79394295e00e3a24ebdbf9af3bc454a65f432a93b517e7e96c7f9db9949f6f5fdae9892a9d3789ff44ae0eb1bfe4744d36976b4624659af951d26414f94e65
25
26 diff --git a/sys-libs/timezone-data/timezone-data-2022g.ebuild b/sys-libs/timezone-data/timezone-data-2022g.ebuild
27 new file mode 100644
28 index 000000000000..190c46867d53
29 --- /dev/null
30 +++ b/sys-libs/timezone-data/timezone-data-2022g.ebuild
31 @@ -0,0 +1,197 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +inherit toolchain-funcs flag-o-matic
38 +
39 +MY_CODE_VER=${PV}
40 +MY_DATA_VER=${PV}
41 +DESCRIPTION="Timezone data (/usr/share/zoneinfo) and utilities (tzselect/zic/zdump)"
42 +HOMEPAGE="https://www.iana.org/time-zones"
43 +SRC_URI="https://www.iana.org/time-zones/repository/releases/tzdata${MY_DATA_VER}.tar.gz
44 + https://www.iana.org/time-zones/repository/releases/tzcode${MY_CODE_VER}.tar.gz"
45 +
46 +LICENSE="BSD public-domain"
47 +SLOT="0"
48 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
49 +IUSE="nls leaps-timezone zic-slim"
50 +
51 +DEPEND="nls? ( virtual/libintl )"
52 +RDEPEND="
53 + ${DEPEND}
54 + !sys-libs/glibc[vanilla(+)]
55 +"
56 +
57 +src_unpack() {
58 + mkdir "${S}" && cd "${S}" || die
59 + default
60 +}
61 +
62 +src_prepare() {
63 + default
64 +
65 + # check_web contacts validator.w3.org
66 + sed -i -e 's/check_tables check_web/check_tables/g' \
67 + Makefile || die "Failed to disable check_web"
68 +
69 + if tc-is-cross-compiler ; then
70 + cp -pR "${S}" "${S}"-native || die
71 + fi
72 +}
73 +
74 +src_configure() {
75 + tc-export CC
76 +
77 + # bug #471102
78 + append-lfs-flags
79 +
80 + if use elibc_Darwin ; then
81 + # bug #138251
82 + append-cppflags -DSTD_INSPIRED
83 + fi
84 +
85 + append-cppflags -DHAVE_GETTEXT=$(usex nls 1 0) -DTZ_DOMAIN='\"libc\"'
86 +
87 + # Upstream default is 'slim', but it breaks quite a few programs
88 + # that parse /etc/localtime directly: bug #747538.
89 + append-cppflags -DZIC_BLOAT_DEFAULT='\"'$(usex zic-slim slim fat)'\"'
90 +
91 + LDLIBS=""
92 + if use nls ; then
93 + # See if an external libintl is available. bug #154181, bug #578424
94 + local c="${T}/test"
95 + echo 'main(){}' > "${c}.c" || die
96 + if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} "${c}.c" -o "${c}" -lintl 2>/dev/null ; then
97 + LDLIBS+=" -lintl"
98 + fi
99 + fi
100 +}
101 +
102 +_emake() {
103 + emake \
104 + REDO=$(usex leaps-timezone posix_right posix_only) \
105 + TOPDIR="${EPREFIX}" \
106 + ZICDIR='$(TOPDIR)/usr/bin' \
107 + "$@"
108 +}
109 +
110 +src_compile() {
111 + _emake \
112 + AR="$(tc-getAR)" \
113 + cc="$(tc-getCC)" \
114 + RANLIB="$(tc-getRANLIB)" \
115 + CFLAGS="${CFLAGS} -std=gnu99 ${CPPFLAGS}" \
116 + LDFLAGS="${LDFLAGS}" \
117 + LDLIBS="${LDLIBS}"
118 +
119 + if tc-is-cross-compiler ; then
120 + _emake -C "${S}"-native \
121 + AR="$(tc-getBUILD_AR)" \
122 + cc="$(tc-getBUILD_CC)" \
123 + RANLIB="$(tc-getBUILD_RANLIB)" \
124 + CFLAGS="${BUILD_CFLAGS} ${BUILD_CPPFLAGS}" \
125 + LDFLAGS="${BUILD_LDFLAGS}" \
126 + LDLIBS="${LDLIBS}" \
127 + zic
128 + fi
129 +}
130 +
131 +src_test() {
132 + # VALIDATE_ENV is used for extended/web based tests. Punt on them.
133 + emake check VALIDATE_ENV=true
134 +}
135 +
136 +src_install() {
137 + local zic=""
138 + tc-is-cross-compiler && zic="zic=${S}-native/zic"
139 + _emake install ${zic} DESTDIR="${D}" LIBDIR="/nukeit"
140 + rm -rf "${D}/nukeit" "${ED}/etc" || die
141 +
142 + insinto /usr/share/zoneinfo
143 + doins "${S}"/leap-seconds.list
144 +
145 + # Delete man pages installed by man-pages package.
146 + rm "${ED}"/usr/share/man/man5/tzfile.5* "${ED}"/usr/share/man/man8/{tzselect,zdump,zic}.8 || die
147 + dodoc CONTRIBUTING README NEWS *.html
148 +}
149 +
150 +get_TIMEZONE() {
151 + local tz src="${EROOT}/etc/timezone"
152 + if [[ -e ${src} ]] ; then
153 + tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
154 + else
155 + tz="FOOKABLOIE"
156 + fi
157 +
158 + [[ -z ${tz} ]] && return 1 || echo "${tz}"
159 +}
160 +
161 +pkg_preinst() {
162 + local tz=$(get_TIMEZONE)
163 + if [[ ${tz} == right/* || ${tz} == posix/* ]] ; then
164 + eerror "The right & posix subdirs are no longer installed as subdirs -- they have been"
165 + eerror "relocated to match upstream paths as sibling paths. Further, posix/xxx is the"
166 + eerror "same as xxx, so you should simply drop the posix/ prefix. You also should not"
167 + eerror "be using right/xxx for the system timezone as it breaks programs."
168 + die "Please fix your timezone setting"
169 + fi
170 +
171 + # Trim the symlink by hand to avoid portage's automatic protection checks.
172 + rm -f "${EROOT}"/usr/share/zoneinfo/posix
173 +}
174 +
175 +configure_tz_data() {
176 + # Make sure the /etc/localtime file does not get stale, bug #127899
177 + local tz src="${EROOT}/etc/timezone" etc_lt="${EROOT}/etc/localtime"
178 +
179 + # If it's a symlink, assume the user knows what they're doing and
180 + # they're managing it themselves, bug #511474
181 + if [[ -L "${etc_lt}" ]] ; then
182 + einfo "Assuming your ${etc_lt} symlink is what you want; skipping update."
183 + return 0
184 + fi
185 +
186 + if ! tz=$(get_TIMEZONE) ; then
187 + einfo "Assuming your empty ${src} file is what you want; skipping update."
188 + return 0
189 + fi
190 +
191 + if [[ "${tz}" == "FOOKABLOIE" ]] ; then
192 + einfo "You do not have a timezone set in ${src}; skipping update."
193 + return 0
194 + fi
195 +
196 + local tzpath="${EROOT}/usr/share/zoneinfo/${tz}"
197 +
198 + if [[ ! -e ${tzpath} ]]; then
199 + ewarn "The timezone specified in ${src} is not valid!"
200 + return 1
201 + fi
202 +
203 + if [[ -f ${etc_lt} ]]; then
204 + # If a regular file already exists, copy over it.
205 + ewarn "Found a regular file at ${etc_lt}."
206 + ewarn "Some software may expect a symlink instead."
207 + ewarn "You may convert it to a symlink by removing the file and running:"
208 + ewarn " emerge --config sys-libs/timezone-data"
209 + einfo "Copying ${tzpath} to ${etc_lt}."
210 + cp -f "${tzpath}" "${etc_lt}"
211 + else
212 + # Otherwise, create a symlink and remove the timezone file.
213 + tzpath="../usr/share/zoneinfo/${tz}"
214 + einfo "Linking ${tzpath} at ${etc_lt}."
215 + if ln -snf "${tzpath}" "${etc_lt}"; then
216 + einfo "Removing ${src}."
217 + rm -f "${src}"
218 + fi
219 + fi
220 +}
221 +
222 +pkg_config() {
223 + configure_tz_data
224 +}
225 +
226 +pkg_postinst() {
227 + configure_tz_data
228 +}