commit:     4a9cbf9357026221359832c0bf7363470db27168
Author:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 15 10:02:56 2024 +0000
Commit:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
CommitDate: Sun Dec 15 10:03:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a9cbf93

net-misc/linuxptp: add 4.4

Closes: https://bugs.gentoo.org/941727
Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org>

 net-misc/linuxptp/Manifest                         |  1 +
 .../linuxptp/files/linuxptp-4.4-user_cpp.patch     | 24 ++++++++++
 net-misc/linuxptp/linuxptp-4.4.ebuild              | 52 ++++++++++++++++++++++
 3 files changed, 77 insertions(+)

diff --git a/net-misc/linuxptp/Manifest b/net-misc/linuxptp/Manifest
index 8407ed2a9b1e..37716bedf5d7 100644
--- a/net-misc/linuxptp/Manifest
+++ b/net-misc/linuxptp/Manifest
@@ -1 +1,2 @@
 DIST linuxptp-4.2.tgz 253861 BLAKE2B 
83489edb1cb48a7f245e3224705332980a32aed14e166c3fd0d8111f4008ae42a293397a588a546e421fae634057829dcbcd94794ce539ecb166e5cf69ff6554
 SHA512 
479e512efd0573602379a9e1d8ef5c0ec9e033944cee5aed11c68cea5e8a3f7d4b6f2d11f6d6d4718282010da52c2c8629d675d9b388cc0c3d574845a913cdbb
+DIST linuxptp-4.4.tgz 277069 BLAKE2B 
01ae5fa39c43b00ec528a7e0eebed9138cde6fc0c04d0a9fe53a0c3925bd3431463f381e63637db56bb68e85cddc9a18dc2eb214aaa52a39acaf79c23c8bd1ab
 SHA512 
f9c8ac0c812d9829b3bc4595412afbeea0cade4937c46efbe47789d0ced38894a65f38a174a65a59c51b4d85a7bbf970b5d575ae1389c504fbd36eb7f96bd282

diff --git a/net-misc/linuxptp/files/linuxptp-4.4-user_cpp.patch 
b/net-misc/linuxptp/files/linuxptp-4.4-user_cpp.patch
new file mode 100644
index 000000000000..4334bd7900c4
--- /dev/null
+++ b/net-misc/linuxptp/files/linuxptp-4.4-user_cpp.patch
@@ -0,0 +1,24 @@
+--- 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/makefile b/makefile
+index 3c2406b..c2fadb1 100644
+--- a/makefile
++++ b/makefile
+@@ -40,7 +40,7 @@ OBJECTS      = $(OBJ) hwstamp_ctl.o nsm.o phc2sys.o 
phc_ctl.o pmc.o pmc_agent.o \
+ SRC   = $(OBJECTS:.o=.c)
+ DEPEND        = $(OBJECTS:.o=.d)
+ srcdir        := $(dir $(lastword $(MAKEFILE_LIST)))
+-incdefs := $(shell CC="$(CC)" $(srcdir)/incdefs.sh)
++incdefs := $(shell CPP="$(CPP)" $(srcdir)/incdefs.sh)
+ version := $(shell $(srcdir)/version.sh $(srcdir))
+ VPATH = $(srcdir)
+ 

diff --git a/net-misc/linuxptp/linuxptp-4.4.ebuild 
b/net-misc/linuxptp/linuxptp-4.4.ebuild
new file mode 100644
index 000000000000..7f327cec3c41
--- /dev/null
+++ b/net-misc/linuxptp/linuxptp-4.4.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2024 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="https://downloads.nwtime.org/${PN}//${P}.tgz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
+
+RDEPEND="dev-libs/nettle"
+
+DEPEND="${RDEPEND} \
+       elibc_musl? ( sys-libs/queue-standalone )"
+
+CONFIG_CHECK="~NETWORK_PHY_TIMESTAMPING ~PPS ~PTP_1588_CLOCK"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.4-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