Merge pull request #105835 from hjones2199/gpsd-up

gpsd: 3.16 -> 3.21
This commit is contained in:
Raghav Sood 2020-12-06 03:19:58 +00:00 committed by GitHub
commit 37a449fd90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 123 additions and 151 deletions

View File

@ -1,16 +1,32 @@
{ fetchurl, stdenv, pkg-config, wrapGAppsHook, curl, gnome2, gpsd, gtk2
{ stdenv, fetchbzr, autoreconfHook, texinfo, help2man, imagemagick, pkg-config
, curl, gnome2, gpsd, gtk2, wrapGAppsHook
, intltool, libexif, python3Packages, sqlite }:
stdenv.mkDerivation rec {
pname = "foxtrotgps";
version = "1.2.2";
src = fetchurl {
url = "https://www.foxtrotgps.org/releases/foxtrotgps-${version}.tar.xz";
sha256 = "0grn35j5kwc286dxx18fv32qa330xmalqliwy6zirxmj6dffvrkg";
let
srcs = {
foxtrot = fetchbzr {
url = "lp:foxtrotgps";
rev = "326";
sha256 = "191pgcy5rng8djy22a5z9s8gssc73f9p5hm4ig52ra189cb48d8k";
};
screenshots = fetchbzr {
url = "lp:foxtrotgps/screenshots";
rev = "2";
sha256 = "1sgysn3dhfhrv7rj7wf8f2119vmhc1s1zzsp4r3nlrr45d20wmsv";
};
};
in stdenv.mkDerivation rec {
pname = "foxtrotgps";
version = "1.2.2+326";
nativeBuildInputs = [ pkg-config wrapGAppsHook ];
# Pull directly from bzr because gpsd API version 9 is not supported on latest release
src = srcs.foxtrot;
patches = [
./gps-status-fix.patch
];
nativeBuildInputs = [ pkg-config autoreconfHook texinfo help2man imagemagick wrapGAppsHook ];
buildInputs = [
curl.dev
@ -22,7 +38,16 @@ stdenv.mkDerivation rec {
sqlite.dev
(python3Packages.python.withPackages (pythonPackages: with python3Packages;
[ beautifulsoup4 feedparser sqlalchemy ]))
];
];
postUnpack = ''
cp -R ${srcs.screenshots} $sourceRoot/doc/screenshots
chmod -R u+w $sourceRoot/doc/screenshots
'';
preConfigure = ''
intltoolize --automake --copy --force
'';
meta = with stdenv.lib; {
description = "GPS/GIS application optimized for small screens";

View File

@ -0,0 +1,14 @@
--- foxtrot/src/gps_functions.c.orig 2020-12-04 15:02:22.290163204 -0600
+++ foxtrot/src/gps_functions.c 2020-12-04 15:04:54.470648534 -0600
@@ -762,7 +762,11 @@
{
gpsdata->fix.time = (time_t) 0;
}
+#if GPSD_API_MAJOR_VERSION >= 9
+ gpsdata->valid = (libgps_gpsdata.fix.status != STATUS_NO_FIX);
+#else
gpsdata->valid = (libgps_gpsdata.status != STATUS_NO_FIX);
+#endif
if (gpsdata->valid)
{
gpsdata->seen_valid = TRUE;

View File

@ -32,6 +32,10 @@ mkDerivation rec {
url = "https://aur.archlinux.org/cgit/aur.git/plain/fix-qtgui-include.patch?h=qlandkartegt";
sha256 = "16hql8ignzw4n1hlp4icbvaddqcadh2rjns0bvis720535112sc8";
})
(fetchpatch {
url = "https://aur.archlinux.org/cgit/aur.git/plain/fix-timespec.patch?h=qlandkartegt";
sha256 = "1yzdwfsgjn7q04r9f7s5qk50y25hdl384dxrmpfmkm97fmpgyr7w";
})
(fetchpatch {
url = "https://aur.archlinux.org/cgit/aur.git/plain/fix-ver_str.patch?h=qlandkartegt";
sha256 = "13fg05gqrjfa9j00lrqz1b06xf6r5j01kl6l06vkn0hz1jzxss5m";

View File

@ -1,50 +1,41 @@
{ stdenv, fetchFromGitHub
, alsaLib, espeak, glibc, gpsd
{ stdenv, fetchFromGitHub, cmake, alsaLib, espeak, glibc, gpsd
, hamlib, perl, python, udev }:
with stdenv.lib;
stdenv.mkDerivation rec {
pname = "direwolf";
version = "1.5";
version = "1.6";
src = fetchFromGitHub {
owner = "wb2osz";
repo = "direwolf";
rev = version;
sha256 = "1w55dv9xqgc9mpincsj017838vmvdy972fhis3ddskyfvhhzgcsk";
sha256 = "0xmz64m02knbrpasfij4rrq53ksxna5idxwgabcw4n2b1ig7pyx5";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
espeak gpsd hamlib perl python
] ++ (optionals stdenv.isLinux [alsaLib udev]);
makeFlags = [ "DESTDIR=$(out)" ];
patches = [
./udev-fix.patch
];
postPatch = ''
substituteInPlace symbols.c \
substituteInPlace src/symbols.c \
--replace /usr/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt \
--replace /opt/local/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt
substituteInPlace decode_aprs.c \
substituteInPlace src/decode_aprs.c \
--replace /usr/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt \
--replace /opt/local/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt
substituteInPlace dwespeak.sh \
substituteInPlace scripts/dwespeak.sh \
--replace espeak ${espeak}/bin/espeak
'' + (optionalString stdenv.isLinux ''
substituteInPlace Makefile.linux \
--replace /usr/include/pthread.h ${stdenv.glibc.dev}/include/pthread.h \
--replace /usr/include/alsa ${alsaLib.dev}/include/alsa \
--replace /usr/include/gps.h ${gpsd}/include/gps.h \
--replace /usr/include/hamlib ${hamlib}/include/hamlib \
--replace /usr/include/libudev.h ${udev.dev}/include/libudev.h \
--replace /etc/udev $out/etc/udev \
--replace 'Exec=xterm -hold -title \"Dire Wolf\" -bg white -e \"$(DESTDIR)/bin/direwolf\"' "Exec=$out/bin/direwolf" \
--replace '#Terminal=true' 'Terminal=true' \
--replace 'Path=$(HOME)' '#Path='
'');
preInstall = ''
mkdir -p $out/bin
substituteInPlace cmake/cpack/direwolf.desktop.in \
--replace 'Terminal=false' 'Terminal=true' \
--replace 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf' \
'';
meta = {

View File

@ -0,0 +1,11 @@
--- direwolf/conf/CMakeLists.txt.orig 2020-12-04 11:12:59.739390894 -0600
+++ direwolf/conf/CMakeLists.txt 2020-12-04 11:23:09.146594795 -0600
@@ -26,7 +26,7 @@
# install udev rules for CM108
if(LINUX)
- install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/)
+ install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d/")
endif()
install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION ${INSTALL_CONF_DIR})

View File

@ -1,25 +0,0 @@
From e08583ddb8445241c38c88d828271be908d52f9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
Date: Mon, 17 Feb 2014 20:52:50 +0000
Subject: [PATCH 1/2] Import LD_LIBRARY_PATH to allow running 'scons check'
without 'chrpath'
---
SConstruct | 1 +
1 file changed, 1 insertion(+)
diff --git a/SConstruct b/SConstruct
index fe444a2..f73c87e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -220,6 +220,7 @@ import_env = (
'STAGING_DIR', # Required by the OpenWRT and CeroWrt builds.
'STAGING_PREFIX', # Required by the OpenWRT and CeroWrt builds.
'WRITE_PAD', # So we can test WRITE_PAD values on the fly.
+ 'LD_LIBRARY_PATH', # Allows running 'scons check' without 'chrpath'
)
envs = {}
for var in import_env:
--
2.9.0

View File

@ -1,31 +0,0 @@
From b4ed6e9e89e3b7d57e5de9f2c1987a489bb5628c Mon Sep 17 00:00:00 2001
From: Alexey Shmalko <rasen.dubi@gmail.com>
Date: Sat, 9 Jul 2016 20:54:05 +0300
Subject: [PATCH] Use pkgconfig for dbus library
Without this, gcc can't find library path for the dbus.
This is already fixed upstream, so the patch shouldn't be necessary with
the next version of gpsd.
---
SConstruct | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/SConstruct b/SConstruct
index 0d4b29d..d8624b0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -586,8 +586,8 @@ else:
if env['dbus_export'] and config.CheckPKG('dbus-1'):
confdefs.append("#define HAVE_DBUS 1\n")
- dbusflags = ["-ldbus-1"]
- env.MergeFlags(pkg_config("dbus-1"))
+ dbusflags = pkg_config("dbus-1")
+ env.MergeFlags(dbusflags)
else:
confdefs.append("/* #undef HAVE_DBUS */\n")
dbusflags = []
--
2.9.0

View File

@ -1,28 +0,0 @@
From 21e5295a633c8c450629106c4603b78b2de7d786 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
Date: Sat, 15 Mar 2014 15:08:01 +0100
Subject: [PATCH 2/2] Import XML_CATALOG_FILES to be able to validate the
manual
In nixos/nixpkgs, 'xmlto' depends on $XML_CATALOG_FILES to be able to
validate XML documents. Because without it, it'll try to go online to
download DTD's and builders don't have network access...
---
SConstruct | 1 +
1 file changed, 1 insertion(+)
diff --git a/SConstruct b/SConstruct
index f73c87e..0d4b29d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -221,6 +221,7 @@ import_env = (
'STAGING_PREFIX', # Required by the OpenWRT and CeroWrt builds.
'WRITE_PAD', # So we can test WRITE_PAD values on the fly.
'LD_LIBRARY_PATH', # Allows running 'scons check' without 'chrpath'
+ 'XML_CATALOG_FILES', # Enables validating the manual with 'xmlto' using nix build system
)
envs = {}
for var in import_env:
--
2.9.0

View File

@ -1,11 +0,0 @@
--- b/SConstruct 2018-07-03 23:13:51.986746857 +0200
+++ a/SConstruct 2018-07-03 23:14:50.495252914 +0200
@@ -221,7 +221,7 @@
'STAGING_PREFIX', # Required by the OpenWRT and CeroWrt builds.
'WRITE_PAD', # So we can test WRITE_PAD values on the fly.
)
-envs = {}
+envs = os.environ
for var in import_env:
if var in os.environ:
envs[var] = os.environ[var]

View File

@ -1,45 +1,49 @@
{ fetchurl, stdenv, sconsPackages, pkgconfig, dbus, dbus-glib
, ncurses, libX11, libXt, libXpm, libXaw, libXext
{ stdenv, lib ,fetchurl, scons, pkg-config, dbus, ncurses
, libusb1, docbook_xml_dtd_412, docbook_xsl, bc
# optional deps for GUI packages
, guiSupport ? true
, dbus-glib ? null, libX11 ? null, libXt ? null, libXpm ? null, libXaw ? null, libXext ? null
, gobject-introspection ? null, pango ? null, gdk-pixbuf ? null, atk ? null, wrapGAppsHook ? null
, libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout"
, pps-tools
, python2Packages
, python3Packages
}:
# TODO: put the X11 deps behind a guiSupport parameter for headless support
stdenv.mkDerivation rec {
name = "gpsd-3.16";
pname = "gpsd";
version = "3.21";
src = fetchurl {
url = "https://download-mirror.savannah.gnu.org/releases/gpsd/${name}.tar.gz";
sha256 = "0a90ph4qrlz5kkcz2mwkfk3cmwy9fmglp94znz2y0gsd7bqrlmq3";
url = "https://download-mirror.savannah.gnu.org/releases/${pname}/${pname}-${version}.tar.gz";
sha256 = "14gyqrbrq6jz4y6x59rdpv9d4c3pbn0vh1blq3iwrc6kz0x4ql35";
};
nativeBuildInputs = [
sconsPackages.scons_3_1_2 pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc
python2Packages.python
python2Packages.wrapPython
];
scons pkg-config docbook_xml_dtd_412 docbook_xsl xmlto bc
python3Packages.python
python3Packages.wrapPython
]
++ lib.optionals guiSupport [ wrapGAppsHook gobject-introspection ];
buildInputs = [
python2Packages.python dbus dbus-glib ncurses libX11 libXt libXpm libXaw libXext
python3Packages.python dbus ncurses
libxslt libusb1 pps-tools
]
++ lib.optionals guiSupport [
dbus-glib libX11 libXt libXpm libXaw libXext
gobject-introspection pango gdk-pixbuf atk
];
pythonPath = [
python2Packages.pygobject2
python2Packages.pygtk
pythonPath = lib.optionals guiSupport [
python3Packages.pygobject3
python3Packages.pycairo
];
patches = [
./0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
./0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
# TODO: remove the patch with the next release
./0001-Use-pkgconfig-for-dbus-library.patch
# to be able to find pps-tools
./0002-scons-envs-patch.patch
./sconstruct-env-fixes.patch
];
postPatch = ''
@ -53,7 +57,7 @@ stdenv.mkDerivation rec {
sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct
sconsFlags+=" udevdir=$out/lib/udev"
sconsFlags+=" python_libdir=$out/lib/${python2Packages.python.libPrefix}/site-packages"
sconsFlags+=" python_libdir=$out/lib/${python3Packages.python.libPrefix}/site-packages"
'';
sconsFlags = [
@ -61,6 +65,7 @@ stdenv.mkDerivation rec {
"gpsd_user=${gpsdUser}"
"gpsd_group=${gpsdGroup}"
"systemd=yes"
"xgps=${if guiSupport then "True" else "False"}"
];
preCheck = ''
@ -73,7 +78,9 @@ stdenv.mkDerivation rec {
'';
installTargets = [ "install" "udev-install" ];
# remove binaries for x-less install because xgps sconsflag is partially broken
postFixup = ''
${if guiSupport then "" else "rm $out/bin/xgps*"}
wrapPythonProgramsIn $out/bin "$out $pythonPath"
'';

View File

@ -0,0 +1,15 @@
--- SConstruct.orig 2020-12-03 12:39:40.759793977 -0600
+++ gpsd-3.21/SConstruct 2020-12-03 12:44:30.858761753 -0600
@@ -516,9 +516,11 @@
'CWRAPPERS_CONFIG_DIR', # pkgsrc
# Variables used in testing
'WRITE_PAD', # So we can test WRITE_PAD values on the fly.
+ 'LD_LIBRARY_PATH', # Allows running 'scons check' without 'chrpath'
+ 'XML_CATALOG_FILES', # Enables validating the manual with 'xmlto' using nix build system
)
-envs = {}
+envs = os.environ
for var in import_env:
if var in os.environ:
envs[var] = os.environ[var]