diff mbox series

[2/2] package/gpsd: add GPSD_PYTHON config option

Message ID 20200824080449.10036-2-olivier.dautricourt@orolia.com
State New
Headers show
Series [1/2] package/gpsd: bump version to 3.21 | expand

Commit Message

Olivier Dautricourt Aug. 24, 2020, 8:04 a.m. UTC
The scons script will install the gps library in the target python3
directory, as well as useful tools like ubxtool.

Signed-off-by: Olivier Dautricourt <olivier.dautricourt@orolia.com>
---
 package/gpsd/Config.in | 5 +++++
 package/gpsd/gpsd.mk   | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

Comments

Baruch Siach Aug. 24, 2020, 8:14 a.m. UTC | #1
Hi Olivier,

On Mon, Aug 24 2020, Olivier Dautricourt wrote:

> The scons script will install the gps library in the target python3
> directory, as well as useful tools like ubxtool.
>
> Signed-off-by: Olivier Dautricourt <olivier.dautricourt@orolia.com>
> ---
>  package/gpsd/Config.in | 5 +++++
>  package/gpsd/gpsd.mk   | 7 ++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
> index 5dd57c34b8..39054098ba 100644
> --- a/package/gpsd/Config.in
> +++ b/package/gpsd/Config.in
> @@ -229,4 +229,9 @@ config BR2_PACKAGE_GPSD_UBX
>  	help
>  	  uBlox UBX binary support
>  
> +config BR2_PACKAGE_GPSD_PYTHON
> +	bool "Python library"

'depends on BR2_PACKAGE_PYTHON3' maybe?

What is the size impact of the python library? In the likely case it is
orders of magnitude smaller than gpsd itself, you should install it
unconditionally when BR2_PACKAGE_PYTHON3 is enabled.

baruch

> +	help
> +	  gps Python library
> +
>  endif
> diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
> index 62c4c611c3..d2e5d57ca8 100644
> --- a/package/gpsd/gpsd.mk
> +++ b/package/gpsd/gpsd.mk
> @@ -23,7 +23,6 @@ GPSD_SCONS_OPTS = \
>  	prefix=/usr \
>  	sysroot=$(STAGING_DIR) \
>  	strip=no \
> -	python=no \
>  	qt=no \
>  	systemd=$(if $(BR2_INIT_SYSTEMD),yes,no)
>  
> @@ -186,6 +185,12 @@ endif
>  ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
>  GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
>  endif
> +ifeq ($(BR2_PACKAGE_GPSD_PYTHON), y)

We don't add space before 'y'.

> +GPSD_SCONS_OPTS += python=yes
> +GPSD_SCONS_OPTS += python_libdir=/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/

Is there build time dependency on python3? If so, you should also add
python3 to GPSD_DEPENDENCIES.

baruch

> +else
> +GPSD_SCONS_OPTS += python=no
> +endif
>  
>  GPSD_SCONS_ENV += \
>  	LDFLAGS="$(GPSD_LDFLAGS)" \
Olivier Dautricourt Aug. 24, 2020, 9:35 a.m. UTC | #2
The 08/24/2020 11:14, Baruch Siach wrote:
> Hi Olivier,
> 
> On Mon, Aug 24 2020, Olivier Dautricourt wrote:
> 
> > The scons script will install the gps library in the target python3
> > directory, as well as useful tools like ubxtool.
> >
> > Signed-off-by: Olivier Dautricourt <olivier.dautricourt@orolia.com>
> > ---
> >  package/gpsd/Config.in | 5 +++++
> >  package/gpsd/gpsd.mk   | 7 ++++++-
> >  2 files changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
> > index 5dd57c34b8..39054098ba 100644
> > --- a/package/gpsd/Config.in
> > +++ b/package/gpsd/Config.in
> > @@ -229,4 +229,9 @@ config BR2_PACKAGE_GPSD_UBX
> >       help
> >         uBlox UBX binary support
> >
> > +config BR2_PACKAGE_GPSD_PYTHON
> > +     bool "Python library"
> 
> 'depends on BR2_PACKAGE_PYTHON3' maybe?
> 
> What is the size impact of the python library? In the likely case it is
> orders of magnitude smaller than gpsd itself, you should install it
> unconditionally when BR2_PACKAGE_PYTHON3 is enabled.

Ok i'll drop the GPSD_PYTHON option.
> 
> baruch
> 
> > +     help
> > +       gps Python library
> > +
> >  endif
> > diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
> > index 62c4c611c3..d2e5d57ca8 100644
> > --- a/package/gpsd/gpsd.mk
> > +++ b/package/gpsd/gpsd.mk
> > @@ -23,7 +23,6 @@ GPSD_SCONS_OPTS = \
> >       prefix=/usr \
> >       sysroot=$(STAGING_DIR) \
> >       strip=no \
> > -     python=no \
> >       qt=no \
> >       systemd=$(if $(BR2_INIT_SYSTEMD),yes,no)
> >
> > @@ -186,6 +185,12 @@ endif
> >  ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
> >  GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
> >  endif
> > +ifeq ($(BR2_PACKAGE_GPSD_PYTHON), y)
> 
> We don't add space before 'y'.
> 
> > +GPSD_SCONS_OPTS += python=yes
> > +GPSD_SCONS_OPTS += python_libdir=/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/
> 
> Is there build time dependency on python3? If so, you should also add
> python3 to GPSD_DEPENDENCIES.
There is no build time dependency on python3 for the library.
the scons script only copies the .py files into the site-packages directory.
> 
> baruch
> 
> > +else
> > +GPSD_SCONS_OPTS += python=no
> > +endif
> >
> >  GPSD_SCONS_ENV += \
> >       LDFLAGS="$(GPSD_LDFLAGS)" \
> 
> --
>                                                      ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

I'll send a V2 for this patch (2/2).

Regards,
Sergey Matyukevich Oct. 23, 2020, 10:48 a.m. UTC | #3
Hello Oliver,

> I'll send a V2 for this patch (2/2).
> 
> Regards,
> -- 
> Olivier Dautricourt

Do you plan to work on the next revision of gpsd update patches ?
Let me know if you don't have capacity for that at the moment.
I have been recently working on the same update together with
enablement of gpsfake python test tools. So I can pick up
your changes and proceed.

Regards,
Sergey
diff mbox series

Patch

diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
index 5dd57c34b8..39054098ba 100644
--- a/package/gpsd/Config.in
+++ b/package/gpsd/Config.in
@@ -229,4 +229,9 @@  config BR2_PACKAGE_GPSD_UBX
 	help
 	  uBlox UBX binary support
 
+config BR2_PACKAGE_GPSD_PYTHON
+	bool "Python library"
+	help
+	  gps Python library
+
 endif
diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
index 62c4c611c3..d2e5d57ca8 100644
--- a/package/gpsd/gpsd.mk
+++ b/package/gpsd/gpsd.mk
@@ -23,7 +23,6 @@  GPSD_SCONS_OPTS = \
 	prefix=/usr \
 	sysroot=$(STAGING_DIR) \
 	strip=no \
-	python=no \
 	qt=no \
 	systemd=$(if $(BR2_INIT_SYSTEMD),yes,no)
 
@@ -186,6 +185,12 @@  endif
 ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
 GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
 endif
+ifeq ($(BR2_PACKAGE_GPSD_PYTHON), y)
+GPSD_SCONS_OPTS += python=yes
+GPSD_SCONS_OPTS += python_libdir=/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/
+else
+GPSD_SCONS_OPTS += python=no
+endif
 
 GPSD_SCONS_ENV += \
 	LDFLAGS="$(GPSD_LDFLAGS)" \