commit:     44a48c8e81c84c23a6c4becd4591905e64624c30
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 24 12:00:14 2023 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Sun Dec 24 21:06:53 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44a48c8e

net-misc/linuxptp: add 4.2

Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 net-misc/linuxptp/Manifest                         |  1 +
 .../linuxptp/files/linuxptp-4.2-user_cpp.patch     | 11 +++++
 net-misc/linuxptp/linuxptp-4.2.ebuild              | 49 ++++++++++++++++++++++
 3 files changed, 61 insertions(+)

diff --git a/net-misc/linuxptp/Manifest b/net-misc/linuxptp/Manifest
index 99d89fba1a94..6875deba8c2e 100644
--- a/net-misc/linuxptp/Manifest
+++ b/net-misc/linuxptp/Manifest
@@ -1 +1,2 @@
 DIST linuxptp-4.1.tgz 252373 BLAKE2B 
9dc6bb69c98a8b452250554b5e06b39d445b81a3e0c7ce2beaa7bd1d2cb969928496827bd3d3e32136c9fe55f1103ab312441c2a4cdee035c7d6b7526f0c1327
 SHA512 
144c03677f2c61c58d05c5c5dbb771b7aac3860507d9ba814f67f6da024c3cb2019f9e8cf39b983d39a6feddd1b24a1f40a678b4ff7af8aa564ee813e322dfae
+DIST linuxptp-4.2.tgz 253861 BLAKE2B 
83489edb1cb48a7f245e3224705332980a32aed14e166c3fd0d8111f4008ae42a293397a588a546e421fae634057829dcbcd94794ce539ecb166e5cf69ff6554
 SHA512 
479e512efd0573602379a9e1d8ef5c0ec9e033944cee5aed11c68cea5e8a3f7d4b6f2d11f6d6d4718282010da52c2c8629d675d9b388cc0c3d574845a913cdbb

diff --git a/net-misc/linuxptp/files/linuxptp-4.2-user_cpp.patch 
b/net-misc/linuxptp/files/linuxptp-4.2-user_cpp.patch
new file mode 100644
index 000000000000..f999ed0189b6
--- /dev/null
+++ b/net-misc/linuxptp/files/linuxptp-4.2-user_cpp.patch
@@ -0,0 +1,11 @@
+--- a/incdefs.sh
++++ b/incdefs.sh
+@@ -27,7 +27,7 @@
+       printf " -D_GNU_SOURCE"
+ 
+       # Get list of directories searched for header files.
+-      dirs=$(${CC} -E -Wp,-v -xc /dev/null 2>&1 >/dev/null | grep ^" /")
++      dirs=$(echo "" | ${CPP} -Wp,-v - 2>&1 >/dev/null | grep ^" /")
+ 
+       # Look for clock_adjtime().
+       for d in $dirs; do

diff --git a/net-misc/linuxptp/linuxptp-4.2.ebuild 
b/net-misc/linuxptp/linuxptp-4.2.ebuild
new file mode 100644
index 000000000000..782ff196d132
--- /dev/null
+++ b/net-misc/linuxptp/linuxptp-4.2.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info systemd toolchain-funcs
+
+DESCRIPTION="The Linux Precision Time Protocol (PTP) implementation"
+HOMEPAGE="https://linuxptp.nwtime.org/";
+SRC_URI="mirror://sourceforge/project/${PN}/v$(ver_cut 1-2)/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
+
+DEPEND="elibc_musl? ( sys-libs/queue-standalone )"
+
+CONFIG_CHECK="~NETWORK_PHY_TIMESTAMPING ~PPS ~PTP_1588_CLOCK"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.2-user_cpp.patch
+)
+
+pkg_setup() {
+       linux-info_pkg_setup
+}
+
+src_compile() {
+       # parse needed additional CFLAGS
+       export MY_FLAGS=$(CPP="$(tc-getCPP)" ./incdefs.sh)
+       export EXTRA_CFLAGS="${CFLAGS} ${MY_FLAGS}"
+       emake CC="$(tc-getCC)" prefix=/usr mandir=/usr/share/man
+}
+
+src_install() {
+       emake \
+               prefix="${D}"/usr \
+               mandir="${D}"/usr/share/man \
+               infodir="${D}"/usr/share/info \
+               libdir="${D}"/usr/$(get_libdir) \
+               install
+
+       systemd_newunit "${FILESDIR}"/phc2sysAT.service [email protected]
+       systemd_newunit "${FILESDIR}"/ptp4lAT.service [email protected]
+       systemd_dounit "${FILESDIR}"/timemaster.service
+
+       dodoc README.org
+       dodoc -r configs
+}

Reply via email to