From 657fef798b83bccb99b5837e0c93730ae2dfb435 Mon Sep 17 00:00:00 2001 From: Hunter Jones Date: Thu, 3 Dec 2020 16:10:40 -0600 Subject: [PATCH] gpsd: 3.16 -> 3.21 --- ...Y_PATH-to-allow-running-scons-check-.patch | 25 --------- .../0001-Use-pkgconfig-for-dbus-library.patch | 31 ----------- ...OG_FILES-to-be-able-to-validate-the-.patch | 28 ---------- pkgs/servers/gpsd/0002-scons-envs-patch.patch | 11 ---- pkgs/servers/gpsd/default.nix | 53 +++++++++++-------- pkgs/servers/gpsd/sconstruct-env-fixes.patch | 15 ++++++ 6 files changed, 45 insertions(+), 118 deletions(-) delete mode 100644 pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch delete mode 100644 pkgs/servers/gpsd/0001-Use-pkgconfig-for-dbus-library.patch delete mode 100644 pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch delete mode 100644 pkgs/servers/gpsd/0002-scons-envs-patch.patch create mode 100644 pkgs/servers/gpsd/sconstruct-env-fixes.patch 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?= -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 -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?= -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]