Accepting request 798062 from home:bmwiedemann:reproducible:test

add reproducible.patch to override build date and to sort entries (boo#1047218, boo#1041090)

OBS-URL: https://build.opensuse.org/request/show/798062
OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=153
This commit is contained in:
Atri Bhattacharya 2020-04-27 11:46:27 +00:00 committed by Git OBS Bridge
parent 57c6e48771
commit 2ce443dd83
3 changed files with 177 additions and 0 deletions

167
reproducible.patch Normal file
View File

@ -0,0 +1,167 @@
https://gitlab.kitware.com/vtk/vtk/merge_requests/5633
https://gitlab.kitware.com/vtk/vtk/merge_requests/5634
Index: VTK-8.2.0/Utilities/Doxygen/doc_codematch.pl
===================================================================
--- VTK-8.2.0.orig/Utilities/Doxygen/doc_codematch.pl
+++ VTK-8.2.0/Utilities/Doxygen/doc_codematch.pl
@@ -249,7 +249,7 @@ foreach my $source (@files) {
my $preamble = " \@par " . $args{"label"} . ":\n";
my $doc = $preamble .
- " " . join(" ", keys %{$class2matches{$class}}) . "\n";
+ " " . join(" ", sort keys %{$class2matches{$class}}) . "\n";
if ($block !~ s/($preamble.+?)(\s*\@par|\z)/$doc$2/gms) {
$block .= "\n$doc";
@@ -282,7 +282,7 @@ my $header;
my (@summary, @credits);
push @summary,
- " - $nb_files implementation file(s) returning " . scalar (keys %allmatches) . " word(s) for " . scalar (keys %allclasses) . " classe(es) on " . localtime(),
+ " - $nb_files implementation file(s) returning " . scalar (keys %allmatches) . " word(s) for " . scalar (keys %allclasses) . " classe(es) on " . gmtime($ENV{SOURCE_DATE_EPOCH}||time),
" - $nb_replaced_files file(s) updated";
push @credits,
Index: VTK-8.2.0/Utilities/Doxygen/doc_index.pl
===================================================================
--- VTK-8.2.0.orig/Utilities/Doxygen/doc_index.pl
+++ VTK-8.2.0/Utilities/Doxygen/doc_index.pl
@@ -213,7 +213,7 @@ foreach my $source (@files) {
}
}
-my @words = keys %index;
+my @words = sort keys %index;
print " => ", scalar @words, " word(s) grabbed in $nb_files file(s) in ", time() - $intermediate_time, " s.\n";
# -------------------------------------------------------------------------
@@ -243,7 +243,7 @@ print "Grouping...\n";
sub transfer_keys {
my ($rfrom, $rto) = @_;
- foreach my $key (keys %$rfrom) {
+ foreach my $key (sort keys %$rfrom) {
$rto->{$key} += $rfrom->{$key};
}
}
@@ -350,7 +350,7 @@ foreach my $word (@words) {
# with these extensions that were not found and build a list of similar
# "words" by concatenating both.
- my @verbs = keys %verbs;
+ my @verbs = sort keys %verbs;
if (@verbs) {
my %try = ("" => 1,
"e" => 1,
@@ -397,7 +397,7 @@ print " => $nb_grouped word(s) grouped.\
print "Normalizing...\n";
-@words = keys %index;
+@words = sort keys %index;
foreach my $word (@words) {
my $lcw = lc $word;
@@ -413,7 +413,7 @@ foreach my $word (@words) {
# Normalize group to lowercase
if (exists $group{$word}) {
- foreach my $gword (keys %{$group{$word}}) {
+ foreach my $gword (sort keys %{$group{$word}}) {
my $lcgw = lc $gword;
if ($gword ne uc($gword) && $gword ne $lcgw) {
$group{$word}{$lcgw} = $group{$word}{$gword};
@@ -441,7 +441,7 @@ my (@summary, @credits);
push @summary,
" - $nb_files file(s) indexed by " . scalar @words . " word(s) on " .
- localtime(),
+ gmtime($ENV{SOURCE_DATE_EPOCH}||time),
" - max limit is " . $args{"limit"} . " xref(s) per word";
push @credits,
Index: VTK-8.2.0/Utilities/Doxygen/doc_class2example.pl
===================================================================
--- VTK-8.2.0.orig/Utilities/Doxygen/doc_class2example.pl
+++ VTK-8.2.0/Utilities/Doxygen/doc_class2example.pl
@@ -171,7 +171,7 @@ sub unique {
foreach my $item (@$ref) {
$uniques{$item}++;
}
- return keys %uniques;
+ return sort keys %uniques;
}
sub parse {
@@ -506,7 +506,7 @@ my (@summary, @credits, @legend);
push @summary,
" - " . scalar @words . " class(es) in " .
- scalar @parsable . " file(s) from directories matching \@c " . $args{"dirmatch"} . " on " . localtime();
+ scalar @parsable . " file(s) from directories matching \@c " . $args{"dirmatch"} . " on " . gmtime($ENV{SOURCE_DATE_EPOCH}||time);
push @summary,
" - " . scalar @parsers . " parser(s) : [" . join(", ", @parsers) . "]";
Index: VTK-8.2.0/Utilities/Doxygen/doc_contributors.pl
===================================================================
--- VTK-8.2.0.orig/Utilities/Doxygen/doc_contributors.pl
+++ VTK-8.2.0/Utilities/Doxygen/doc_contributors.pl
@@ -462,7 +462,7 @@ my $nb_removed = 0;
foreach my $signature (sort { (scalar keys %{$log_revision_by_signature_file{$b}}) <=> (scalar keys %{$log_revision_by_signature_file{$a}}) }
keys %log_revision_by_signature_file) {
- my @files = keys %{$log_revision_by_signature_file{$signature}};
+ my @files = sort keys %{$log_revision_by_signature_file{$signature}};
if (scalar @files > $args{"massive"}) {
print " >> Removed: (" . scalar @files . ")\n " .
@@ -521,7 +521,7 @@ $intermediate_time = time();
# Browse each file, each revision and use contribution
-foreach my $file_name (keys %files_visited) {
+foreach my $file_name (sort keys %files_visited) {
# Check if file is part of a class group
@@ -533,7 +533,7 @@ foreach my $file_name (keys %files_visit
$classes{$class_name}{'creators'}{$log_by_file_revision{$file_name}{'1.1'}{'author'}} = 1;
}
- foreach my $revision (keys %{$log_by_file_revision{$file_name}}) {
+ foreach my $revision (sort keys %{$log_by_file_revision{$file_name}}) {
my $author = $log_by_file_revision{$file_name}{$revision}{'author'};
@@ -603,7 +603,7 @@ while (@classes_names) {
# Find the class header name
my $source_header_name = undef;
- foreach my $file_name (keys %{$classes{$class_name}{'files'}}) {
+ foreach my $file_name (sort keys %{$classes{$class_name}{'files'}}) {
if ($file_name =~ m/\.h$/) {
$source_header_name = $file_name;
last;
@@ -682,7 +682,7 @@ while (@classes_names) {
if (exists $args{"cvsweb"}) {
$doc .= "\n \@par CVS logs (CVSweb):\n";
- foreach my $file (keys %{$classes{$class_name}{'files'}}) {
+ foreach my $file (sort keys %{$classes{$class_name}{'files'}}) {
my $shortname = get_short_relative_name($file, $args{"relativeto"});
my ($base, $dir, $ext) = fileparse($shortname, '\..*');
$doc .= ' - @htmlonly<A href="' . $args{"cvsweb"}
@@ -769,10 +769,10 @@ my %contribution_by_author;
my %contribution_by_date;
-foreach my $contributor (keys %contribution_by_author_file) {
+foreach my $contributor (sort keys %contribution_by_author_file) {
foreach my $file_name
- (keys %{$contribution_by_author_file{$contributor}}) {
+ (sort keys %{$contribution_by_author_file{$contributor}}) {
$contribution_by_author{$contributor} +=
$contribution_by_author_file{$contributor}{$file_name};
}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Apr 26 04:21:40 UTC 2020 - Bernhard Wiedemann <bwiedemann@suse.com>
- add reproducible.patch to override build date and to sort entries
(boo#1047218, boo#1041090)
-------------------------------------------------------------------
Fri Apr 24 08:28:02 UTC 2020 - Atri Bhattacharya <badshah400@gmail.com>

View File

@ -110,6 +110,8 @@ Patch5: 0001-Add-libogg-to-IOMovie-target-link-libraries.patch
Patch6: 0001-Make-code-calling-proj4-compatible-with-proj4-5.0-an.patch
# PATCH-FIX-UPSTREAM -- Support for python3.8
Patch7: python38.patch
# PATCH-FIX-UPSTREAM https://gitlab.kitware.com/vtk/vtk/merge_requests/5633 + 5634
Patch8: reproducible.patch
BuildRequires: R-base-devel
BuildRequires: chrpath
BuildRequires: cmake >= 3.4
@ -352,6 +354,7 @@ languages.
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
# Replace relative path ../../../../VTKData with %%{_datadir}/vtkdata
# otherwise it will break on symlinks.
@ -493,6 +496,7 @@ export PYTHONPATH=$_PYTHON_MPI_PREFIX:$PYTHONPATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{my_libdir}
export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python3_sitearch}
python3 -c "import vtk"
find %{buildroot} . -name vtk.cpython-3*.pyc -delete # drop unreproducible time-based .pyc file
%post -n %{shlib} -p /sbin/ldconfig
%postun -n %{shlib} -p /sbin/ldconfig