aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghav Sood <r@raghavsood.com>2020-12-06 03:19:58 +0000
committerGitHub <noreply@github.com>2020-12-06 03:19:58 +0000
commit37a449fd9037dc1c0c84b3f154913ea2f1724da2 (patch)
tree8e72928c6679627c82a7c2231c28af4bfb39328d
parent18493dab889d8afbefde6380c7b00fae3d376d3e (diff)
parentd2527ed7da590963666be59858fe191b604f88e6 (diff)
Merge pull request #105835 from hjones2199/gpsd-up
gpsd: 3.16 -> 3.21
-rw-r--r--pkgs/applications/misc/foxtrotgps/default.nix43
-rw-r--r--pkgs/applications/misc/foxtrotgps/gps-status-fix.patch14
-rw-r--r--pkgs/applications/misc/qlandkartegt/default.nix4
-rw-r--r--pkgs/applications/radio/direwolf/default.nix37
-rw-r--r--pkgs/applications/radio/direwolf/udev-fix.patch11
-rw-r--r--pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch25
-rw-r--r--pkgs/servers/gpsd/0001-Use-pkgconfig-for-dbus-library.patch31
-rw-r--r--pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch28
-rw-r--r--pkgs/servers/gpsd/0002-scons-envs-patch.patch11
-rw-r--r--pkgs/servers/gpsd/default.nix53
-rw-r--r--pkgs/servers/gpsd/sconstruct-env-fixes.patch15
11 files changed, 122 insertions, 150 deletions
diff --git a/pkgs/applications/misc/foxtrotgps/default.nix b/pkgs/applications/misc/foxtrotgps/default.nix
index dc3f1922c214..9ac701014906 100644
--- a/pkgs/applications/misc/foxtrotgps/default.nix
+++ b/pkgs/applications/misc/foxtrotgps/default.nix
@@ -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 {
+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";
+ version = "1.2.2+326";
- src = fetchurl {
- url = "https://www.foxtrotgps.org/releases/foxtrotgps-${version}.tar.xz";
- sha256 = "0grn35j5kwc286dxx18fv32qa330xmalqliwy6zirxmj6dffvrkg";
- };
+ # 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 wrapGAppsHook ];
+ 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";
diff --git a/pkgs/applications/misc/foxtrotgps/gps-status-fix.patch b/pkgs/applications/misc/foxtrotgps/gps-status-fix.patch
new file mode 100644
index 000000000000..e9b3624a174b
--- /dev/null
+++ b/pkgs/applications/misc/foxtrotgps/gps-status-fix.patch
@@ -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;
diff --git a/pkgs/applications/misc/qlandkartegt/default.nix b/pkgs/applications/misc/qlandkartegt/default.nix
index d780125fbbfa..9ae65a962ddc 100644
--- a/pkgs/applications/misc/qlandkartegt/default.nix
+++ b/pkgs/applications/misc/qlandkartegt/default.nix
@@ -33,6 +33,10 @@ mkDerivation rec {
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";
})
diff --git a/pkgs/applications/radio/direwolf/default.nix b/pkgs/applications/radio/direwolf/default.nix
index aab76574968b..321b103c7f7a 100644
--- a/pkgs/applications/radio/direwolf/default.nix
+++ b/pkgs/applications/radio/direwolf/default.nix
@@ -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 = {
diff --git a/pkgs/applications/radio/direwolf/udev-fix.patch b/pkgs/applications/radio/direwolf/udev-fix.patch
new file mode 100644
index 000000000000..cff17fb88621
--- /dev/null
+++ b/pkgs/applications/radio/direwolf/udev-fix.patch
@@ -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})
diff --git a/pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch b/pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
deleted file mode 100644
index a8721a3e7029..000000000000
--- a/pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
+++ /dev/null
@@ -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
-
diff --git a/pkgs/servers/gpsd/0001-Use-pkgconfig-for-dbus-library.patch b/pkgs/servers/gpsd/0001-Use-pkgconfig-for-dbus-library.patch
deleted file mode 100644
index 58ae754ecfb5..000000000000
--- a/pkgs/servers/gpsd/0001-Use-pkgconfig-for-dbus-library.patch
+++ /dev/null
@@ -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
-
diff --git a/pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch b/pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
deleted file mode 100644
index 3e387167d6fb..000000000000
--- a/pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
+++ /dev/null
@@ -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
-
diff --git a/pkgs/servers/gpsd/0002-scons-envs-patch.patch b/pkgs/servers/gpsd/0002-scons-envs-patch.patch
deleted file mode 100644
index fbb06db6aa39..000000000000
--- a/pkgs/servers/gpsd/0002-scons-envs-patch.patch
+++ /dev/null
@@ -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]
diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix
index 5f9beb4b8348..7f197254878d 100644
--- a/pkgs/servers/gpsd/default.nix
+++ b/pkgs/servers/gpsd/default.nix
@@ -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"
'';
diff --git a/pkgs/servers/gpsd/sconstruct-env-fixes.patch b/pkgs/servers/gpsd/sconstruct-env-fixes.patch
new file mode 100644
index 000000000000..e90bd04b6342
--- /dev/null
+++ b/pkgs/servers/gpsd/sconstruct-env-fixes.patch
@@ -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]