diff options
author | Azamat H. Hackimov <azamat.hackimov@gmail.com> | 2023-02-06 19:10:05 +0300 |
---|---|---|
committer | Conrad Kostecki <conikost@gentoo.org> | 2023-04-23 17:47:40 +0200 |
commit | 0fe5e537a744ac90cacd63babb2a4772da1fdb5a (patch) | |
tree | 510470789365f8747a7b6f5e4f122f9cd847f9a0 /app-admin/cpulimit | |
parent | dev-util/conan: drop 1.59.0, 2.0.0 (diff) | |
download | gentoo-0fe5e537a744ac90cacd63babb2a4772da1fdb5a.tar.gz gentoo-0fe5e537a744ac90cacd63babb2a4772da1fdb5a.tar.bz2 gentoo-0fe5e537a744ac90cacd63babb2a4772da1fdb5a.zip |
app-admin/cpulimit: add 2.8
Migrate to EAPI8, building and compilation fixes.
Closes: https://bugs.gentoo.org/686528
Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/29452
Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'app-admin/cpulimit')
-rw-r--r-- | app-admin/cpulimit/Manifest | 1 | ||||
-rw-r--r-- | app-admin/cpulimit/cpulimit-2.8.ebuild | 28 | ||||
-rw-r--r-- | app-admin/cpulimit/files/cpulimit-2.8-inline-func.patch | 11 | ||||
-rw-r--r-- | app-admin/cpulimit/files/cpulimit-2.8-makefile.patch | 25 |
4 files changed, 65 insertions, 0 deletions
diff --git a/app-admin/cpulimit/Manifest b/app-admin/cpulimit/Manifest index a4a54c346ec9..75403fa699be 100644 --- a/app-admin/cpulimit/Manifest +++ b/app-admin/cpulimit/Manifest @@ -1 +1,2 @@ DIST cpulimit-2.4.tar.gz 24669 BLAKE2B e0fe0d6766e76e6e2a68dcdc553039400233daabbb14ce4a9dae46a7b694d2ecd660f4c1d13f417a74b12365c719780c732a03bd91c6384d1e7118d0fce521fb SHA512 008dc3fbdcbd8afd875a2a1ce03d609db595c6e110803140c676d3713ea60f4877a1bb8e7aa0e8b669dce31522ad81e2703f616341a0f4cbc69a6b01865b66d0 +DIST cpulimit-2.8.tar.gz 24860 BLAKE2B 6d4002d2cbc46da9ce102da77b701e6a99c2e7d16e2e7989baa1e07ef335b126a8c717c4779d121aee1e580ebf057a16b4f83c1bc6a29c904a7532debc4c490a SHA512 aeb121739a5dc9f94c6ddb0905ed05eb7d146c9d0e71c34ba46aad798bda2c30b7ccc548338b4c468f9885f09d97a4565c00199c8df6af74dc9b6f23940c540e diff --git a/app-admin/cpulimit/cpulimit-2.8.ebuild b/app-admin/cpulimit/cpulimit-2.8.ebuild new file mode 100644 index 000000000000..a3d5dc9d8201 --- /dev/null +++ b/app-admin/cpulimit/cpulimit-2.8.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="Limits the CPU usage of a process" +HOMEPAGE="https://cpulimit.sourceforge.net" +SRC_URI="mirror://sourceforge/limitcpu/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~riscv ~x86" + +PATCHES=( + "${FILESDIR}/${P}-makefile.patch" + "${FILESDIR}/${P}-inline-func.patch" # Bug #686528 +) + +src_compile() { + emake CC=$(tc-getCC) +} + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install + dodoc CHANGELOG README +} diff --git a/app-admin/cpulimit/files/cpulimit-2.8-inline-func.patch b/app-admin/cpulimit/files/cpulimit-2.8-inline-func.patch new file mode 100644 index 000000000000..12b516223a01 --- /dev/null +++ b/app-admin/cpulimit/files/cpulimit-2.8-inline-func.patch @@ -0,0 +1,11 @@ +--- a/cpulimit.c 2023-02-06 19:07:19.450894524 +0300 ++++ b/cpulimit.c 2023-02-06 19:07:28.834337797 +0300 +@@ -125,7 +125,7 @@ + + + //return ta-tb in microseconds (no overflow checks!) +-inline long timediff(const struct timespec *ta,const struct timespec *tb) { ++static long timediff(const struct timespec *ta,const struct timespec *tb) { + unsigned long us = (ta->tv_sec-tb->tv_sec)*1000000 + (ta->tv_nsec/1000 - tb->tv_nsec/1000); + return us; + } diff --git a/app-admin/cpulimit/files/cpulimit-2.8-makefile.patch b/app-admin/cpulimit/files/cpulimit-2.8-makefile.patch new file mode 100644 index 000000000000..7daf8a7092ab --- /dev/null +++ b/app-admin/cpulimit/files/cpulimit-2.8-makefile.patch @@ -0,0 +1,25 @@ +--- a/Makefile 2023-02-06 18:47:21.311693323 +0300 ++++ b/Makefile 2023-02-06 18:48:23.392517904 +0300 +@@ -2,6 +2,7 @@ + PREFIX?=/usr + CFLAGS?=-Wall -O2 + CC?=clang ++DESTDIR= + + all: cpulimit + +@@ -21,10 +22,10 @@ + $(MAKE) -C test + + install: cpulimit +- mkdir -p ${PREFIX}/bin +- mkdir -p ${PREFIX}/share/man/man1 +- cp cpulimit ${PREFIX}/bin +- cp cpulimit.1 ${PREFIX}/share/man/man1 ++ mkdir -p ${DESTDIR}/${PREFIX}/bin ++ mkdir -p ${DESTDIR}/${PREFIX}/share/man/man1 ++ cp cpulimit ${DESTDIR}/${PREFIX}/bin ++ cp cpulimit.1 ${DESTDIR}/${PREFIX}/share/man/man1 + + deinstall: + rm -f ${PREFIX}/bin/cpulimit |