From 5b969d2f70330dedd3a92aabf80cf9e13bdd84a3 Mon Sep 17 00:00:00 2001 From: Dawid Potocki Date: Mon, 11 May 2020 22:22:13 +1200 Subject: [PATCH] New package: throttled-0.7 --- srcpkgs/throttled/files/lenovo_fix/run | 2 ++ srcpkgs/throttled/patches/setup.py.patch | 14 ++++++++++++ srcpkgs/throttled/template | 27 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100755 srcpkgs/throttled/files/lenovo_fix/run create mode 100644 srcpkgs/throttled/patches/setup.py.patch create mode 100644 srcpkgs/throttled/template diff --git a/srcpkgs/throttled/files/lenovo_fix/run b/srcpkgs/throttled/files/lenovo_fix/run new file mode 100755 index 00000000000..023a31de07b --- /dev/null +++ b/srcpkgs/throttled/files/lenovo_fix/run @@ -0,0 +1,2 @@ +#!/bin/sh +PYTHONUNBUFFERED=1 exec python3 @PATH@/lenovo_fix/lenovo_fix.py diff --git a/srcpkgs/throttled/patches/setup.py.patch b/srcpkgs/throttled/patches/setup.py.patch new file mode 100644 index 00000000000..a98a5db78d1 --- /dev/null +++ b/srcpkgs/throttled/patches/setup.py.patch @@ -0,0 +1,14 @@ +--- /dev/null ++++ setup.py +@@ -0,0 +1,11 @@ ++from setuptools import setup ++ ++setup( ++ name='lenovo_fix', ++ version='@VERSION@', ++ description='Workaround for Intel throttling issues in Linux', ++ author='Francesco Palmarini', ++ author_email='palmarini@unive.it', ++ url='https://github.com/erpalma/throttled', ++ license='MIT', ++) diff --git a/srcpkgs/throttled/template b/srcpkgs/throttled/template new file mode 100644 index 00000000000..2446ad11b88 --- /dev/null +++ b/srcpkgs/throttled/template @@ -0,0 +1,27 @@ +# Template file for 'throttled' +pkgname=throttled +version=0.7 +revision=1 +build_style=python3-module +conf_files="/etc/lenovo_fix.conf" +hostmakedepends="python3-setuptools" +depends="python3-dbus python3-gobject" +short_desc="Workaround for Intel throttling issues in Linux" +maintainer="Dawid Potocki " +license="MIT" +homepage="https://github.com/erpalma/throttled" +distfiles="https://github.com/erpalma/throttled/archive/v${version}.tar.gz" +checksum=64f139b3fd6f13381105f30ed4598faa69e59bfd613d26dfde29f46578b0b2a1 + +pre_build() { + sed -i "s/@VERSION@/${version}/" setup.py +} + +post_install() { + vinstall mmio.py 644 ${py3_sitelib}/lenovo_fix mmio.py + vinstall lenovo_fix.py 644 ${py3_sitelib}/lenovo_fix lenovo_fix.py + vconf etc/lenovo_fix.conf + vsv lenovo_fix + sed -i "s|@PATH@|${py3_sitelib}|" ${DESTDIR}/etc/sv/lenovo_fix/run + vlicense LICENSE +}