diff options
-rw-r--r-- | INSTALL | 24 | ||||
-rw-r--r-- | build.txt | 11 | ||||
-rwxr-xr-x | gegps | 2 | ||||
-rw-r--r-- | gps/client.py | 9 | ||||
-rw-r--r-- | gps/fake.py | 4 | ||||
-rwxr-xr-x | gps/gps.py | 5 | ||||
-rw-r--r-- | gps/misc.py | 4 | ||||
-rwxr-xr-x | gpscat | 2 | ||||
-rwxr-xr-x | gpsprof | 2 | ||||
-rwxr-xr-x | leapsecond.py | 10 |
10 files changed, 40 insertions, 33 deletions
@@ -87,24 +87,20 @@ A minimum build of GPSD can run pretty close to the metal; all it absolutely needs is the C runtime support. The test clients and various additional features have additional prerequisites: -|========================================================================== -|pthreads library | support for PPS timekeeping on serial GPSes -|DBUS | gpsd will issue DBUS notifications -|ncurses | a test client and the GPS monitor depend on this -|libtinfo5 | shared low-level terminfo library (see below) -|libusb-1.0.x or later | better USB device discovery -|Qt + qmake | libQgpsmm depends on this -|python2.x, x >=6 | required for various clients and utilities -|pygtk/gobject bindings | the test clients xgps and xgpsspeed, need this -|========================================================================== +|================================================================================ +|pthreads library | support for PPS timekeeping on serial GPSes +|DBUS | gpsd will issue DBUS notifications +|ncurses | a test client and the GPS monitor depend on this +|libtinfo5 | shared low-level terminfo library (see below) +|libusb-1.0.x or later | better USB device discovery +|Qt + qmake | libQgpsmm depends on this +|python2.x(x>=6) or 3.y(y>=3) | required for various clients and utilities +|python-GI bindings | the test clients xgps and xgpsspeed, need this +|================================================================================ Some ncurses packages contain the terminfo library; some break it out separately as libtinfo5 or libtinfo. -The Python code in GPSD is actually compatible back to Python 2.4 except that -you need either the json library module from 2.6 or the functionally -equivalent simplejson backport. - == Installing gpsd == === Install your distributions package(s) === @@ -55,9 +55,9 @@ is included at the end of this file. Necessary components for any build: |============================================================================ -|C compiler | gpsd and client library are written in C -|Python 2.x, x >= 7 | some code is generated from python scripts -|scons | for executing the build recipe +|C compiler | gpsd and client library are written in C +|Python 2.x(x>=6) or 3.y(y>=3) | some code is generated from python scripts +|scons | for executing the build recipe |============================================================================ === C compiler === @@ -66,7 +66,7 @@ C99 conformance is required in the compiler. The C code depends on one C11 feature (supported by GCC, clang, and pretty much any C compiler that also speaks C++): anonymous unions. We could eliminate these, but the cost would be source-level interface breakage if we have to -move structure members in and out of unions. +move certain structure members in and out of unions. Some portions of the code using shared-memory segments are improved by the C11 stdatomic.h features for lockless concurrency. These are: the @@ -87,7 +87,8 @@ clang produces a gpsd that passes all regression tests. === Python === -You will need Python 2.5 or later for the build. +You will need Python 2.x at minor version 6 or later or Python 3 at +at minor version 3 or later. While Python is required to build GPSD from source (the build uses some code generators in Python), it is not required to run the service @@ -21,7 +21,7 @@ # Cleaned up and adapted for the GPSD project by Eric S. Raymond. # This code runs under both Python 2 and Python 3. Preserve this property! -from __future__ import print_function +from __future__ import print_function, division import sys, os, getopt import gps diff --git a/gps/client.py b/gps/client.py index 6281db85..820006b0 100644 --- a/gps/client.py +++ b/gps/client.py @@ -1,12 +1,11 @@ # This file is Copyright (c) 2010 by the GPSD project # BSD terms apply: see the file COPYING in the distribution root for details. # -import time, socket, sys, select +# This code run compatibly under Python 2 and 3.x for x >= 3. +# Preserve this property! +from __future__ import print_function, division -if sys.hexversion >= 0x2060000: - import json # For Python 2.6 -else: - import simplejson as json # For Python 2.4 and 2.5 +import time, socket, sys, select, json GPSD_PORT = "2947" diff --git a/gps/fake.py b/gps/fake.py index 15fc683c..a4ca01fc 100644 --- a/gps/fake.py +++ b/gps/fake.py @@ -67,7 +67,9 @@ To allow for adding and removing clients while the test is running, run in threaded mode by calling the start() method. This simply calls the run method in a subthread, with locking of critical regions. """ -from __future__ import print_function +# This code run compatibly under Python 2 and 3.x for x >= 3. +# Preserve this property! +from __future__ import print_function, division import os, sys, time, signal, pty, termios # fcntl, array, struct import threading, socket, select @@ -14,7 +14,10 @@ # The JSON parts of this (which will be reused by any new interface) # now live in a different module. # -from __future__ import print_function + +# This code run compatibly under Python 2 and 3.x for x >= 3. +# Preserve this property! +from __future__ import print_function, division from .client import * from .misc import isotime diff --git a/gps/misc.py b/gps/misc.py index 5f8bc44c..51a8bb87 100644 --- a/gps/misc.py +++ b/gps/misc.py @@ -3,6 +3,10 @@ # This file is Copyright (c) 2010 by the GPSD project # BSD terms apply: see the file COPYING in the distribution root for details. +# This code run compatibly under Python 2 and 3.x for x >= 3. +# Preserve this property! +from __future__ import print_function, division + import time, calendar, math # some multipliers for interpreting GPS output @@ -5,7 +5,7 @@ # # Display GPS output. Hexify it if necessary. # -from __future__ import print_function +from __future__ import print_function, division import os, sys, termios, socket, select, getopt, curses.ascii import gps.packet as sniffer @@ -7,6 +7,8 @@ # Requires gnuplot. # # This code runs under both Python 2 and Python 3. Preserve this property! +from __future__ import print_function, division + import copy import getopt import gps diff --git a/leapsecond.py b/leapsecond.py index d5d3c043..dcf7b963 100755 --- a/leapsecond.py +++ b/leapsecond.py @@ -6,13 +6,13 @@ Usage: leapsecond.py [-v] { [-h] | [-f filename] | [-g filename] | [-H filename] Options: - -I take a date in ISO8601 format and convert to Unix gmt time + -I take a date in ISO8601 format and convert to Unix-UTC time - -O take a date in Unix gmt time and convert to ISO8601. + -O take a date in Unix-UTC time and convert to ISO8601. - -i take a date in RFC822 format and convert to Unix gmt time + -i take a date in RFC822 format and convert to Unix-UTC time - -o take a date in Unix gmt time and convert to RFC822. + -o take a date in Unix-UTC time and convert to RFC822. -f fetch leap-second offset data and save to local cache file @@ -44,7 +44,7 @@ BSD terms apply: see the file COPYING in the distribution root for details. """ # This code runs under both Python 2 and Python 3. Preserve this property! -from __future__ import print_function +from __future__ import print_function, division import os, urllib, re, random, time, calendar, math, sys, signal |