pps-tools: init at 1.0.2, enable for chrony, gpsd, ntp (#42889)
This commit is contained in:
parent
45f8c2ac29
commit
91575dd285
34
pkgs/os-specific/linux/pps-tools/default.nix
Normal file
34
pkgs/os-specific/linux/pps-tools/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ stdenv, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
baseName = "pps-tools";
|
||||
version = "1.0.2";
|
||||
name = "${baseName}-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "redlab-i";
|
||||
repo = "${baseName}";
|
||||
rev = "v${version}";
|
||||
sha256 = "1yh9g0l59dkq4ci0wbb03qin3c3cizfngmn9jy1vwm5zm6axlxhf";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $dev/include
|
||||
mkdir -p $out/{usr/bin,usr/include/sys}
|
||||
make install DESTDIR=$out
|
||||
mv $out/usr/bin/* $out/bin
|
||||
mv $out/usr/include/* $dev/include/
|
||||
rm -rf $out/usr/
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib;{
|
||||
description = "User-space tools for LinuxPPS";
|
||||
homepage = http://linuxpps.org/;
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ sorki ];
|
||||
};
|
||||
}
|
11
pkgs/servers/gpsd/0002-scons-envs-patch.patch
Normal file
11
pkgs/servers/gpsd/0002-scons-envs-patch.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- 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]
|
|
@ -2,6 +2,7 @@
|
|||
, ncurses, libX11, libXt, libXpm, libXaw, libXext
|
||||
, libusb1, docbook_xml_dtd_412, docbook_xsl, bc
|
||||
, libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout"
|
||||
, pps-tools
|
||||
, python2Packages
|
||||
}:
|
||||
|
||||
|
@ -23,7 +24,7 @@ stdenv.mkDerivation rec {
|
|||
|
||||
buildInputs = [
|
||||
python2Packages.python dbus dbus-glib ncurses libX11 libXt libXpm libXaw libXext
|
||||
libxslt libusb1
|
||||
libxslt libusb1 pps-tools
|
||||
];
|
||||
|
||||
pythonPath = [
|
||||
|
@ -37,6 +38,8 @@ stdenv.mkDerivation rec {
|
|||
|
||||
# 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
|
||||
];
|
||||
|
||||
# - leapfetch=no disables going online at build time to fetch leap-seconds
|
||||
|
@ -44,9 +47,15 @@ stdenv.mkDerivation rec {
|
|||
buildPhase = ''
|
||||
patchShebangs .
|
||||
sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct
|
||||
scons prefix="$out" leapfetch=no gpsd_user=${gpsdUser} gpsd_group=${gpsdGroup} \
|
||||
systemd=yes udevdir="$out/lib/udev" \
|
||||
python_libdir="$out/lib/${python2Packages.python.libPrefix}/site-packages"
|
||||
scons \
|
||||
-j $NIX_BUILD_CORES \
|
||||
prefix="$out" \
|
||||
leapfetch=no \
|
||||
gpsd_user=${gpsdUser} \
|
||||
gpsd_group=${gpsdGroup} \
|
||||
systemd=yes \
|
||||
udevdir="$out/lib/udev" \
|
||||
python_libdir="$out/lib/${python2Packages.python.libPrefix}/site-packages"
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{ stdenv, fetchurl, pkgconfig, libcap, readline, texinfo, nss, nspr
|
||||
, libseccomp }:
|
||||
, libseccomp, pps-tools }:
|
||||
|
||||
assert stdenv.isLinux -> libcap != null;
|
||||
|
||||
|
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
|
|||
};
|
||||
|
||||
buildInputs = [ readline texinfo nss nspr ]
|
||||
++ stdenv.lib.optionals stdenv.isLinux [ libcap libseccomp ];
|
||||
++ stdenv.lib.optionals stdenv.isLinux [ libcap libseccomp pps-tools ];
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
|
||||
hardeningEnable = [ "pie" ];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, lib, fetchurl, openssl, perl, libcap ? null, libseccomp ? null }:
|
||||
{ stdenv, lib, fetchurl, openssl, perl, libcap ? null, libseccomp ? null, pps-tools }:
|
||||
|
||||
assert stdenv.isLinux -> libcap != null;
|
||||
assert stdenv.isLinux -> libseccomp != null;
|
||||
|
@ -28,7 +28,9 @@ stdenv.mkDerivation rec {
|
|||
] ++ stdenv.lib.optional stdenv.isLinux "--enable-linuxcaps"
|
||||
++ stdenv.lib.optional withSeccomp "--enable-libseccomp";
|
||||
|
||||
buildInputs = [ libcap openssl perl ] ++ lib.optional withSeccomp libseccomp;
|
||||
buildInputs = [ libcap openssl perl ]
|
||||
++ lib.optional withSeccomp libseccomp
|
||||
++ lib.optional stdenv.isLinux pps-tools;
|
||||
|
||||
hardeningEnable = [ "pie" ];
|
||||
|
||||
|
|
|
@ -14202,6 +14202,8 @@ with pkgs;
|
|||
|
||||
powertop = callPackage ../os-specific/linux/powertop { };
|
||||
|
||||
pps-tools = callPackage ../os-specific/linux/pps-tools { };
|
||||
|
||||
prayer = callPackage ../servers/prayer { };
|
||||
|
||||
procps-ng = if stdenv.isLinux then callPackage ../os-specific/linux/procps-ng { }
|
||||
|
|
Loading…
Reference in a new issue