From 599c5f13d42ff503219921cc494fa308a940ce09 Mon Sep 17 00:00:00 2001 From: Michael Weiser Date: Wed, 15 Apr 2020 20:36:02 +0200 Subject: [PATCH] sci-geosciences/gpsd: Update to EAPI 7 Switch the 3.19 and 9999 ebuilds to EAPI7 and add one for 3.20 (#704580): - Switch from epatch to PATCHES variable. - Switch from myesconsargs to scons_opts array and pass it explicitly. - Switch from use_scons to usex. - Remove usage of python_export because it causes a QA warning and is not necessary. Not strictly necessary for the switch but triggered by related developments: - Extend list of supported python versions to 2.7 and 3.5-3.8. - Install scons-compiled python module into predictable patch because the previous pattern would no longer work for python 3.6+ but still with 3.5. - Work around recent upstream updates to the way python module and binaries are built so our information extraction works again. (#716182). - Switch to and provide acct-user/gpsd with dialout group instead of uucp (#691746). Bug: https://bugs.gentoo.org/704580 Bug: https://bugs.gentoo.org/716182 Bug: https://bugs.gentoo.org/691746 Signed-off-by: Michael Weiser --- acct-user/gpsd/Manifest | 1 + acct-user/gpsd/gpsd-0.ebuild | 12 ++++ sci-geosciences/gpsd/gpsd-3.19.ebuild | 71 +++++++++++------------ sci-geosciences/gpsd/gpsd-9999.ebuild | 83 ++++++++++++++------------- 4 files changed, 91 insertions(+), 76 deletions(-) create mode 100644 acct-user/gpsd/Manifest create mode 100644 acct-user/gpsd/gpsd-0.ebuild diff --git a/acct-user/gpsd/Manifest b/acct-user/gpsd/Manifest new file mode 100644 index 00000000000..e1a799303d1 --- /dev/null +++ b/acct-user/gpsd/Manifest @@ -0,0 +1 @@ +EBUILD gpsd-0.ebuild 221 BLAKE2B e8bc21adbc49d81f0bf14a83db6acaecdf44ff047ad1ccd52bfa32a667417aaceb30b6ad3b913e0cf80f1cd27e3e2692317efee3879e52b4409d5db80c5b8d99 SHA512 019535608eb5ffb3a83a1d332252fafbd5e5ef2f25b341123c627630400c995a9619202d2de78002347a1c51a6d5b11c445410b9e35c4b0f0b65563d2c0ffdb5 diff --git a/acct-user/gpsd/gpsd-0.ebuild b/acct-user/gpsd/gpsd-0.ebuild new file mode 100644 index 00000000000..aab8dae1f89 --- /dev/null +++ b/acct-user/gpsd/gpsd-0.ebuild @@ -0,0 +1,12 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit acct-user + +DESCRIPTION="user for gpsd" +ACCT_USER_ID=469 +ACCT_USER_GROUPS=( dialout ) + +acct-user_add_deps diff --git a/sci-geosciences/gpsd/gpsd-3.19.ebuild b/sci-geosciences/gpsd/gpsd-3.19.ebuild index 6cba45913e0..b043c6ca61a 100644 --- a/sci-geosciences/gpsd/gpsd-3.19.ebuild +++ b/sci-geosciences/gpsd/gpsd-3.19.ebuild @@ -1,10 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=5 +EAPI=7 DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python2_7 python3_5 python3_6 ) +PYTHON_COMPAT=( python2_7 python3_{5..8} ) SCONS_MIN_VERSION="2.3.0" inherit eutils udev user multilib distutils-r1 scons-utils toolchain-funcs @@ -41,6 +41,7 @@ REQUIRED_USE="X? ( python ) RESTRICT="!test? ( test )" RDEPEND=" + acct-user/gpsd >=net-misc/pps-tools-0.0.20120407 bluetooth? ( net-wireless/bluez ) dbus? ( @@ -73,6 +74,13 @@ if [[ ${PV} == *9999* ]] ; then =app-text/docbook-xml-dtd-4.1*" fi +PATCHES=( + "${FILESDIR}"/${PN}-3.19-do_not_rm_library.patch + # Merged upstream + #"${FILESDIR}"/${P}-scons-print.patch + #"${FILESDIR}"/${P}-scons-py3.patch +) + src_prepare() { # Make sure our list matches the source. local src_protocols=$(echo $( @@ -84,11 +92,6 @@ src_prepare() { die "please sync ebuild & source" fi - epatch "${FILESDIR}"/${P}-do_not_rm_library.patch - # Merged upstream - #epatch "${FILESDIR}"/${P}-scons-print.patch - #epatch "${FILESDIR}"/${P}-scons-py3.patch - # Avoid useless -L paths to the install dir sed -i \ -e 's:\:SYSROOT:g' \ @@ -101,7 +104,6 @@ src_prepare() { python_prepare_all() { python_setup - python_export # Extract python info out of SConstruct so we can use saner distribute pyvar() { sed -n "/^ *$1 *=/s:.*= *::p" SConstruct ; } @@ -126,7 +128,7 @@ python_prepare_all() { } src_configure() { - myesconsargs=( + scons_opts=( prefix="${EPREFIX}/usr" libdir="\$prefix/$(get_libdir)" udevdir="$(get_udevdir)" @@ -136,29 +138,32 @@ src_configure() { nostrip=True manbuild=False shared=$(usex !static True False) - $(use_scons bluetooth bluez) - $(use_scons cxx libgpsmm) - $(use_scons debug clientdebug) - $(use_scons dbus dbus_export) - $(use_scons ipv6) - $(use_scons latency-timing timing) - $(use_scons ncurses) - $(use_scons ntp ntpshm) - $(use_scons ntp pps) - $(use_scons python) - $(use_scons qt5 qt) - $(use_scons shm shm_export) - $(use_scons sockets socket_export) - $(use_scons usb) + bluez=$(usex bluetooth) + libgpsmm=$(usex cxx) + clientdebug=$(usex debug) + dbus_export=$(usex dbus) + ipv6=$(usex ipv6) + timing=$(usex latency-timing) + ncurses=$(usex ncurses) + ntpshm=$(usex ntp) + pps=$(usex ntp) + python=$(usex python) + # force a predictable python libdir because lib vs. lib64 usage differs + # from 3.5 to 3.6+ + $(usex python python_libdir="${EPREFIX}"/python-discard "") + qt=$(usex qt5) + shm_export=$(usex shm) + socket_export=$(usex sockets) + usb=$(usex usb) ) - use X && myesconsargs+=( xgps=1 xgpsspeed=1 ) - use qt5 && myesconsargs+=( qt_versioned=5 ) + use X && scons_opts+=( xgps=yes xgpsspeed=yes ) + use qt5 && scons_opts+=( qt_versioned=5 ) # enable specified protocols local protocol for protocol in ${GPSD_PROTOCOLS[@]} ; do - myesconsargs+=( $(use_scons gpsd_protocols_${protocol} ${protocol}) ) + scons_opts+=( ${protocol}=$(usex gpsd_protocols_${protocol}) ) done } @@ -166,27 +171,21 @@ src_compile() { export CHRPATH= tc-export CC CXX PKG_CONFIG export SHLINKFLAGS=${LDFLAGS} LINKFLAGS=${LDFLAGS} - escons + escons "${scons_opts[@]}" use python && distutils-r1_src_compile } src_install() { - DESTDIR="${D}" escons install $(usex udev udev-install "") + DESTDIR="${D}" escons install "${scons_opts[@]}" $(usex udev udev-install "") newconfd "${FILESDIR}"/gpsd.conf-2 gpsd newinitd "${FILESDIR}"/gpsd.init-2 gpsd # Cleanup bad alt copy due to Scons - rm -rf "${D}"/usr/local/$(get_libdir)/python*/site-packages/gps* - find "${D}"/usr/local/ -type d -delete + rm -rf "${D}"/python-discard/gps* + find "${D}"/python-discard/ -type d -delete # Install correct multi-python copy use python && distutils-r1_src_install } - -pkg_preinst() { - # Run the gpsd daemon as gpsd and group uucp; create it here - # as it doesn't seem to be needed during compile/install ... - enewuser gpsd -1 -1 -1 "uucp" -} diff --git a/sci-geosciences/gpsd/gpsd-9999.ebuild b/sci-geosciences/gpsd/gpsd-9999.ebuild index 5c66058b8ce..a3359e634b8 100644 --- a/sci-geosciences/gpsd/gpsd-9999.ebuild +++ b/sci-geosciences/gpsd/gpsd-9999.ebuild @@ -1,10 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=5 +EAPI=7 DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python2_7 python3_5 python3_6 ) +PYTHON_COMPAT=( python2_7 python3_{5..8} ) SCONS_MIN_VERSION="2.3.0" inherit eutils udev user multilib distutils-r1 scons-utils toolchain-funcs @@ -41,6 +41,7 @@ REQUIRED_USE="X? ( python ) RESTRICT="!test? ( test )" RDEPEND=" + acct-user/gpsd >=net-misc/pps-tools-0.0.20120407 bluetooth? ( net-wireless/bluez ) dbus? ( @@ -73,6 +74,13 @@ if [[ ${PV} == *9999* ]] ; then =app-text/docbook-xml-dtd-4.1*" fi +PATCHES=( + "${FILESDIR}"/${PN}-3.19-do_not_rm_library.patch + # Merged upstream + #"${FILESDIR}"/${P}-scons-print.patch + #"${FILESDIR}"/${P}-scons-py3.patch +) + src_prepare() { # Make sure our list matches the source. local src_protocols=$(echo $( @@ -84,11 +92,6 @@ src_prepare() { die "please sync ebuild & source" fi - epatch "${FILESDIR}"/${PN}-3.19-do_not_rm_library.patch - # Merged upstream - #epatch "${FILESDIR}"/${P}-scons-print.patch - #epatch "${FILESDIR}"/${P}-scons-py3.patch - # Avoid useless -L paths to the install dir sed -i \ -e 's:\:SYSROOT:g' \ @@ -101,17 +104,20 @@ src_prepare() { python_prepare_all() { python_setup - python_export # Extract python info out of SConstruct so we can use saner distribute - pyvar() { sed -n "/^ *$1 *=/s:.*= *::p" SConstruct ; } - local pybins=$(pyvar python_progs | tail -1) + pyarray() { sed -n "/^ *$1 *= *\\[/,/\\]/p" SConstruct ; } + local pyprogs=$(pyarray python_progs) + local pybins=$("${PYTHON}" -c "${pyprogs}; \ + print(list(set(python_progs) - {'xgps', 'xgpsspeed', 'ubxtool', 'zerk'}))") # Handle conditional tools manually. #666734 use X && pybins+="+ ['xgps', 'xgpsspeed']" use gpsd_protocols_ublox && pybins+="+ ['ubxtool']" use gpsd_protocols_greis && pybins+="+ ['zerk']" - local pysrcs=$(sed -n '/^ *python_extensions = {/,/}/{s:^ *::;s:os[.]sep:"/":g;p}' SConstruct) - local packet=$("${PYTHON}" -c "${pysrcs}; print(python_extensions['gps/packet'])") + local pysrcs=$(pyarray packet_ffi_extension) + local packet=$("${PYTHON}" -c "${pysrcs}; print(packet_ffi_extension)") + + pyvar() { sed -n "/^ *$1 *=/s:.*= *::p" SConstruct ; } # Post 3.19 the clienthelpers were merged into gps.packet sed \ -e "s|@VERSION@|$(pyvar gpsd_version)|" \ @@ -126,7 +132,7 @@ python_prepare_all() { } src_configure() { - myesconsargs=( + scons_opts=( prefix="${EPREFIX}/usr" libdir="\$prefix/$(get_libdir)" udevdir="$(get_udevdir)" @@ -136,29 +142,32 @@ src_configure() { nostrip=True manbuild=False shared=$(usex !static True False) - $(use_scons bluetooth bluez) - $(use_scons cxx libgpsmm) - $(use_scons debug clientdebug) - $(use_scons dbus dbus_export) - $(use_scons ipv6) - $(use_scons latency-timing timing) - $(use_scons ncurses) - $(use_scons ntp ntpshm) - $(use_scons ntp pps) - $(use_scons python) - $(use_scons qt5 qt) - $(use_scons shm shm_export) - $(use_scons sockets socket_export) - $(use_scons usb) + bluez=$(usex bluetooth) + libgpsmm=$(usex cxx) + clientdebug=$(usex debug) + dbus_export=$(usex dbus) + ipv6=$(usex ipv6) + timing=$(usex latency-timing) + ncurses=$(usex ncurses) + ntpshm=$(usex ntp) + pps=$(usex ntp) + python=$(usex python) + # force a predictable python libdir because lib vs. lib64 usage differs + # from 3.5 to 3.6+ + $(usex python python_libdir="${EPREFIX}"/python-discard "") + qt=$(usex qt5) + shm_export=$(usex shm) + socket_export=$(usex sockets) + usb=$(usex usb) ) - use X && myesconsargs+=( xgps=1 xgpsspeed=1 ) - use qt5 && myesconsargs+=( qt_versioned=5 ) + use X && scons_opts+=( xgps=yes xgpsspeed=yes ) + use qt5 && scons_opts+=( qt_versioned=5 ) # enable specified protocols local protocol for protocol in ${GPSD_PROTOCOLS[@]} ; do - myesconsargs+=( $(use_scons gpsd_protocols_${protocol} ${protocol}) ) + scons_opts+=( ${protocol}=$(usex gpsd_protocols_${protocol}) ) done } @@ -166,27 +175,21 @@ src_compile() { export CHRPATH= tc-export CC CXX PKG_CONFIG export SHLINKFLAGS=${LDFLAGS} LINKFLAGS=${LDFLAGS} - escons + escons "${scons_opts[@]}" use python && distutils-r1_src_compile } src_install() { - DESTDIR="${D}" escons install $(usex udev udev-install "") + DESTDIR="${D}" escons install "${scons_opts[@]}" $(usex udev udev-install "") newconfd "${FILESDIR}"/gpsd.conf-2 gpsd newinitd "${FILESDIR}"/gpsd.init-2 gpsd # Cleanup bad alt copy due to Scons - rm -rf "${D}"/usr/local/$(get_libdir)/python*/site-packages/gps* - find "${D}"/usr/local/ -type d -delete + rm -rf "${D}"/python-discard/gps* + find "${D}"/python-discard/ -type d -delete # Install correct multi-python copy use python && distutils-r1_src_install } - -pkg_preinst() { - # Run the gpsd daemon as gpsd and group uucp; create it here - # as it doesn't seem to be needed during compile/install ... - enewuser gpsd -1 -1 -1 "uucp" -} -- 2.26.0