Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:master commit in: sys-cluster/dlb/files/, sys-cluster/dlb/
Date: Mon, 28 Jun 2021 10:59:10
Message-Id: 1624870072.61ce36d41de01d56f42f4daedf677050ce302a21.flow@gentoo
1 commit: 61ce36d41de01d56f42f4daedf677050ce302a21
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Mon Jun 28 08:45:12 2021 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 28 08:47:52 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=61ce36d4
7
8 sys-cluster/dlb: statically link tests
9
10 Closes: https://bugs.gentoo.org/784698
11 Package-Manager: Portage-3.0.20, Repoman-3.0.3
12 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
13
14 .../dlb/{dlb-2.1-r1.ebuild => dlb-2.1-r2.ebuild} | 28 ++----
15 sys-cluster/dlb/files/dlb-2.1-tkinter.patch | 102 +++++++++++++++++++++
16 2 files changed, 111 insertions(+), 19 deletions(-)
17
18 diff --git a/sys-cluster/dlb/dlb-2.1-r1.ebuild b/sys-cluster/dlb/dlb-2.1-r2.ebuild
19 similarity index 60%
20 rename from sys-cluster/dlb/dlb-2.1-r1.ebuild
21 rename to sys-cluster/dlb/dlb-2.1-r2.ebuild
22 index b78440590..e9674f7bc 100644
23 --- a/sys-cluster/dlb/dlb-2.1-r1.ebuild
24 +++ b/sys-cluster/dlb/dlb-2.1-r2.ebuild
25 @@ -15,9 +15,10 @@ SRC_URI="https://github.com/bsc-pm/dlb/archive/v${PV}.tar.gz -> ${P}.tar.gz"
26 LICENSE="LGPL-3"
27 SLOT="0"
28 KEYWORDS="~amd64"
29 +IUSE="hwloc instrumentation mpi openmp test"
30
31 -IUSE="hwloc instrumentation mpi openmp"
32 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
33 +RESTRICT="!test? ( test )"
34
35 DEPEND="
36 hwloc? ( sys-apps/hwloc )
37 @@ -29,40 +30,28 @@ RDEPEND="
38 dev-lang/tk
39 $(python_gen_cond_dep 'dev-python/matplotlib[tk,${PYTHON_USEDEP}]')
40 "
41 +BDEPEND="test? ( sys-devel/bc )"
42
43 -PATCHES=( "${FILESDIR}/${P}-pygen-python3.patch" )
44 +PATCHES=(
45 + "${FILESDIR}/${P}-pygen-python3.patch"
46 + "${FILESDIR}/${P}-tkinter.patch"
47 +)
48
49 src_prepare() {
50 default
51 sed -e "s|chmod +x \$(|chmod +x ${ED}/\$(|g" -i Makefile.am || die
52 -
53 - # Python3 fixes
54 - sed -e "s/Tkinter/tkinter/" \
55 - -e "s/import ttk/from tkinter import ttk/" \
56 - -e "s/import tkMessageBox/from tkinter import messagebox/" \
57 - -e "s/tkMessageBox/messagebox/g" \
58 - -i scripts/viewer/dlb_cpu_usage.in || die
59 -
60 - sed -e "s/Tkinter/tkinter/" \
61 - -e "s/import ttk/from tkinter import ttk/" \
62 - -e "s/, NavigationToolbar2TkAgg//" \
63 - -e "/FigureCanvasTkAgg$/a from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT" \
64 - -e "s/NavigationToolbar2TkAgg/NavigationToolbar2QT/g" \
65 - -i scripts/viewer/dlb_viewer.py.in || die
66 -
67 sed -e "s|lib/|$(get_libdir)/|" -i scripts/viewer/dlb_wrapper.py || die
68 - sed -e "s|Tkinter|tkinter|" -i scripts/viewer/progressmeter.py || die
69
70 eautoreconf
71 }
72
73 src_configure() {
74 local myconf=(
75 - --disable-static
76 --enable-shared
77 --with-pic
78 $(use_enable instrumentation)
79 $(use_enable openmp)
80 + $(use_enable test static)
81 $(use_with hwloc)
82 $(use_with mpi)
83 )
84 @@ -72,4 +61,5 @@ src_configure() {
85 src_install() {
86 default
87 find "${D}" -name '*.la' -delete || die
88 + find "${D}" -name '*.a' -delete || die
89 }
90
91 diff --git a/sys-cluster/dlb/files/dlb-2.1-tkinter.patch b/sys-cluster/dlb/files/dlb-2.1-tkinter.patch
92 new file mode 100644
93 index 000000000..37f5783d7
94 --- /dev/null
95 +++ b/sys-cluster/dlb/files/dlb-2.1-tkinter.patch
96 @@ -0,0 +1,102 @@
97 +--- a/scripts/viewer/dlb_cpu_usage.in
98 ++++ b/scripts/viewer/dlb_cpu_usage.in
99 +@@ -1,8 +1,8 @@
100 + #!/usr/bin/env python2
101 +
102 +-import Tkinter as tk
103 +-import ttk
104 +-import tkMessageBox
105 ++import tkinter as tk
106 ++from tkinter import ttk
107 ++from tkinter import messagebox
108 + import random
109 +
110 + import sys
111 +@@ -46,7 +46,7 @@
112 +
113 + def start(self):
114 + if self.viewer.empty():
115 +- tkMessageBox.showinfo("Warning", "Add some process before starting")
116 ++ messagebox.showinfo("Warning", "Add some process before starting")
117 + if self.viewer:
118 + self.viewer.start()
119 +
120 +--- a/scripts/viewer/dlb_viewer.py.in
121 ++++ b/scripts/viewer/dlb_viewer.py.in
122 +@@ -3,11 +3,12 @@
123 + import time
124 + from collections import deque
125 + # GUI
126 +-import Tkinter as tk
127 +-import ttk
128 ++import tkinter as tk
129 ++from tkinter import ttk
130 + import progressmeter
131 + from matplotlib.figure import Figure, figaspect
132 +-from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
133 ++from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
134 ++from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT
135 + #DLB
136 + import dlb_wrapper
137 +
138 +@@ -39,7 +40,7 @@
139 + self.canvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=1)
140 +
141 + if self.debug:
142 +- self.toolbar = NavigationToolbar2TkAgg(self.canvas, self )
143 ++ self.toolbar = NavigationToolbar2QT(self.canvas, self )
144 + self.toolbar.pack()
145 + self.toolbar.update()
146 +
147 +--- a/scripts/viewer/progressmeter.py
148 ++++ b/scripts/viewer/progressmeter.py
149 +@@ -1,10 +1,10 @@
150 + #!/usr/bin/env python2
151 +
152 + '''Michael Lange <klappnase (at) freakmail (dot) de>
153 +-The Meter class provides a simple progress bar widget for Tkinter.
154 ++The Meter class provides a simple progress bar widget for tkinter.
155 +
156 + INITIALIZATION OPTIONS:
157 +-The widget accepts all options of a Tkinter.Frame plus the following:
158 ++The widget accepts all options of a tkinter.Frame plus the following:
159 +
160 + fillcolor -- the color that is used to indicate the progress of the
161 + corresponding process; default is "orchid1".
162 +@@ -18,22 +18,22 @@
163 + textcolor -- the color to use for the widget's text; default is "black".
164 +
165 + WIDGET METHODS:
166 +-All methods of a Tkinter.Frame can be used; additionally there are two widget specific methods:
167 ++All methods of a tkinter.Frame can be used; additionally there are two widget specific methods:
168 +
169 + get() -- returns a tuple of the form (value, text)
170 + set(value, text) -- updates the widget's value and the displayed text;
171 + if value is omitted it defaults to 0.0 , text defaults to None .
172 + '''
173 +
174 +-import Tkinter
175 ++import tkinter
176 +
177 +-class Meter(Tkinter.Frame):
178 ++class Meter(tkinter.Frame):
179 + def __init__(self, master, width=300, height=20, bg='white', fillcolor='orchid1',\
180 + value=0.0, text=None, font=None, textcolor='black', *args, **kw):
181 +- Tkinter.Frame.__init__(self, master, bg=bg, width=width, height=height, *args, **kw)
182 ++ tkinter.Frame.__init__(self, master, bg=bg, width=width, height=height, *args, **kw)
183 + self._value = value
184 +
185 +- self._canv = Tkinter.Canvas(self, bg=self['bg'], width=self['width'], height=self['height'],\
186 ++ self._canv = tkinter.Canvas(self, bg=self['bg'], width=self['width'], height=self['height'],\
187 + highlightthickness=0, relief='flat', bd=0)
188 + self._canv.pack(fill='both', expand=1)
189 + self._rect = self._canv.create_rectangle(0, 0, 0, self._canv.winfo_reqheight(), fill=fillcolor,\
190 +@@ -84,7 +84,7 @@
191 + meter.set(value, 'Demo successfully finished')
192 +
193 + if __name__ == '__main__':
194 +- root = Tkinter.Tk(className='meter demo')
195 ++ root = tkinter.Tk(className='meter demo')
196 + m = Meter(root, relief='ridge', bd=3)
197 + m.pack(fill='x')
198 + m.set(0.0, 'Starting demo...')