Source: gkrellm2-cpufreq
Version: 0.6.4-4
Tags: patch upstream
Usertags: rebootstrap

gkrellm2-cpufreq fails to cross build from source due to three bugs in
the upstream build system:
 * It stuffs CFLAGS into CC. So when overriding CC, one looses CFLAGS.
 * It uses the build architecture pkg-config for determining CFLAGS.
 * It uses install -s and thus the build architecture strip.

The attached patch fixes all of these issues and makes gkrellm2-cpufreq
cross build successfully. It also causes a -dbgsym package to be
generated as stripping is now deferred to dh_strip. Please consider
applying it.

Index: gkrellm2-cpufreq-0.6.4/Makefile
--- gkrellm2-cpufreq-0.6.4.orig/Makefile
+++ gkrellm2-cpufreq-0.6.4/Makefile
@@ -1,22 +1,23 @@
 # Makefile for gkrellm cpufreq plugin
-GTK_INCLUDE = `pkg-config gtk+-2.0 --cflags`
-GTK_LIB = `pkg-config gtk+-2.0 --libs`
+PKG_CONFIG ?= pkg-config
+GTK_INCLUDE = `$(PKG_CONFIG) gtk+-2.0 --cflags`
+GTK_LIB = `$(PKG_CONFIG) gtk+-2.0 --libs`
 LDFLAGS += -shared -lcpufreq
-CC = gcc $(CFLAGS) $(FLAGS)
+CC = gcc
 OBJS = cpufreq.o $(OBJS)
-	$(CC) $(OBJS) -o $(LDFLAGS) $(LIBS)
+	$(CC) $(CFLAGS) $(OBJS) -o $(LDFLAGS) $(LIBS)
-	install -D -m 755 -s $(DESTDIR)/usr/lib/gkrellm2/plugins/
+	install -D -m 755 $(DESTDIR)/usr/lib/gkrellm2/plugins/
 	install -g root -o root -D -m 755 cpufreqnextgovernor $(DESTDIR)/usr/sbin/cpufreqnextgovernor

Reply via email to