Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-geosciences/gpsd/
Date: Sat, 25 Sep 2021 00:05:18
Message-Id: 1632528213.eb168717fae4bf7dc26fe75a08255fb78925535c.sam@gentoo
1 commit: eb168717fae4bf7dc26fe75a08255fb78925535c
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 25 00:03:33 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 25 00:03:33 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb168717
7
8 sci-geosciences/gpsd: add 3.23.1
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sci-geosciences/gpsd/Manifest | 1 +
13 sci-geosciences/gpsd/gpsd-3.23.1.ebuild | 212 ++++++++++++++++++++++++++++++++
14 2 files changed, 213 insertions(+)
15
16 diff --git a/sci-geosciences/gpsd/Manifest b/sci-geosciences/gpsd/Manifest
17 index cfa2ee6fc84..9dd813f6555 100644
18 --- a/sci-geosciences/gpsd/Manifest
19 +++ b/sci-geosciences/gpsd/Manifest
20 @@ -1,2 +1,3 @@
21 DIST gpsd-3.21.tar.xz 2620396 BLAKE2B 366d1857f7ff63e087ac1bec8c95d997cd8d48a60d5548c1644748e1ed20334f45a4fb279bc26c61481cc3dea0244eb0aaca0ba562838a3b5de15da5d1d82502 SHA512 a45416c31ee891a84203aea786b6385ea5f557a406d898a8facdde78d120199b7e7db8f86ab8c395f6ca90965940355fa19413b2b918642fd8c7df219745233e
22 +DIST gpsd-3.23.1.tar.gz 4904121 BLAKE2B 277c0c12cbe73d7c637cb0e6ce7b6ba15bead55efbbc7f4c9d9d5524f76d60261438df31b66c491e92216d8f3f7e6a13759c0e0cdd200cfae3cc3d616bf98dd5 SHA512 fccfac363103282581e4ea8236ce40e4600a01f02489c1aaec721a13deac556bac046a3b76f8a5e21fe8c736056e872d8c7f2e4ed2d38a164323dd9738f00388
23 DIST gpsd-3.23.tar.gz 4893363 BLAKE2B 502c1f2103f3b4224f3bc654bfe6e08e7ddf84707a0db6369e52608c095d5d082da020091ebca27d403cf74fa0bee5ebe1550068263d8d7a55143da2bc1a7350 SHA512 967cc9801271418023630df02b457b76108968992151f6e80b569e99b856bd79cc3d0369d2088f3bc609b2ab22b29dba87639bf466bf262ab80b2b3f04055f8b
24
25 diff --git a/sci-geosciences/gpsd/gpsd-3.23.1.ebuild b/sci-geosciences/gpsd/gpsd-3.23.1.ebuild
26 new file mode 100644
27 index 00000000000..550576d658a
28 --- /dev/null
29 +++ b/sci-geosciences/gpsd/gpsd-3.23.1.ebuild
30 @@ -0,0 +1,212 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +DISTUTILS_OPTIONAL=1
37 +PYTHON_COMPAT=( python3_{8,9,10} )
38 +SCONS_MIN_VERSION="2.3.0"
39 +
40 +inherit udev multilib distutils-r1 scons-utils toolchain-funcs
41 +
42 +if [[ ${PV} == "9999" ]] ; then
43 + EGIT_REPO_URI="https://gitlab.com/gpsd/gpsd.git"
44 + inherit git-r3
45 +else
46 + SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
47 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
48 +fi
49 +
50 +DESCRIPTION="GPS daemon and library for USB/serial GPS devices and GPS/mapping clients"
51 +HOMEPAGE="https://gpsd.gitlab.io/gpsd/"
52 +
53 +LICENSE="BSD"
54 +SLOT="0/29"
55 +
56 +GPSD_PROTOCOLS=(
57 + aivdm ashtech earthmate evermore fury fv18 garmin garmintxt geostar
58 + gpsclock greis isync itrax mtk3301 navcom nmea0183 nmea2000 ntrip
59 + oceanserver oncore passthrough rtcm104v2 rtcm104v3 sirf skytraq
60 + superstar2 tnt tripmate tsip ublox
61 +)
62 +IUSE_GPSD_PROTOCOLS=${GPSD_PROTOCOLS[@]/#/+gpsd_protocols_}
63 +IUSE="${IUSE_GPSD_PROTOCOLS} bluetooth +cxx dbus debug ipv6 latency-timing ncurses ntp python qt5 +shm +sockets static systemd test udev usb X"
64 +REQUIRED_USE="X? ( python )
65 + gpsd_protocols_nmea2000? ( gpsd_protocols_aivdm )
66 + gpsd_protocols_isync? ( gpsd_protocols_ublox )
67 + gpsd_protocols_ublox? ( python )
68 + gpsd_protocols_greis? ( python )
69 + python? ( ${PYTHON_REQUIRED_USE} )
70 + qt5? ( cxx )"
71 +RESTRICT="!test? ( test )"
72 +
73 +RDEPEND="
74 + acct-user/gpsd
75 + acct-group/dialout
76 + >=net-misc/pps-tools-0.0.20120407
77 + $(python_gen_any_dep 'dev-util/scons[${PYTHON_USEDEP}]')
78 + bluetooth? ( net-wireless/bluez:= )
79 + dbus? (
80 + sys-apps/dbus
81 + dev-libs/dbus-glib
82 + )
83 + ncurses? ( sys-libs/ncurses:= )
84 + ntp? ( || (
85 + net-misc/ntp
86 + net-misc/ntpsec
87 + net-misc/chrony
88 + ) )
89 + qt5? (
90 + dev-qt/qtcore:5
91 + dev-qt/qtnetwork:5
92 + )
93 + python? ( ${PYTHON_DEPS} )
94 + gpsd_protocols_ublox? ( dev-python/pyserial )
95 + gpsd_protocols_greis? ( dev-python/pyserial )
96 + usb? ( virtual/libusb:1 )
97 + X? ( dev-python/pygobject:3[cairo,${PYTHON_USEDEP}] )"
98 +DEPEND="${RDEPEND}"
99 +BDEPEND="virtual/pkgconfig
100 + test? ( sys-devel/bc )"
101 +
102 +# asciidoctor package is for man page generation
103 +if [[ ${PV} == *9999* ]] ; then
104 + BDEPEND+=" dev-ruby/asciidoctor"
105 +fi
106 +
107 +python_check_deps() {
108 + has_version -b "dev-util/scons[${PYTHON_USEDEP}]" || return 1
109 +}
110 +
111 +src_prepare() {
112 + # Make sure our list matches the source.
113 + local src_protocols=$(echo $(
114 + sed -n '/# GPS protocols/,/# Time service/{s:#.*::;s:[(",]::g;p}' "${S}"/SConscript | awk '{print $1}' | LC_ALL=C sort
115 + ) )
116 +
117 + if [[ ${src_protocols} != ${GPSD_PROTOCOLS[*]} ]] ; then
118 + eerror "Detected protocols: ${src_protocols}"
119 + eerror "Ebuild protocols: ${GPSD_PROTOCOLS[*]}"
120 + die "please sync ebuild & source"
121 + fi
122 +
123 + # bug #807661
124 + sed -i -e 's:$SRCDIR/gpsd.hotplug:$SRCDIR/../gpsd.hotplug:' SConscript || die
125 +
126 + default
127 +
128 + use python && distutils-r1_src_prepare
129 +}
130 +
131 +python_prepare_all() {
132 + python_setup
133 +
134 + # Extract python info out of SConscript so we can use saner distribute
135 + pyarray() { sed -n "/^ *$1 *= *\\[/,/\\]/p" SConscript ; }
136 + local pyprogs=$(pyarray python_progs)
137 + local pybins=$("${PYTHON}" -c "${pyprogs}; \
138 + print(list(set(python_progs) - {'xgps', 'xgpsspeed', 'ubxtool', 'zerk'}))" || die "Unable to list pybins")
139 + # Handle conditional tools manually. #666734
140 + use X && pybins+="+ ['xgps', 'xgpsspeed']"
141 + use gpsd_protocols_ublox && pybins+="+ ['ubxtool']"
142 + use gpsd_protocols_greis && pybins+="+ ['zerk']"
143 + local pysrcs=$(pyarray packet_ffi_extension)
144 + local packet=$("${PYTHON}" -c "${pysrcs}; print(packet_ffi_extension)" || die "Unable to extract packet types")
145 +
146 + pyvar() { sed -n "/^ *$1 *=/s:.*= *::p" SConscript ; }
147 + pyvar2() { sed -n "/^ *$1 *=/s:.*= *::p" SConstruct ; }
148 +
149 + # Post 3.19 the clienthelpers were merged into gps.packet
150 +
151 + # TODO: Fix hardcoding https://gpsd.io/ for now for @URL@
152 + sed \
153 + -e "s|@VERSION@|$(pyvar2 gpsd_version | sed -e 's:\"::g')|" \
154 + -e "s|@URL@|https://gpsd.io/|" \
155 + -e "s|@DEVMAIL@|$(pyvar devmail)|" \
156 + -e "s|@SCRIPTS@|${pybins}|" \
157 + -e "s|@DOWNLOAD@|$(pyvar download)|" \
158 + -e "s|@IRCCHAN@|$(pyvar ircchan)|" \
159 + -e "s|@ISSUES@|$(pyvar bugtracker)|" \
160 + -e "s|@MAILMAN@|$(pyvar mailman)|" \
161 + -e "s|@PROJECTPAGE@|$(pyvar projectpage)|" \
162 + -e "s|@SUPPORT@|https://gpsd.io/SUPPORT.html|" \
163 + -e "s|@WEBSITE@|https://gpsd.io/|" \
164 + "${S}"/packaging/gpsd-setup.py.in > setup.py || die
165 + distutils-r1_python_prepare_all
166 +}
167 +
168 +src_configure() {
169 + scons_opts=(
170 + prefix="${EPREFIX}/usr"
171 + libdir="\$prefix/$(get_libdir)"
172 + udevdir="$(get_udevdir)"
173 + rundir="/run"
174 + chrpath=False
175 + gpsd_user=gpsd
176 + gpsd_group=dialout
177 + nostrip=True
178 + systemd=$(usex systemd)
179 + unitdir="\$prefix/$(get_libdir)"
180 + shared=$(usex !static True False)
181 + bluez=$(usex bluetooth)
182 + libgpsmm=$(usex cxx)
183 + clientdebug=$(usex debug)
184 + dbus_export=$(usex dbus)
185 + ipv6=$(usex ipv6)
186 + timing=$(usex latency-timing)
187 + ncurses=$(usex ncurses)
188 + ntpshm=$(usex ntp)
189 + pps=$(usex ntp)
190 + python=$(usex python)
191 + # force a predictable python libdir because lib vs. lib64 usage differs
192 + # from 3.5 to 3.6+
193 + $(usex python python_libdir="${EPREFIX}"/python-discard "")
194 + qt=$(usex qt5)
195 + shm_export=$(usex shm)
196 + socket_export=$(usex sockets)
197 + usb=$(usex usb)
198 + )
199 +
200 + if [[ ${PV} != *9999* ]] ; then
201 + scons_opts+=( manbuild=False )
202 + fi
203 +
204 + use X && scons_opts+=( xgps=1 xgpsspeed=1 )
205 + use qt5 && scons_opts+=( qt_versioned=5 )
206 +
207 + # enable specified protocols
208 + local protocol
209 + for protocol in ${GPSD_PROTOCOLS[@]} ; do
210 + scons_opts+=( ${protocol}=$(usex gpsd_protocols_${protocol}) )
211 + done
212 +
213 + # bug #809260
214 + python_setup
215 +}
216 +
217 +src_compile() {
218 + export CHRPATH=
219 + tc-export CC CXX PKG_CONFIG
220 + export SHLINKFLAGS=${LDFLAGS} LINKFLAGS=${LDFLAGS}
221 + escons "${scons_opts[@]}"
222 +
223 + pushd "${P}" || die
224 + ln -sf ../setup.py . || die
225 + use python && distutils-r1_src_compile
226 + popd || die
227 +}
228 +
229 +src_install() {
230 + DESTDIR="${D}" escons install "${scons_opts[@]}" $(usex udev udev-install '')
231 +
232 + newconfd "${FILESDIR}"/gpsd.conf-2 gpsd
233 + newinitd "${FILESDIR}"/gpsd.init-2 gpsd
234 +
235 + # Cleanup bad alt copy due to Scons
236 + rm -rf "${D}"/python-discard/gps*
237 + find "${D}"/python-discard/ -type d -delete
238 + # Install correct multi-python copy
239 + pushd "${P}" || die
240 + use python && distutils-r1_src_install
241 + popd || die
242 +}