Upgrade to 1.9774 as provided in perl-5.37.11

This commit is contained in:
Jitka Plesnikova 2023-05-18 20:28:51 +02:00
parent 0ee91ab19b
commit d409dcfc12
2 changed files with 180 additions and 8 deletions

View File

@ -0,0 +1,166 @@
From 33cc1afd407885bd671f97ef6c7277f4ed31ac3c Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik@redhat.com>
Date: Thu, 18 May 2023 20:18:16 +0200
Subject: [PATCH] Upgrade to 1.9774
---
Changes | 11 +++++++++++
HiRes.pm | 2 +-
HiRes.xs | 12 +++++-------
Makefile.PL | 20 ++++++++++++++++----
t/stat.t | 6 +++++-
5 files changed, 38 insertions(+), 13 deletions(-)
diff --git a/Changes b/Changes
index 96f058a..e63892a 100644
--- a/Changes
+++ b/Changes
@@ -4,6 +4,17 @@ Revision history for the Perl extension Time::HiRes.
- Remove obsolete vms code
- Use core version compare
+ - Use GIMME_V instead of the deprecated GIMME
+ - t/utime.t: dragonflybsd has only microsecond precision
+ - t/utime.t: dragonflybsd is noatime by default
+ - t/stat.t: skip testing access times on HaikuOS, it doesn't support
+ atime
+ - darwin: make sure the compiler can find the system perl headers
+ https://github.com/Perl/perl5/issues/20362
+ - darwin: make sure PERL_DARWIN is defined on darwin.
+ - don't compare stat and lstat atime if PERL_FILE_ATIME_CHANGES is set in
+ the environment.
+ https://github.com/Perl/perl5/issues/19321
1.9764 [2020-08-10]
- Fix a bunch of repeated-word typos
diff --git a/HiRes.pm b/HiRes.pm
index 7e21047..22660cb 100644
--- a/HiRes.pm
+++ b/HiRes.pm
@@ -50,7 +50,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
stat lstat utime
);
-our $VERSION = '1.9770';
+our $VERSION = '1.9774';
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
diff --git a/HiRes.xs b/HiRes.xs
index 1eb7de3..e108848 100644
--- a/HiRes.xs
+++ b/HiRes.xs
@@ -19,10 +19,10 @@ extern "C" {
#include "perl.h"
#include "XSUB.h"
#include "reentr.h"
-#ifdef USE_PPPORT_H
+#if !defined(IS_SAFE_PATHNAME) && defined(TIME_HIRES_UTIME) && defined(HAS_UTIMENSAT)
#define NEED_ck_warner
-# include "ppport.h"
#endif
+#include "ppport.h"
#if defined(__CYGWIN__) && defined(HAS_W32API_WINDOWS_H)
# include <w32api/windows.h>
# define CYGWIN_WITH_W32API
@@ -263,8 +263,6 @@ _gettimeofday(pTHX_ struct timeval *tp, void *not_used)
static int
_clock_gettime(pTHX_ clockid_t clock_id, struct timespec *tp)
{
- FT_t ft;
-
switch (clock_id) {
case CLOCK_REALTIME: {
FT_t ft;
@@ -1193,7 +1191,7 @@ gettimeofday()
int status;
status = gettimeofday (&Tp, NULL);
if (status == 0) {
- if (GIMME == G_LIST) {
+ if (GIMME_V == G_LIST) {
EXTEND(sp, 2);
PUSHs(sv_2mortal(newSViv(Tp.tv_sec)));
PUSHs(sv_2mortal(newSViv(Tp.tv_usec)));
@@ -1250,7 +1248,7 @@ setitimer(which, seconds, interval = 0)
if (setitimer(which, &newit, &oldit) == 0) {
EXTEND(sp, 1);
PUSHs(sv_2mortal(newSVnv(TV2NV(oldit.it_value))));
- if (GIMME == G_LIST) {
+ if (GIMME_V == G_LIST) {
EXTEND(sp, 1);
PUSHs(sv_2mortal(newSVnv(TV2NV(oldit.it_interval))));
}
@@ -1270,7 +1268,7 @@ getitimer(which)
if (getitimer(which, &nowit) == 0) {
EXTEND(sp, 1);
PUSHs(sv_2mortal(newSVnv(TV2NV(nowit.it_value))));
- if (GIMME == G_LIST) {
+ if (GIMME_V == G_LIST) {
EXTEND(sp, 1);
PUSHs(sv_2mortal(newSVnv(TV2NV(nowit.it_interval))));
}
diff --git a/Makefile.PL b/Makefile.PL
index e5ba503..5803daf 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -68,8 +68,17 @@ __EOD__
}
}
- my $ccflags = $Config{'ccflags'} . ' ' . "-I$COREincdir"
- . ' -DPERL_NO_INLINE_FUNCTIONS';
+ my $ccflags = $Config{'ccflags'} . ' ';
+ my @osvers = split /\./, $Config{osvers};
+ if ($^O eq "darwin"
+ && $^X eq "/usr/bin/perl"
+ && $osvers[0] >= 18) {
+ $ccflags .= qq(-iwithsysroot "$COREincdir");
+ }
+ else {
+ $ccflags .= "-I$COREincdir"
+ }
+ $ccflags .= ' -DPERL_NO_INLINE_FUNCTIONS';
if ($^O eq 'VMS') {
$cccmd = "$Config{'cc'} /include=($COREincdir) $tmp.c";
@@ -841,6 +850,11 @@ EOM
print "NOT found.\n";
}
}
+ if ($^O eq "darwin") {
+ # the system perl on darwin doesn't seem to include -DPERL_DARWIN
+ # which breaks setting up emulation
+ DEFINE("PERL_DARWIN");
+ }
if ($DEFINE) {
$DEFINE =~ s/^\s+//;
@@ -854,8 +868,6 @@ EOM
sub doMakefile {
my @makefileopts = ();
- DEFINE('USE_PPPORT_H') unless $ENV{PERL_CORE};
-
push (@makefileopts,
'NAME' => 'Time::HiRes',
'AUTHOR' => 'Jarkko Hietaniemi <jhi@iki.fi>',
diff --git a/t/stat.t b/t/stat.t
index 1f1fa96..2f72fdc 100644
--- a/t/stat.t
+++ b/t/stat.t
@@ -36,7 +36,11 @@ for (1..5) {
SKIP: {
if($^O eq "haiku") {
skip "testing stat access time on Haiku", 2;
- }
+ }
+ if ($ENV{PERL_FILE_ATIME_CHANGES}) {
+ # something else might access the file, changing atime
+ $lstat->[8] = $stat->[8];
+ }
is_deeply $lstat, $stat, "write: stat and lstat returned same values";
Time::HiRes::sleep(rand(0.1) + 0.1);
open(X, '<', $$);
--
2.40.1

View File

@ -2,8 +2,8 @@
Name: perl-Time-HiRes
Epoch: 4
Version: 1.9770
Release: 490%{?dist}
Version: 1.9774
Release: 1%{?dist}
Summary: High resolution alarm, sleep, gettimeofday, interval timers
License: GPL-1.0-or-later OR Artistic-1.0-Perl
URL: https://metacpan.org/release/Time-HiRes
@ -12,6 +12,8 @@ Source0: https://cpan.metacpan.org/authors/id/A/AT/ATOOMIC/Time-HiRes-%{b
Patch0: Time-HiRes-1.9764-Upgrade-to-1.9767.patch
# Unbundled from perl 5.35.11
Patch1: Time-HiRes-1.9767-Upgrade-to-1.9770.patch
# Unbundled from perl 5.37.11
Patch2: Time-HiRes-1.9770-Upgrade-to-1.9774.patch
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: gcc
@ -45,18 +47,19 @@ high resolution time and timers.
%prep
%setup -q -n Time-HiRes-%{base_version}
%patch0 -p1
%patch1 -p1
%patch -P0 -p1
%patch -P1 -p1
%patch -P2 -p1
%build
unset PERL_CORE
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS"
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="%{optflags}"
%{make_build}
%install
%{make_install}
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
%{_fixperms} $RPM_BUILD_ROOT/*
find %{buildroot} -type f -name '*.bs' -size 0 -delete
%{_fixperms} %{buildroot}/*
%check
make test
@ -65,9 +68,12 @@ make test
%doc Changes README TODO
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/Time*
%{_mandir}/man3/*
%{_mandir}/man3/Time::HiRes*
%changelog
* Thu May 18 2023 Jitka Plesnikova <jplesnik@redhat.com> - 4:1.9774-1
- Upgrade to 1.9774 as provided in perl-5.37.11
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4:1.9770-490
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild