Date: Saturday, February 11, 2023 @ 13:52:36
Author: bgyorgy
Revision: 1399813
archrelease: copy trunk to community-x86_64
Added:
cpulimit/repos/community-x86_64/0000-fix-includes.patch
(from rev 1399812, cpulimit/trunk/0000-fix-includes.patch)
cpulimit/repos/community-x86_64/PKGBUILD
(from rev 1399812, cpulimit/trunk/PKGBUILD)
Deleted:
cpulimit/repos/community-x86_64/PKGBUILD
-------------------------+
0000-fix-includes.patch | 67 ++++++++++++++++++++++++++++++++++++++++++++++
PKGBUILD | 59 +++++++++++++++++++---------------------
2 files changed, 96 insertions(+), 30 deletions(-)
Copied: cpulimit/repos/community-x86_64/0000-fix-includes.patch (from rev
1399812, cpulimit/trunk/0000-fix-includes.patch)
===================================================================
--- 0000-fix-includes.patch (rev 0)
+++ 0000-fix-includes.patch 2023-02-11 13:52:36 UTC (rev 1399813)
@@ -0,0 +1,67 @@
+diff -r -U4
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/src/cpulimit.c
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/src/cpulimit.c
+--- cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/src/cpulimit.c
2015-06-17 08:46:59.000000000 +0200
++++ cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/src/cpulimit.c
2020-11-23 16:48:41.094970897 +0100
+@@ -25,8 +25,11 @@
+ *
+ * Get the latest version at: http://github.com/opsengine/cpulimit
+ *
+ */
++#ifdef __linux__
++#define _GNU_SOURCE
++#endif
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+@@ -37,14 +40,19 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
+-#include <sys/sysctl.h>
+ #include <sys/resource.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+
+-#ifdef __APPLE__ || __FREEBSD__
++#ifdef __linux__
++#include <linux/sysctl.h>
++#else
++#include <sys/sysctl.h>
++#endif
++
++#if defined(__APPLE__) || defined(__FREEBSD__) || defined(__linux__)
+ #include <libgen.h>
+ #endif
+
+ #include "process_group.h"
+diff -r -U4
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/src/process_group.c
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/src/process_group.c
+---
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/src/process_group.c
2015-06-17 08:46:59.000000000 +0200
++++
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/src/process_group.c
2020-11-23 16:45:41.423515953 +0100
+@@ -24,8 +24,12 @@
+ #include <limits.h>
+ #include <sys/time.h>
+ #include <signal.h>
+
++#if defined(__APPLE__) || defined(__FREEBSD__) || defined(__linux__)
++#include <libgen.h>
++#endif
++
+ #include <assert.h>
+
+ #include "process_iterator.h"
+ #include "process_group.h"
+diff -r -U4
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/tests/process_iterator_test.c
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/tests/process_iterator_test.c
+---
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--orig/tests/process_iterator_test.c
2015-06-17 08:46:59.000000000 +0200
++++
cpulimit-f4d2682804931e7aea02a869137344bb5452a3cd--patched/tests/process_iterator_test.c
2020-11-23 16:44:38.051362981 +0100
+@@ -27,9 +27,9 @@
+ #include <time.h>
+ #include <signal.h>
+ #include <string.h>
+
+-#ifdef __APPLE__ || __FREEBSD__
++#if defined(__APPLE__) || defined(__FREEBSD__) || defined(__linux__)
+ #include <libgen.h>
+ #endif
+
+ #include <process_iterator.h>
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2023-02-11 13:52:01 UTC (rev 1399812)
+++ PKGBUILD 2023-02-11 13:52:36 UTC (rev 1399813)
@@ -1,30 +0,0 @@
-# Maintainer: Balló György <ballogyor+arch at gmail dot com>
-# Contributor: Sergej Pupykin <[email protected]>
-
-pkgname=cpulimit
-pkgver=0.2
-pkgrel=2
-epoch=1
-pkgdesc="Limit cpu usage of a process in percentage. Actually sends
SIGSTOP/SIGCONT POSIX signals to processes"
-arch=('x86_64')
-url="https://github.com/opsengine/cpulimit"
-license=('GPL')
-depends=('glibc')
-source=($pkgname-$pkgver.tar.gz::https://github.com/opsengine/$pkgname/archive/v$pkgver.tar.gz)
-sha256sums=('64312f9ac569ddcadb615593cd002c94b76e93a0d4625d3ce1abb49e08e2c2da')
-
-prepare() {
- cd $pkgname-$pkgver
- sed -i 's/#ifdef __APPLE__ || __FREEBSD__/#if defined(__APPLE__) ||
defined(__FREEBSD__)/' \
- src/cpulimit.c tests/process_iterator_test.c
-}
-
-build() {
- cd $pkgname-$pkgver
- make
-}
-
-package() {
- cd $pkgname-$pkgver
- install -Dm755 src/cpulimit "$pkgdir/usr/bin/cpulimit"
-}
Copied: cpulimit/repos/community-x86_64/PKGBUILD (from rev 1399812,
cpulimit/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2023-02-11 13:52:36 UTC (rev 1399813)
@@ -0,0 +1,29 @@
+# Contributor: Balló György <ballogyor+arch at gmail dot com>
+# Contributor: Sergej Pupykin <[email protected]>
+
+pkgname=cpulimit
+pkgver=0.2
+pkgrel=3
+epoch=1
+pkgdesc="Limit cpu usage of a process in percentage. Actually sends
SIGSTOP/SIGCONT POSIX signals to processes"
+arch=('x86_64')
+url='https://github.com/opsengine/cpulimit'
+license=('GPL')
+depends=('glibc')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/opsengine/$pkgname/archive/v$pkgver.tar.gz"
+ '0000-fix-includes.patch')
+sha256sums=('64312f9ac569ddcadb615593cd002c94b76e93a0d4625d3ce1abb49e08e2c2da'
+ 'b3255614bf8b190cc8b4b80b287fee955096da801c9897c586fda732ff7c863b')
+
+prepare() {
+ patch -d $pkgname-$pkgver -Np1 -i ../0000-fix-includes.patch
+ sed -i 's/$(CFLAGS)/$(CFLAGS) $(LDFLAGS)/' $pkgname-$pkgver/*/Makefile
+}
+
+build() {
+ make -C $pkgname-$pkgver
+}
+
+package() {
+ install -Dm755 $pkgname-$pkgver/src/cpulimit "$pkgdir/usr/bin/cpulimit"
+}