commit:     0cbc3ec0b9eca21c6f131185031f5d7400105cb2
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Thu Mar 24 20:17:18 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 21 19:54:28 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cbc3ec0

x11-plugins/gkrellm-cpupower: update EAPI 6 -> 8

Besides the EAPI bump, include a patch for the Makefile to remove -O2
-Wall from compilation flags, and sets CC to $(CC).

Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/gkrellm-cpupower-0.2-makefile.patch      | 45 +++++++++++++++++++++
 .../gkrellm-cpupower-0.2-r2.ebuild                 | 47 ++++++++++++++++++++++
 2 files changed, 92 insertions(+)

diff --git 
a/x11-plugins/gkrellm-cpupower/files/gkrellm-cpupower-0.2-makefile.patch 
b/x11-plugins/gkrellm-cpupower/files/gkrellm-cpupower-0.2-makefile.patch
new file mode 100644
index 000000000000..3ec485c7bb18
--- /dev/null
+++ b/x11-plugins/gkrellm-cpupower/files/gkrellm-cpupower-0.2-makefile.patch
@@ -0,0 +1,45 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,22 +1,29 @@
+ # Makefile for gkrellm cpupower plugin
+ 
+-GTK_INCLUDE = `pkg-config gtk+-2.0 --cflags`
+-GTK_LIB = `pkg-config gtk+-2.0 --libs`
++PKG_CONFIG ?= pkg-config
+ 
+-FLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE)
++GTK_INCLUDE = $(shell ${PKG_CONFIG} gtk+-2.0 --cflags)
++GTK_LIB = $(shell ${PKG_CONFIG} gtk+-2.0 --libs)
++
++FLAGS = -fPIC $(GTK_INCLUDE)
+ LIBS = $(GTK_LIB)
+ 
+ LFLAGS = -shared -lcpupower
+ 
+-CC = gcc $(CFLAGS) $(FLAGS)
++CC = $(CC)
+ 
+ OBJS = cpupower.o
+ 
++all: cpupower.so
++
++%.o: %.c
++      $(CC) $(CFLAGS) $(FLAGS) -c -o $@ $<
++
+ cpupower.so: $(OBJS)
+-      $(CC) $(OBJS) -o cpupower.so $(LFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(FLAGS) $(OBJS) -o cpupower.so $(LFLAGS) 
$(LIBS)
+ 
+ install: cpupower.so
+-      install -D -m 755 -s cpupower.so 
$(DESTDIR)/usr/lib/gkrellm2/plugins/cpupower.so
++      install -D -m 755 cpupower.so 
$(DESTDIR)/usr/lib/gkrellm2/plugins/cpupower.so
+ 
+ install-sudo:
+       mkdir -p $(DESTDIR)/etc/sudoers.d
+@@ -25,6 +32,3 @@ install-sudo:
+ 
+ clean:
+       rm -f *.o core *.so* *.bak *~
+-
+-cpupower.o: cpupower.c
+-

diff --git a/x11-plugins/gkrellm-cpupower/gkrellm-cpupower-0.2-r2.ebuild 
b/x11-plugins/gkrellm-cpupower/gkrellm-cpupower-0.2-r2.ebuild
new file mode 100644
index 000000000000..ddb490d7448c
--- /dev/null
+++ b/x11-plugins/gkrellm-cpupower/gkrellm-cpupower-0.2-r2.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit gkrellm-plugin toolchain-funcs
+
+MY_P="${P/gkrellm/gkrellm2}"
+
+DESCRIPTION="A Gkrellm2 plugin for displaying and manipulating CPU frequency"
+HOMEPAGE="https://github.com/sainsaar/gkrellm2-cpupower/";
+SRC_URI="https://github.com/sainsaar/gkrellm2-cpupower/archive/${PV}.tar.gz -> 
${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="app-admin/gkrellm:2[X]"
+RDEPEND="
+       ${DEPEND}
+       app-admin/sudo
+       sys-power/cpupower"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-makefile.patch
+)
+
+src_compile() {
+       tc-export PKG_CONFIG
+       emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+       local PLUGIN_SO=( cpupower$(get_modname) )
+       gkrellm-plugin_src_install
+       emake DESTDIR="${D}" install-sudo
+}
+
+pkg_postinst() {
+       einfo
+       einfo "For changing the governor and CPU frequencies as a user, create 
the \"trusted\""
+       einfo "group, and add those users to that group who should be allowed 
to perform"
+       einfo "these changes."
+       einfo
+}

Reply via email to