commit:     b9459744e9345aec8bd0e8fdbc857c1e13838618
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  8 19:27:38 2019 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Sep 12 03:46:12 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9459744

sci-geosciences/gpsd: fix xgps python shebangs

The logic to pull the python scripts out misses the dynamic xps
scripts leading them to not be wrapped as Python 2-specific.

Closes: https://bugs.gentoo.org/666734
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 .../gpsd/{gpsd-9999.ebuild => gpsd-3.17-r4.ebuild}      | 17 +++++++----------
 sci-geosciences/gpsd/gpsd-9999.ebuild                   |  2 ++
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/sci-geosciences/gpsd/gpsd-9999.ebuild 
b/sci-geosciences/gpsd/gpsd-3.17-r4.ebuild
similarity index 93%
copy from sci-geosciences/gpsd/gpsd-9999.ebuild
copy to sci-geosciences/gpsd/gpsd-3.17-r4.ebuild
index 84668fd1c77..dc6247feaeb 100644
--- a/sci-geosciences/gpsd/gpsd-9999.ebuild
+++ b/sci-geosciences/gpsd/gpsd-3.17-r4.ebuild
@@ -14,7 +14,7 @@ if [[ ${PV} == "9999" ]] ; then
        inherit git-2
 else
        SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
-       KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+       KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86"
 fi
 
 DESCRIPTION="GPS daemon and library for USB/serial GPS devices and GPS/mapping 
clients"
@@ -55,7 +55,7 @@ RDEPEND="
        )
        python? ( ${PYTHON_DEPS} )
        usb? ( virtual/libusb:1 )
-       X? ( dev-python/pygtk:2[${PYTHON_USEDEP}] )"
+       X? ( dev-python/pygobject:3[cairo,${PYTHON_USEDEP}] )"
 DEPEND="${RDEPEND}
        virtual/pkgconfig
        test? ( sys-devel/bc )"
@@ -93,6 +93,8 @@ python_prepare_all() {
        # 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)
+       # Handle conditional tools manually. #666734
+       use X && pybins+="+ ['xgps', 'xgpsspeed']"
        local pysrcs=$(sed -n '/^ *python_extensions = {/,/}/{s:^ 
*::;s:os[.]sep:"/":g;p}' SConstruct)
        local packet=$("${PYTHON}" -c "${pysrcs}; 
print(python_extensions['gps/packet'])")
        local client=$("${PYTHON}" -c "${pysrcs}; 
print(python_extensions['gps/clienthelpers'])")
@@ -117,7 +119,6 @@ src_configure() {
                gpsd_user=gpsd
                gpsd_group=uucp
                nostrip=True
-               python=False
                manbuild=False
                shared=$(usex !static True False)
                $(use_scons bluetooth bluez)
@@ -129,12 +130,14 @@ src_configure() {
                $(use_scons ncurses)
                $(use_scons ntp ntpshm)
                $(use_scons ntp pps)
+               $(use_scons X python)
                $(use_scons qt5 qt)
                $(use_scons shm shm_export)
                $(use_scons sockets socket_export)
                $(use_scons usb)
        )
 
+       use X && myesconsargs+=( xgps=1 )
        use qt5 && myesconsargs+=( qt_versioned=5 )
 
        # enable specified protocols
@@ -159,13 +162,7 @@ src_install() {
        newconfd "${FILESDIR}"/gpsd.conf-2 gpsd
        newinitd "${FILESDIR}"/gpsd.init-2 gpsd
 
-       if use python ; then
-               distutils-r1_src_install
-               # Delete all X related packages if user doesn't want them
-               if ! use X && [[ -f "${ED%/}"/usr/bin/xgps ]]; then
-                       rm "${ED%/}"/usr/bin/xgps* || die
-               fi
-       fi
+       use python && distutils-r1_src_install
 }
 
 pkg_preinst() {

diff --git a/sci-geosciences/gpsd/gpsd-9999.ebuild 
b/sci-geosciences/gpsd/gpsd-9999.ebuild
index 84668fd1c77..5b3bca138d4 100644
--- a/sci-geosciences/gpsd/gpsd-9999.ebuild
+++ b/sci-geosciences/gpsd/gpsd-9999.ebuild
@@ -93,6 +93,8 @@ python_prepare_all() {
        # 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)
+       # Handle conditional tools manually. #666734
+       use X && pybins+="+ ['xgps', 'xgpsspeed']"
        local pysrcs=$(sed -n '/^ *python_extensions = {/,/}/{s:^ 
*::;s:os[.]sep:"/":g;p}' SConstruct)
        local packet=$("${PYTHON}" -c "${pysrcs}; 
print(python_extensions['gps/packet'])")
        local client=$("${PYTHON}" -c "${pysrcs}; 
print(python_extensions['gps/clienthelpers'])")

Reply via email to