From 592919638f5a43810391d434b063ffdec7b8d955 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 22 Nov 2016 20:27:29 +0000 Subject: academic/perlprimer: Updated for version 1.1.21. Signed-off-by: David Spencer --- academic/perlprimer/01_sytaxerrors.patch | 157 +++++++++++++++++++++++++ academic/perlprimer/02_fix-defined-slist.patch | 11 ++ academic/perlprimer/perlprimer.SlackBuild | 8 +- academic/perlprimer/sytaxerrors.patch | 157 ------------------------- 4 files changed, 174 insertions(+), 159 deletions(-) create mode 100644 academic/perlprimer/01_sytaxerrors.patch create mode 100644 academic/perlprimer/02_fix-defined-slist.patch delete mode 100644 academic/perlprimer/sytaxerrors.patch (limited to 'academic/perlprimer') diff --git a/academic/perlprimer/01_sytaxerrors.patch b/academic/perlprimer/01_sytaxerrors.patch new file mode 100644 index 0000000000000..45b9cd570d565 --- /dev/null +++ b/academic/perlprimer/01_sytaxerrors.patch @@ -0,0 +1,157 @@ +Author: Steffen Moeller +Description: Fixes a series of errors indicated by Perl 5.18. +Forwarded: https://sourceforge.net/p/perlprimer/patches/6/ + +Index: git/perlprimer.pl +=================================================================== +--- git.orig/perlprimer.pl ++++ git/perlprimer.pl +@@ -3093,23 +3093,24 @@ + # and because it's 3' primer-dimers that are the real problem in PCR. + + # create a binding array for each of the four bases +- for $l (0 .. $pfl-1) { ++ foreach $l (0 .. $pfl-1) { + my $mbase = substr($fprimer_r, $l, 1); + $primer_hash{$mbase}[$l]=1; +- for $k qw(a g c t) { ++ my @nucleotides = qw(a g c t); ++ foreach $k (@nucleotides) { + $primer_hash{$k}[$l] ||=0; + } + } + + # create the primer matrix + my @primer_comp; +- for $k (0 .. $prl-1) { ++ foreach $k (0 .. $prl-1) { + $primer_comp[$k]=$primer_hash{substr($rcomprlc, $k, 1)}; + } + + # read each combination from the matrix, calculate dG for each dimer + my $pd_len = ($pd_full ? $pfl+$prl-1 : $pl-2); +- for $k (0 .. $pd_len) { ++ foreach $k (0 .. $pd_len) { + $score[$k]=0; + my $bind; + my $score_p=0; +@@ -3129,7 +3130,7 @@ + # } + + # read the binding data +- for $l (0 .. $prl-1) { ++ foreach $l (0 .. $prl-1) { + if (($k-$l)<$pfl) { + $bind .= $primer_comp[$l][$k-$l] if ($k-$l)>=0; + } else { +@@ -3148,7 +3149,7 @@ + + # Find start and end of similarity + my ($pb_init,$pb_end); +- for $l (0 .. length($bind)-1) { ++ foreach $l (0 .. length($bind)-1) { + # at first I tried finding the initiating terminal bases with + # regexps, but that was much slower ... + if (substr($bind, $l, 1) eq "1") { +@@ -3159,7 +3160,7 @@ + + if (defined($pb_init)) { + # deltaG calculation +- for $l ($pb_init .. $pb_end-1) { ++ foreach $l ($pb_init .. $pb_end-1) { + next if substr($bind, $l, 2) eq "00"; + next if substr($bind, $l, 1) eq "2"; + $score_p+=$oligo_dG{substr($primer_f, $pfl-$k+$l-1, 2).substr($rprimer_r, $l, 2)}; +@@ -3228,44 +3229,44 @@ + # and because it's 3' primer-dimers that are the real problem in PCR. + + # create a binding array for each of the four bases +- for $l (0 .. $pfl-1) { ++ foreach $l (0 .. $pfl-1) { + my $mbase = substr($fprimer_r, $l, 1); + $primer_hash{$mbase}[$l]=1; +- for $k qw(a g c t) { ++ foreach $k (qw(a g c t)) { + $primer_hash{$k}[$l] ||=0; + } + } + + # create the primer matrix + my @primer_comp; +- for $k (0 .. $prl-1) { +- $primer_comp[$k]=$primer_hash{substr($rcomprlc, $k, 1)}; ++ foreach my $kk (0 .. $prl-1) { ++ $primer_comp[$kk]=$primer_hash{substr($rcomprlc, $kk, 1)}; + } + + # print the matrix - for debugging + print "$primer_f vs. $primer_r - full pd = $pd_full\n"; + print " \t"; +- for $l (0 .. $pfl-1) { ++ foreach $l (0 .. $pfl-1) { + my $mbase = substr($fprimer_r, $l, 1); + print "$mbase "; + } + print "\n"; +- for $k (0 .. $prl-1) { +- my $base = substr($rprimer_r, $k, 1); +- print "$base:\t@{$primer_comp[$k]}\n"; ++ foreach my $kk (0 .. $prl-1) { ++ my $base = substr($rprimer_r, $kk, 1); ++ print "$base:\t@{$primer_comp[$kk]}\n"; + } + + my @binding_data; + # read each combination from the matrix, calculate dG for each dimer + my $pd_len = ($pd_full ? $pfl+$prl-1 : $pl-2); +- for my $k (0 .. $pd_len) { +- $score[$k]=0; ++ foreach my $kk (0 .. $pd_len) { ++ $score[$kk]=0; + my $bind; + my $score_p=0; + + # starting coords +- my $pf_coord_start = ($k >= $pfl ? $pfl-1 : $k); +- my $pr_coord_start = ($k - $pfl > 0 ? $k - $pfl : 0); ++ my $pf_coord_start = ($kk >= $pfl ? $pfl-1 : $kk); ++ my $pr_coord_start = ($kk - $pfl > 0 ? $kk - $pfl : 0); + my ($pf_coord, $pr_coord, $first, $flag); + + # read through each combination finding multiple matches +@@ -3285,7 +3286,7 @@ + } + } elsif ($flag) { + # end of a binding stretch +- push @binding_data, [$k, $first, $bind] if $bind > 1; ++ push @binding_data, [$kk, $first, $bind] if $bind > 1; + $bind=0; + $flag=0; + } +@@ -3325,7 +3326,7 @@ + # # } + # + # # read the binding data +- # for $l (0 .. $prl-1) { ++ # foreach $l (0 .. $prl-1) { + # if (($k-$l)<$pfl) { + # $bind .= $primer_comp[$l][$k-$l] if ($k-$l)>=0; + # } else { +@@ -3344,7 +3345,7 @@ + # + # # Find start and end of similarity + # my ($pb_init,$pb_end); +- # for $l (0 .. length($bind)-1) { ++ # foreach $l (0 .. length($bind)-1) { + # # at first I tried finding the initiating terminal bases with + # # regexps, but that was much slower ... + # if (substr($bind, $l, 1) eq "1") { +@@ -3355,7 +3356,7 @@ + # + # if (defined($pb_init)) { + # # deltaG calculation +- # for $l ($pb_init .. $pb_end-1) { ++ # foreach $l ($pb_init .. $pb_end-1) { + # next if substr($bind, $l, 2) eq "00"; + # next if substr($bind, $l, 1) eq "2"; + # $score_p+=$oligo_dG{substr($primer_f, $pfl-$k+$l-1, 2).substr($rprimer_r, $l, 2)}; diff --git a/academic/perlprimer/02_fix-defined-slist.patch b/academic/perlprimer/02_fix-defined-slist.patch new file mode 100644 index 0000000000000..38b375c844e5f --- /dev/null +++ b/academic/perlprimer/02_fix-defined-slist.patch @@ -0,0 +1,11 @@ +--- orig/perlprimer.pl 2016-11-22 21:06:25.135978000 +0200 ++++ new/perlprimer.pl 2016-11-22 21:08:09.001971413 +0200 +@@ -5226,7 +5226,7 @@ sub generate_report { + } + + my ($hlist_sel) = $$hlist_ref->selectionGet; +- unless (defined(@$slist) && defined($hlist_sel)) { ++ unless (@$slist && defined($hlist_sel)) { + dialogue("The Generate Report function saves the statistics and alignment of a particular primer pair - please select a primer pair first"); + return; + } diff --git a/academic/perlprimer/perlprimer.SlackBuild b/academic/perlprimer/perlprimer.SlackBuild index 182c189b732c8..8e681db655bf4 100644 --- a/academic/perlprimer/perlprimer.SlackBuild +++ b/academic/perlprimer/perlprimer.SlackBuild @@ -24,7 +24,7 @@ PRGNAM=perlprimer VERSION=${VERSION:-1.1.21} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} ARCH=noarch @@ -50,7 +50,11 @@ find -L . \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; # Thanks to Debian for the patch! -patch -p1 -i $CWD/sytaxerrors.patch +patch -p1 -i $CWD/01_sytaxerrors.patch + +# A quick fix to this issue: +# https://bugs.launchpad.net/ubuntu/+source/perlprimer/+bug/1575074 +patch -p1 -i $CWD/02_fix-defined-slist.patch install -D -m755 perlprimer.pl $PKG/usr/bin/perlprimer.pl install -D -m644 gcg.603 $PKG/usr/share/$PRGNAM/gcg.603 diff --git a/academic/perlprimer/sytaxerrors.patch b/academic/perlprimer/sytaxerrors.patch deleted file mode 100644 index 45b9cd570d565..0000000000000 --- a/academic/perlprimer/sytaxerrors.patch +++ /dev/null @@ -1,157 +0,0 @@ -Author: Steffen Moeller -Description: Fixes a series of errors indicated by Perl 5.18. -Forwarded: https://sourceforge.net/p/perlprimer/patches/6/ - -Index: git/perlprimer.pl -=================================================================== ---- git.orig/perlprimer.pl -+++ git/perlprimer.pl -@@ -3093,23 +3093,24 @@ - # and because it's 3' primer-dimers that are the real problem in PCR. - - # create a binding array for each of the four bases -- for $l (0 .. $pfl-1) { -+ foreach $l (0 .. $pfl-1) { - my $mbase = substr($fprimer_r, $l, 1); - $primer_hash{$mbase}[$l]=1; -- for $k qw(a g c t) { -+ my @nucleotides = qw(a g c t); -+ foreach $k (@nucleotides) { - $primer_hash{$k}[$l] ||=0; - } - } - - # create the primer matrix - my @primer_comp; -- for $k (0 .. $prl-1) { -+ foreach $k (0 .. $prl-1) { - $primer_comp[$k]=$primer_hash{substr($rcomprlc, $k, 1)}; - } - - # read each combination from the matrix, calculate dG for each dimer - my $pd_len = ($pd_full ? $pfl+$prl-1 : $pl-2); -- for $k (0 .. $pd_len) { -+ foreach $k (0 .. $pd_len) { - $score[$k]=0; - my $bind; - my $score_p=0; -@@ -3129,7 +3130,7 @@ - # } - - # read the binding data -- for $l (0 .. $prl-1) { -+ foreach $l (0 .. $prl-1) { - if (($k-$l)<$pfl) { - $bind .= $primer_comp[$l][$k-$l] if ($k-$l)>=0; - } else { -@@ -3148,7 +3149,7 @@ - - # Find start and end of similarity - my ($pb_init,$pb_end); -- for $l (0 .. length($bind)-1) { -+ foreach $l (0 .. length($bind)-1) { - # at first I tried finding the initiating terminal bases with - # regexps, but that was much slower ... - if (substr($bind, $l, 1) eq "1") { -@@ -3159,7 +3160,7 @@ - - if (defined($pb_init)) { - # deltaG calculation -- for $l ($pb_init .. $pb_end-1) { -+ foreach $l ($pb_init .. $pb_end-1) { - next if substr($bind, $l, 2) eq "00"; - next if substr($bind, $l, 1) eq "2"; - $score_p+=$oligo_dG{substr($primer_f, $pfl-$k+$l-1, 2).substr($rprimer_r, $l, 2)}; -@@ -3228,44 +3229,44 @@ - # and because it's 3' primer-dimers that are the real problem in PCR. - - # create a binding array for each of the four bases -- for $l (0 .. $pfl-1) { -+ foreach $l (0 .. $pfl-1) { - my $mbase = substr($fprimer_r, $l, 1); - $primer_hash{$mbase}[$l]=1; -- for $k qw(a g c t) { -+ foreach $k (qw(a g c t)) { - $primer_hash{$k}[$l] ||=0; - } - } - - # create the primer matrix - my @primer_comp; -- for $k (0 .. $prl-1) { -- $primer_comp[$k]=$primer_hash{substr($rcomprlc, $k, 1)}; -+ foreach my $kk (0 .. $prl-1) { -+ $primer_comp[$kk]=$primer_hash{substr($rcomprlc, $kk, 1)}; - } - - # print the matrix - for debugging - print "$primer_f vs. $primer_r - full pd = $pd_full\n"; - print " \t"; -- for $l (0 .. $pfl-1) { -+ foreach $l (0 .. $pfl-1) { - my $mbase = substr($fprimer_r, $l, 1); - print "$mbase "; - } - print "\n"; -- for $k (0 .. $prl-1) { -- my $base = substr($rprimer_r, $k, 1); -- print "$base:\t@{$primer_comp[$k]}\n"; -+ foreach my $kk (0 .. $prl-1) { -+ my $base = substr($rprimer_r, $kk, 1); -+ print "$base:\t@{$primer_comp[$kk]}\n"; - } - - my @binding_data; - # read each combination from the matrix, calculate dG for each dimer - my $pd_len = ($pd_full ? $pfl+$prl-1 : $pl-2); -- for my $k (0 .. $pd_len) { -- $score[$k]=0; -+ foreach my $kk (0 .. $pd_len) { -+ $score[$kk]=0; - my $bind; - my $score_p=0; - - # starting coords -- my $pf_coord_start = ($k >= $pfl ? $pfl-1 : $k); -- my $pr_coord_start = ($k - $pfl > 0 ? $k - $pfl : 0); -+ my $pf_coord_start = ($kk >= $pfl ? $pfl-1 : $kk); -+ my $pr_coord_start = ($kk - $pfl > 0 ? $kk - $pfl : 0); - my ($pf_coord, $pr_coord, $first, $flag); - - # read through each combination finding multiple matches -@@ -3285,7 +3286,7 @@ - } - } elsif ($flag) { - # end of a binding stretch -- push @binding_data, [$k, $first, $bind] if $bind > 1; -+ push @binding_data, [$kk, $first, $bind] if $bind > 1; - $bind=0; - $flag=0; - } -@@ -3325,7 +3326,7 @@ - # # } - # - # # read the binding data -- # for $l (0 .. $prl-1) { -+ # foreach $l (0 .. $prl-1) { - # if (($k-$l)<$pfl) { - # $bind .= $primer_comp[$l][$k-$l] if ($k-$l)>=0; - # } else { -@@ -3344,7 +3345,7 @@ - # - # # Find start and end of similarity - # my ($pb_init,$pb_end); -- # for $l (0 .. length($bind)-1) { -+ # foreach $l (0 .. length($bind)-1) { - # # at first I tried finding the initiating terminal bases with - # # regexps, but that was much slower ... - # if (substr($bind, $l, 1) eq "1") { -@@ -3355,7 +3356,7 @@ - # - # if (defined($pb_init)) { - # # deltaG calculation -- # for $l ($pb_init .. $pb_end-1) { -+ # foreach $l ($pb_init .. $pb_end-1) { - # next if substr($bind, $l, 2) eq "00"; - # next if substr($bind, $l, 1) eq "2"; - # $score_p+=$oligo_dG{substr($primer_f, $pfl-$k+$l-1, 2).substr($rprimer_r, $l, 2)}; -- cgit v1.2.3