commit:     a27bb196930c2b32f3f24956d902c2849d27d20b
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  1 19:44:14 2021 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Aug  1 19:44:24 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a27bb196

sys-devel/autoconf: use Time::HiRes functions, bug 782985

While this solution is perfect for Gentoo, it may not be upstreamable
(since Time::HiRes was introduced in Perl 5.8 and autoconf upstream
insists on supporting Perl 5.6).

Bug: https://bugs.gentoo.org/782985
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 sys-devel/autoconf/autoconf-2.71.ebuild           |  2 +
 sys-devel/autoconf/files/autoconf-2.71-time.patch | 49 +++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/sys-devel/autoconf/autoconf-2.71.ebuild 
b/sys-devel/autoconf/autoconf-2.71.ebuild
index 3405416d23c..b142fa3470f 100644
--- a/sys-devel/autoconf/autoconf-2.71.ebuild
+++ b/sys-devel/autoconf/autoconf-2.71.ebuild
@@ -37,6 +37,8 @@ RDEPEND="${BDEPEND}
 [[ ${PV} == "9999" ]] && BDEPEND+=" >=sys-apps/texinfo-4.3"
 PDEPEND="emacs? ( app-emacs/autoconf-mode )"
 
+PATCHES=( "${FILESDIR}/${P}-time.patch" )
+
 src_prepare() {
        # usr/bin/libtool is provided by binutils-apple, need gnu libtool
        if [[ ${CHOST} == *-darwin* ]] ; then

diff --git a/sys-devel/autoconf/files/autoconf-2.71-time.patch 
b/sys-devel/autoconf/files/autoconf-2.71-time.patch
new file mode 100644
index 00000000000..8ecfe10f40a
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.71-time.patch
@@ -0,0 +1,49 @@
+From e194b3c7e00429612a9d40e78ea571687fd25b91 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <[email protected]>
+Date: Sun, 1 Aug 2021 19:07:48 +0200
+Subject: [PATCH] Use stat from Time::HiRes (instead of File::stat)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas K. Hüttel <[email protected]>
+---
+ lib/Autom4te/FileUtils.pm | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Autom4te/FileUtils.pm b/lib/Autom4te/FileUtils.pm
+index a182031b..27a5fd91 100644
+--- a/lib/Autom4te/FileUtils.pm
++++ b/lib/Autom4te/FileUtils.pm
+@@ -34,12 +34,12 @@ This perl module provides various general purpose file 
handling functions.
+ 
+ =cut
+ 
+-use 5.006;
++use 5.008;
+ use strict;
+ use warnings FATAL => 'all';
+ 
+ use Exporter;
+-use File::stat;
++use Time::HiRes qw(stat);
+ use IO::File;
+ 
+ use Autom4te::Channels;
+@@ -115,10 +115,11 @@ sub mtime ($)
+   return 0
+     if $file eq '-' || ! -f $file;
+ 
+-  my $stat = stat ($file)
++  my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
++    $atime,$mtime,$ctime,$blksize,$blocks) = stat ($file)
+     or fatal "cannot stat $file: $!";
+ 
+-  return $stat->mtime;
++  return $mtime;
+ }
+ 
+ 
+-- 
+2.31.1
+

Reply via email to