summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoan Bruguera2019-04-30 01:09:25 +0200
committerJoan Bruguera2019-04-30 01:09:25 +0200
commitda21f38912edcb25f31c7bed5bdb30005a801776 (patch)
treefcdbdd404e96c7dac8675fdb990885e94ddbafcb
parent155fe9b211c08fee8dac4f13c6df477c3ee5fcdb (diff)
downloadaur-da21f38912edcb25f31c7bed5bdb30005a801776.tar.gz
Fix scripts (only those included in the generated bin) that depend on python2.
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD11
-rw-r--r--python3-ports.patch127
3 files changed, 138 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ee06752b516f..909dd163e34d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = folding
pkgdesc = Combined instrumentation and sampling for instantaneous metric evolution with low overhead (from BSC).
pkgver = 1.3.2
- pkgrel = 5
+ pkgrel = 6
url = https://www.bsc.es/discover-bsc/organisation/scientific-structure/performance-tools
arch = i686
arch = x86_64
@@ -12,7 +12,9 @@ pkgbase = folding
depends = r
depends = clang
source = https://ftp.tools.bsc.es/folding/folding-1.3.2-src.tar.bz2
+ source = python3-ports.patch
sha512sums = df54700a1eee506f7b7b8d08f74805d576d1455fe3e31de368d0a98bd3bc7114eef4c32d73462ac9cab2f5a9f273c27cc8538e9cfbf9b044c8ef66d3881a7f3d
+ sha512sums = f62af324cfe585605dbdfdb87fa7877cb794ba854c1445193710f22ce3cb92effcfcb7c6b8e32286f927bd0804478580b6358b62f15cba789359862bc0589aa1
pkgname = folding
diff --git a/PKGBUILD b/PKGBUILD
index d4f223067e16..975318aa97a8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,13 +2,15 @@
pkgname='folding'
pkgdesc='Combined instrumentation and sampling for instantaneous metric evolution with low overhead (from BSC).'
pkgver='1.3.2'
-pkgrel='5'
+pkgrel='6'
arch=('i686' 'x86_64')
url='https://www.bsc.es/discover-bsc/organisation/scientific-structure/performance-tools'
license=('GPL3')
depends=(boost qt5-base libbsctools r clang)
-source=("https://ftp.tools.bsc.es/$pkgname/$pkgname-$pkgver-src.tar.bz2")
-sha512sums=(df54700a1eee506f7b7b8d08f74805d576d1455fe3e31de368d0a98bd3bc7114eef4c32d73462ac9cab2f5a9f273c27cc8538e9cfbf9b044c8ef66d3881a7f3d)
+source=("https://ftp.tools.bsc.es/$pkgname/$pkgname-$pkgver-src.tar.bz2"
+ python3-ports.patch)
+sha512sums=(df54700a1eee506f7b7b8d08f74805d576d1455fe3e31de368d0a98bd3bc7114eef4c32d73462ac9cab2f5a9f273c27cc8538e9cfbf9b044c8ef66d3881a7f3d
+ f62af324cfe585605dbdfdb87fa7877cb794ba854c1445193710f22ce3cb92effcfcb7c6b8e32286f927bd0804478580b6358b62f15cba789359862bc0589aa1)
prepare() {
cd "$srcdir/$pkgname-$pkgver"
@@ -24,6 +26,9 @@ prepare() {
echo 'kriger_test_DEPENDENCIES = libkriger.la' >> 'src/interpolate/service-kriger/Makefile.am'
autoreconf -i -f -I config
+
+ # WORKAROUND: Fix some scripts that still only work with Python 2
+ patch -Np1 -i "$srcdir/python3-ports.patch"
}
build() {
diff --git a/python3-ports.patch b/python3-ports.patch
new file mode 100644
index 000000000000..0497d0cb445a
--- /dev/null
+++ b/python3-ports.patch
@@ -0,0 +1,127 @@
+diff --git a/others/basicblocks.C.py b/others/basicblocks.C.py
+index 5428fb4..8d06519 100755
+--- a/others/basicblocks.C.py
++++ b/others/basicblocks.C.py
+@@ -1,6 +1,5 @@
+ #!/usr/bin/env python
+
+-import exceptions;
+ import sys;
+ import re;
+ import os;
+@@ -8,7 +7,7 @@ import os;
+ def tonum (s):
+ try:
+ return int(s)
+- except exceptions.ValueError:
++ except ValueError:
+ return int(0)
+
+ def decode1(line, what):
+@@ -27,7 +26,7 @@ def decode2(line, what1, what2):
+
+ envvars = os.environ
+ if not ('FOLDING_CLANG_BIN' in envvars):
+- print "Cannot obtain clang binary through FOLDING_CLANG_BIN env variable";
++ print("Cannot obtain clang binary through FOLDING_CLANG_BIN env variable");
+ os._exit(1)
+
+ CLANGBIN = envvars['FOLDING_CLANG_BIN'];
+@@ -62,6 +61,6 @@ if maxline > 0:
+ if len(lines) > 0:
+ s = sorted(lines)
+ for r in s:
+- print r;
++ print(r);
+
+
+diff --git a/others/basicblocks.F90.py b/others/basicblocks.F90.py
+index 0f38b7a..90a9e28 100755
+--- a/others/basicblocks.F90.py
++++ b/others/basicblocks.F90.py
+@@ -40,6 +40,6 @@ if currentline > 0:
+ if len(lines) > 0:
+ s = sorted(lines)
+ for r in s:
+- print r;
++ print(r);
+
+
+diff --git a/others/folding-gnuplot-compare.py b/others/folding-gnuplot-compare.py
+index e4cdc2e..5e98af4 100755
+--- a/others/folding-gnuplot-compare.py
++++ b/others/folding-gnuplot-compare.py
+@@ -1,6 +1,5 @@
+ #!/usr/bin/env python
+
+-import exceptions;
+ import sys;
+ import re;
+ import os;
+@@ -8,7 +7,7 @@ import os;
+ def tofloat (s):
+ try:
+ return float(s)
+- except exceptions.ValueError:
++ except ValueError:
+ return float(0)
+
+ contents = {}
+@@ -19,7 +18,7 @@ pX_LIMIT = re.compile ("^X_LIMIT=.* # Do not touch this");
+ pFACTOR = re.compile ("^FACTOR=.* # Do not touch this");
+
+ if len (sys.argv) < 2:
+- print 'Error! Command ' + sys.argv[0] + ' requires multiple gnuplots as a paremeter'
++ print('Error! Command ' + sys.argv[0] + ' requires multiple gnuplots as a paremeter')
+ sys.exit (-1)
+
+ elif len (sys.argv) >= 2:
+@@ -46,33 +45,33 @@ elif len (sys.argv) >= 2:
+ if durations[f] > maxduration:
+ maxduration = durations[f]
+ if not found:
+- print 'Error! File '+f+' does not contain X_LIMIT';
++ print('Error! File '+f+' does not contain X_LIMIT');
+ dsys.exit (-1);
+
+ # Generate the output combined file
+
+ # Emit header first
+- print "# set term postscript eps solid color size 3,", str (1.5*(len(sys.argv)-1))
+- print "# set term pdfcairo solid color lw 2 font \",9\" size 3,", str (1.5*(len(sys.argv)-1))
+- print "# set term png size 800,",str(300*(len(sys.argv)-1))
+- print "# set term x11 size 800,",str(300*(len(sys.argv)-1))
+- print "# set term wxt size 800,",str(300*(len(sys.argv)-1))
+- print ""
+- print "set multiplot layout ",str(len(sys.argv)-1), ",1"
+- print ""
++ print("# set term postscript eps solid color size 3,", str (1.5*(len(sys.argv)-1)))
++ print("# set term pdfcairo solid color lw 2 font \",9\" size 3,", str (1.5*(len(sys.argv)-1)))
++ print("# set term png size 800,",str(300*(len(sys.argv)-1)))
++ print("# set term x11 size 800,",str(300*(len(sys.argv)-1)))
++ print("# set term wxt size 800,",str(300*(len(sys.argv)-1)))
++ print("")
++ print("set multiplot layout ",str(len(sys.argv)-1), ",1")
++ print("")
+
+ # Emit bodies after
+ for f in sys.argv[1:]:
+- print ""
+- print "# Contents of file "+f
+- print ""
++ print("")
++ print("# Contents of file "+f)
++ print("")
+ lines = contents[f]
+ for l in lines:
+ if pFACTOR.match(l):
+- print "FACTOR="+str(durations[f])+"/"+str(maxduration)+ " # Do not touch this"
++ print("FACTOR="+str(durations[f])+"/"+str(maxduration)+ " # Do not touch this")
+ else:
+- print l.strip()
++ print(l.strip())
+
+ # Finish multiplot
+- print "unset multiplot;"
++ print("unset multiplot;")
+