pps-tools: init at 1.0.2, enable for chrony, gpsd, ntp (#42889)

authored by

Richard Marko and committed by
Orivej Desh (NixOS)
91575dd2 45f8c2ac

+66 -8
+34
pkgs/os-specific/linux/pps-tools/default.nix
··· 1 + { stdenv, fetchFromGitHub }: 2 + 3 + stdenv.mkDerivation rec { 4 + baseName = "pps-tools"; 5 + version = "1.0.2"; 6 + name = "${baseName}-${version}"; 7 + 8 + src = fetchFromGitHub { 9 + owner = "redlab-i"; 10 + repo = "${baseName}"; 11 + rev = "v${version}"; 12 + sha256 = "1yh9g0l59dkq4ci0wbb03qin3c3cizfngmn9jy1vwm5zm6axlxhf"; 13 + }; 14 + 15 + outputs = [ "out" "dev" ]; 16 + 17 + installPhase = '' 18 + mkdir -p $out/bin 19 + mkdir -p $dev/include 20 + mkdir -p $out/{usr/bin,usr/include/sys} 21 + make install DESTDIR=$out 22 + mv $out/usr/bin/* $out/bin 23 + mv $out/usr/include/* $dev/include/ 24 + rm -rf $out/usr/ 25 + ''; 26 + 27 + meta = with stdenv.lib;{ 28 + description = "User-space tools for LinuxPPS"; 29 + homepage = http://linuxpps.org/; 30 + license = licenses.gpl2Plus; 31 + platforms = platforms.linux; 32 + maintainers = with maintainers; [ sorki ]; 33 + }; 34 + }
+11
pkgs/servers/gpsd/0002-scons-envs-patch.patch
··· 1 + --- b/SConstruct 2018-07-03 23:13:51.986746857 +0200 2 + +++ a/SConstruct 2018-07-03 23:14:50.495252914 +0200 3 + @@ -221,7 +221,7 @@ 4 + 'STAGING_PREFIX', # Required by the OpenWRT and CeroWrt builds. 5 + 'WRITE_PAD', # So we can test WRITE_PAD values on the fly. 6 + ) 7 + -envs = {} 8 + +envs = os.environ 9 + for var in import_env: 10 + if var in os.environ: 11 + envs[var] = os.environ[var]
+13 -4
pkgs/servers/gpsd/default.nix
··· 2 2 , ncurses, libX11, libXt, libXpm, libXaw, libXext 3 3 , libusb1, docbook_xml_dtd_412, docbook_xsl, bc 4 4 , libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout" 5 + , pps-tools 5 6 , python2Packages 6 7 }: 7 8 ··· 23 24 24 25 buildInputs = [ 25 26 python2Packages.python dbus dbus-glib ncurses libX11 libXt libXpm libXaw libXext 26 - libxslt libusb1 27 + libxslt libusb1 pps-tools 27 28 ]; 28 29 29 30 pythonPath = [ ··· 37 38 38 39 # TODO: remove the patch with the next release 39 40 ./0001-Use-pkgconfig-for-dbus-library.patch 41 + # to be able to find pps-tools 42 + ./0002-scons-envs-patch.patch 40 43 ]; 41 44 42 45 # - leapfetch=no disables going online at build time to fetch leap-seconds ··· 44 47 buildPhase = '' 45 48 patchShebangs . 46 49 sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct 47 - scons prefix="$out" leapfetch=no gpsd_user=${gpsdUser} gpsd_group=${gpsdGroup} \ 48 - systemd=yes udevdir="$out/lib/udev" \ 49 - python_libdir="$out/lib/${python2Packages.python.libPrefix}/site-packages" 50 + scons \ 51 + -j $NIX_BUILD_CORES \ 52 + prefix="$out" \ 53 + leapfetch=no \ 54 + gpsd_user=${gpsdUser} \ 55 + gpsd_group=${gpsdGroup} \ 56 + systemd=yes \ 57 + udevdir="$out/lib/udev" \ 58 + python_libdir="$out/lib/${python2Packages.python.libPrefix}/site-packages" 50 59 ''; 51 60 52 61 checkPhase = ''
+2 -2
pkgs/tools/networking/chrony/default.nix
··· 1 1 { stdenv, fetchurl, pkgconfig, libcap, readline, texinfo, nss, nspr 2 - , libseccomp }: 2 + , libseccomp, pps-tools }: 3 3 4 4 assert stdenv.isLinux -> libcap != null; 5 5 ··· 14 14 }; 15 15 16 16 buildInputs = [ readline texinfo nss nspr ] 17 - ++ stdenv.lib.optionals stdenv.isLinux [ libcap libseccomp ]; 17 + ++ stdenv.lib.optionals stdenv.isLinux [ libcap libseccomp pps-tools ]; 18 18 nativeBuildInputs = [ pkgconfig ]; 19 19 20 20 hardeningEnable = [ "pie" ];
+4 -2
pkgs/tools/networking/ntp/default.nix
··· 1 - { stdenv, lib, fetchurl, openssl, perl, libcap ? null, libseccomp ? null }: 1 + { stdenv, lib, fetchurl, openssl, perl, libcap ? null, libseccomp ? null, pps-tools }: 2 2 3 3 assert stdenv.isLinux -> libcap != null; 4 4 assert stdenv.isLinux -> libseccomp != null; ··· 28 28 ] ++ stdenv.lib.optional stdenv.isLinux "--enable-linuxcaps" 29 29 ++ stdenv.lib.optional withSeccomp "--enable-libseccomp"; 30 30 31 - buildInputs = [ libcap openssl perl ] ++ lib.optional withSeccomp libseccomp; 31 + buildInputs = [ libcap openssl perl ] 32 + ++ lib.optional withSeccomp libseccomp 33 + ++ lib.optional stdenv.isLinux pps-tools; 32 34 33 35 hardeningEnable = [ "pie" ]; 34 36
+2
pkgs/top-level/all-packages.nix
··· 14202 14202 14203 14203 powertop = callPackage ../os-specific/linux/powertop { }; 14204 14204 14205 + pps-tools = callPackage ../os-specific/linux/pps-tools { }; 14206 + 14205 14207 prayer = callPackage ../servers/prayer { }; 14206 14208 14207 14209 procps-ng = if stdenv.isLinux then callPackage ../os-specific/linux/procps-ng { }