Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-plugins/gkrellfire/, x11-plugins/gkrellfire/files/
Date: Fri, 26 Aug 2016 12:59:43
Message-Id: 1472216183.aaa3c4fb5ccab0619199d091a8bbf6b323a443ad.mjo@gentoo
1 commit: aaa3c4fb5ccab0619199d091a8bbf6b323a443ad
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 26 12:56:23 2016 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 26 12:56:23 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aaa3c4fb
7
8 x11-plugins/gkrellfire: new revision fixing CC and *FLAGS handling.
9
10 This new revision updates the ebuild to EAPI=6, and adds a patch that
11 rewrites the Makefile. The inspiration for the patch, and the new
12 ebuild itself were submitted by user Michael Mair-Keimberger.
13
14 In addition to fixing the CC, CFLAGS, and LDFLAGS handling, the new
15 ebuild adds a USE dependency on app-admin/gkrellm[X], which, in the
16 old EAPI, had to crash the eclass.
17
18 Gentoo-Bug: 335033
19
20 Package-Manager: portage-2.2.28
21
22 .../files/fix-CC-CFLAGS-LDFLAGS-handling.patch | 69 ++++++++++++++++++++++
23 x11-plugins/gkrellfire/gkrellfire-0.4.2-r1.ebuild | 25 ++++++++
24 2 files changed, 94 insertions(+)
25
26 diff --git a/x11-plugins/gkrellfire/files/fix-CC-CFLAGS-LDFLAGS-handling.patch b/x11-plugins/gkrellfire/files/fix-CC-CFLAGS-LDFLAGS-handling.patch
27 new file mode 100644
28 index 00000000..120f459
29 --- /dev/null
30 +++ b/x11-plugins/gkrellfire/files/fix-CC-CFLAGS-LDFLAGS-handling.patch
31 @@ -0,0 +1,69 @@
32 +From 822bb45acf93b63e59071903aad842a3dd92a915 Mon Sep 17 00:00:00 2001
33 +From: Michael Orlitzky <michael@××××××××.com>
34 +Date: Fri, 26 Aug 2016 08:43:12 -0400
35 +Subject: [PATCH 1/1] Rewrite the Makefile to fix CC, CFLAGS, and LDFLAGS
36 + support.
37 +
38 +The existing Makefile did not allow the user to set CC, CFLAGS, or
39 +LDFLAGS (or at least, they were ignored). This was fixed somewhat
40 +easily by deleting most of the Makefile, and by appending the
41 +necessary flags to CFLAGS and LDFLAGS. The installation target didn't
42 +do the right thing anyway, so it has been removed.
43 +
44 +The resulting Makefile is probably only useful on Gentoo, but upstream
45 +is long gone so maybe that's not a problem.
46 +
47 +Gentoo-Bug: 335033
48 +---
49 + Makefile | 34 +++++-----------------------------
50 + 1 file changed, 5 insertions(+), 29 deletions(-)
51 +
52 +diff --git a/Makefile b/Makefile
53 +index 7916cab..43a0527 100644
54 +--- a/Makefile
55 ++++ b/Makefile
56 +@@ -1,36 +1,12 @@
57 + GTK_INCLUDE = `pkg-config gtk+-2.0 --cflags`
58 + GTK_LIB = `pkg-config gtk+-2.0 --libs`
59 +
60 +-INSTALLDIR = /usr/lib/gkrellm2/plugins
61 +-
62 +-FLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE)
63 ++CFLAGS += -fPIC $(GTK_INCLUDE)
64 + LIBS = $(GTK_LIB)
65 +-LFLAGS = -shared
66 +-
67 +-CC = gcc
68 +-
69 +-OBJS = gkrellfire.o
70 +-
71 +-all: gkrellfire.so
72 +-
73 +-%.o: %.c
74 +- $(CC) $(CFLAGS) $(FLAGS) -c -o $@ $<
75 ++LDFLAGS += -shared
76 +
77 +-
78 +-gkrellfire.so: $(OBJS)
79 +- $(CC) $(CFLAGS) $(OBJS) -o gkrellfire.so $(LFLAGS) $(LIBS)
80 ++gkrellfire.so: gkrellfire.o
81 ++ $(CC) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
82 +
83 + clean:
84 +- rm -f *.o core *.so* *.bak *~
85 +-
86 +-gkrellfire.o: gkrellfire.c
87 +-
88 +-install:
89 +- if [ -d $(INSTALLDIR) ] ; then \
90 +- install -c -s -m 644 gkrellfire.so $(INSTALLDIR) ; \
91 +- else \
92 +- install -D -c -s -m 644 gkrellfire.so $(INSTALLDIR)/gkrellfire.so ; \
93 +- fi
94 +-
95 +-uninstall:
96 +- rm -f $(INSTALLDIR)/gkrellfire.so
97 ++ rm -f gkrellfire.*o
98 +--
99 +2.7.3
100 +
101
102 diff --git a/x11-plugins/gkrellfire/gkrellfire-0.4.2-r1.ebuild b/x11-plugins/gkrellfire/gkrellfire-0.4.2-r1.ebuild
103 new file mode 100644
104 index 00000000..a05889e
105 --- /dev/null
106 +++ b/x11-plugins/gkrellfire/gkrellfire-0.4.2-r1.ebuild
107 @@ -0,0 +1,25 @@
108 +# Copyright 1999-2016 Gentoo Foundation
109 +# Distributed under the terms of the GNU General Public License v2
110 +# $Id$
111 +
112 +EAPI=6
113 +
114 +inherit gkrellm-plugin toolchain-funcs
115 +
116 +DESCRIPTION="CPU load flames for GKrellM 2"
117 +HOMEPAGE="http://people.freenet.de/thomas-steinke"
118 +SRC_URI="ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${P}.tgz"
119 +
120 +LICENSE="GPL-2"
121 +SLOT="0"
122 +KEYWORDS="~amd64 ~x86"
123 +IUSE=""
124 +
125 +RDEPEND="app-admin/gkrellm[X]"
126 +DEPEND="${RDEPEND}"
127 +
128 +PATCHES=( "${FILESDIR}/fix-CC-CFLAGS-LDFLAGS-handling.patch" )
129 +
130 +src_compile() {
131 + emake CC="$(tc-getCC)"
132 +}