From 61ce36d41de01d56f42f4daedf677050ce302a21 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Mon, 28 Jun 2021 10:45:12 +0200 Subject: sys-cluster/dlb: statically link tests Closes: https://bugs.gentoo.org/784698 Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Alessandro Barbieri --- sys-cluster/dlb/dlb-2.1-r1.ebuild | 75 -------------------- sys-cluster/dlb/dlb-2.1-r2.ebuild | 65 ++++++++++++++++++ sys-cluster/dlb/files/dlb-2.1-tkinter.patch | 102 ++++++++++++++++++++++++++++ 3 files changed, 167 insertions(+), 75 deletions(-) delete mode 100644 sys-cluster/dlb/dlb-2.1-r1.ebuild create mode 100644 sys-cluster/dlb/dlb-2.1-r2.ebuild create mode 100644 sys-cluster/dlb/files/dlb-2.1-tkinter.patch diff --git a/sys-cluster/dlb/dlb-2.1-r1.ebuild b/sys-cluster/dlb/dlb-2.1-r1.ebuild deleted file mode 100644 index b784405903..0000000000 --- a/sys-cluster/dlb/dlb-2.1-r1.ebuild +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{8..9} ) -PYTHON_REQ_USE="tk" - -inherit autotools python-single-r1 - -DESCRIPTION="Dynamically react to application imbalance by modifying the number of resources" -HOMEPAGE="https://github.com/bsc-pm/dlb" -SRC_URI="https://github.com/bsc-pm/dlb/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="LGPL-3" -SLOT="0" -KEYWORDS="~amd64" - -IUSE="hwloc instrumentation mpi openmp" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -DEPEND=" - hwloc? ( sys-apps/hwloc ) - mpi? ( virtual/mpi ) -" -RDEPEND=" - ${PYTHON_DEPS} - ${DEPEND} - dev-lang/tk - $(python_gen_cond_dep 'dev-python/matplotlib[tk,${PYTHON_USEDEP}]') -" - -PATCHES=( "${FILESDIR}/${P}-pygen-python3.patch" ) - -src_prepare() { - default - sed -e "s|chmod +x \$(|chmod +x ${ED}/\$(|g" -i Makefile.am || die - - # Python3 fixes - sed -e "s/Tkinter/tkinter/" \ - -e "s/import ttk/from tkinter import ttk/" \ - -e "s/import tkMessageBox/from tkinter import messagebox/" \ - -e "s/tkMessageBox/messagebox/g" \ - -i scripts/viewer/dlb_cpu_usage.in || die - - sed -e "s/Tkinter/tkinter/" \ - -e "s/import ttk/from tkinter import ttk/" \ - -e "s/, NavigationToolbar2TkAgg//" \ - -e "/FigureCanvasTkAgg$/a from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT" \ - -e "s/NavigationToolbar2TkAgg/NavigationToolbar2QT/g" \ - -i scripts/viewer/dlb_viewer.py.in || die - - sed -e "s|lib/|$(get_libdir)/|" -i scripts/viewer/dlb_wrapper.py || die - sed -e "s|Tkinter|tkinter|" -i scripts/viewer/progressmeter.py || die - - eautoreconf -} - -src_configure() { - local myconf=( - --disable-static - --enable-shared - --with-pic - $(use_enable instrumentation) - $(use_enable openmp) - $(use_with hwloc) - $(use_with mpi) - ) - econf "${myconf[@]}" -} - -src_install() { - default - find "${D}" -name '*.la' -delete || die -} diff --git a/sys-cluster/dlb/dlb-2.1-r2.ebuild b/sys-cluster/dlb/dlb-2.1-r2.ebuild new file mode 100644 index 0000000000..e9674f7bc8 --- /dev/null +++ b/sys-cluster/dlb/dlb-2.1-r2.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8..9} ) +PYTHON_REQ_USE="tk" + +inherit autotools python-single-r1 + +DESCRIPTION="Dynamically react to application imbalance by modifying the number of resources" +HOMEPAGE="https://github.com/bsc-pm/dlb" +SRC_URI="https://github.com/bsc-pm/dlb/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="LGPL-3" +SLOT="0" +KEYWORDS="~amd64" +IUSE="hwloc instrumentation mpi openmp test" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +RESTRICT="!test? ( test )" + +DEPEND=" + hwloc? ( sys-apps/hwloc ) + mpi? ( virtual/mpi ) +" +RDEPEND=" + ${PYTHON_DEPS} + ${DEPEND} + dev-lang/tk + $(python_gen_cond_dep 'dev-python/matplotlib[tk,${PYTHON_USEDEP}]') +" +BDEPEND="test? ( sys-devel/bc )" + +PATCHES=( + "${FILESDIR}/${P}-pygen-python3.patch" + "${FILESDIR}/${P}-tkinter.patch" +) + +src_prepare() { + default + sed -e "s|chmod +x \$(|chmod +x ${ED}/\$(|g" -i Makefile.am || die + sed -e "s|lib/|$(get_libdir)/|" -i scripts/viewer/dlb_wrapper.py || die + + eautoreconf +} + +src_configure() { + local myconf=( + --enable-shared + --with-pic + $(use_enable instrumentation) + $(use_enable openmp) + $(use_enable test static) + $(use_with hwloc) + $(use_with mpi) + ) + econf "${myconf[@]}" +} + +src_install() { + default + find "${D}" -name '*.la' -delete || die + find "${D}" -name '*.a' -delete || die +} diff --git a/sys-cluster/dlb/files/dlb-2.1-tkinter.patch b/sys-cluster/dlb/files/dlb-2.1-tkinter.patch new file mode 100644 index 0000000000..37f5783d7b --- /dev/null +++ b/sys-cluster/dlb/files/dlb-2.1-tkinter.patch @@ -0,0 +1,102 @@ +--- a/scripts/viewer/dlb_cpu_usage.in ++++ b/scripts/viewer/dlb_cpu_usage.in +@@ -1,8 +1,8 @@ + #!/usr/bin/env python2 + +-import Tkinter as tk +-import ttk +-import tkMessageBox ++import tkinter as tk ++from tkinter import ttk ++from tkinter import messagebox + import random + + import sys +@@ -46,7 +46,7 @@ + + def start(self): + if self.viewer.empty(): +- tkMessageBox.showinfo("Warning", "Add some process before starting") ++ messagebox.showinfo("Warning", "Add some process before starting") + if self.viewer: + self.viewer.start() + +--- a/scripts/viewer/dlb_viewer.py.in ++++ b/scripts/viewer/dlb_viewer.py.in +@@ -3,11 +3,12 @@ + import time + from collections import deque + # GUI +-import Tkinter as tk +-import ttk ++import tkinter as tk ++from tkinter import ttk + import progressmeter + from matplotlib.figure import Figure, figaspect +-from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg ++from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg ++from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT + #DLB + import dlb_wrapper + +@@ -39,7 +40,7 @@ + self.canvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=1) + + if self.debug: +- self.toolbar = NavigationToolbar2TkAgg(self.canvas, self ) ++ self.toolbar = NavigationToolbar2QT(self.canvas, self ) + self.toolbar.pack() + self.toolbar.update() + +--- a/scripts/viewer/progressmeter.py ++++ b/scripts/viewer/progressmeter.py +@@ -1,10 +1,10 @@ + #!/usr/bin/env python2 + + '''Michael Lange +-The Meter class provides a simple progress bar widget for Tkinter. ++The Meter class provides a simple progress bar widget for tkinter. + + INITIALIZATION OPTIONS: +-The widget accepts all options of a Tkinter.Frame plus the following: ++The widget accepts all options of a tkinter.Frame plus the following: + + fillcolor -- the color that is used to indicate the progress of the + corresponding process; default is "orchid1". +@@ -18,22 +18,22 @@ + textcolor -- the color to use for the widget's text; default is "black". + + WIDGET METHODS: +-All methods of a Tkinter.Frame can be used; additionally there are two widget specific methods: ++All methods of a tkinter.Frame can be used; additionally there are two widget specific methods: + + get() -- returns a tuple of the form (value, text) + set(value, text) -- updates the widget's value and the displayed text; + if value is omitted it defaults to 0.0 , text defaults to None . + ''' + +-import Tkinter ++import tkinter + +-class Meter(Tkinter.Frame): ++class Meter(tkinter.Frame): + def __init__(self, master, width=300, height=20, bg='white', fillcolor='orchid1',\ + value=0.0, text=None, font=None, textcolor='black', *args, **kw): +- Tkinter.Frame.__init__(self, master, bg=bg, width=width, height=height, *args, **kw) ++ tkinter.Frame.__init__(self, master, bg=bg, width=width, height=height, *args, **kw) + self._value = value + +- self._canv = Tkinter.Canvas(self, bg=self['bg'], width=self['width'], height=self['height'],\ ++ self._canv = tkinter.Canvas(self, bg=self['bg'], width=self['width'], height=self['height'],\ + highlightthickness=0, relief='flat', bd=0) + self._canv.pack(fill='both', expand=1) + self._rect = self._canv.create_rectangle(0, 0, 0, self._canv.winfo_reqheight(), fill=fillcolor,\ +@@ -84,7 +84,7 @@ + meter.set(value, 'Demo successfully finished') + + if __name__ == '__main__': +- root = Tkinter.Tk(className='meter demo') ++ root = tkinter.Tk(className='meter demo') + m = Meter(root, relief='ridge', bd=3) + m.pack(fill='x') + m.set(0.0, 'Starting demo...') -- cgit v1.2.3-65-gdbad