From a2681af0b36d464957900e37987dc4a30bd471d3 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Fri, 22 Jun 2012 12:26:01 -0400 Subject: [PATCH] extra/cpufrequtils to 008-2 --- .../0001-Only-x86-has-cpuid-instruction.patch | 34 +++++++++++++++ extra/cpufrequtils/PKGBUILD | 43 +++++++++++-------- 2 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 extra/cpufrequtils/0001-Only-x86-has-cpuid-instruction.patch diff --git a/extra/cpufrequtils/0001-Only-x86-has-cpuid-instruction.patch b/extra/cpufrequtils/0001-Only-x86-has-cpuid-instruction.patch new file mode 100644 index 000000000..d3bc14d51 --- /dev/null +++ b/extra/cpufrequtils/0001-Only-x86-has-cpuid-instruction.patch @@ -0,0 +1,34 @@ +From f1b6bccf08f53295b2f7f448f28bbd37533c14a2 Mon Sep 17 00:00:00 2001 +From: Zhang Le +Date: Sun, 18 Jul 2010 02:05:28 +0800 +Subject: [PATCH 1/8] Only x86 has cpuid instruction + +Signed-off-by: Zhang Le +Signed-off-by: Dominik Brodowski +--- + utils/aperf.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/utils/aperf.c b/utils/aperf.c +index 627fb17..1c64501 100644 +--- a/utils/aperf.c ++++ b/utils/aperf.c +@@ -68,11 +68,15 @@ struct avg_perf_cpu_info + + static int cpu_has_effective_freq() + { ++#if defined(__i386__) || defined(__x86_64__) + /* largest base level */ + if (cpuid_eax(0) < 6) + return 0; + + return cpuid_ecx(6) & 0x1; ++#else ++ return 0; ++#endif + } + + /* +-- +1.7.10 + diff --git a/extra/cpufrequtils/PKGBUILD b/extra/cpufrequtils/PKGBUILD index 52f965537..a4e91784c 100644 --- a/extra/cpufrequtils/PKGBUILD +++ b/extra/cpufrequtils/PKGBUILD @@ -1,37 +1,42 @@ -# $Id: PKGBUILD 85780 2010-07-19 14:39:52Z kevin $ +# $Id: PKGBUILD 149475 2012-02-08 09:53:00Z pierre $ # Maintainer: kevin # Contributor: phrakture # Contributor: SpepS -# ALARM: Kevin Mihelich -# - no changes, this older version works with ARM though - -plugrel=1 +# ALARM: Kevin Mihelich +# - patch to fix x86-only parts pkgname=cpufrequtils -pkgver=007 -pkgrel=1 +pkgver=008 +pkgrel=2 pkgdesc="Userspace tools for the kernel cpufreq subsystem" arch=('i686' 'x86_64') url="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html" license=('GPL') depends=('sysfsutils') backup=('etc/conf.d/cpufreq') -source=(http://www.kernel.org/pub/linux/utils/kernel/cpufreq/${pkgname}-${pkgver}.tar.bz2 - cpufreq.rcd - cpufreq.confd) -options=(!libtool !distcc !ccache) -md5sums=('fdd833ce70a9ae40ae8bce5b18f2becf' +source=("ftp://ftp.archlinux.org/other/${pkgname}/${pkgname}-${pkgver}.tar.bz2" + 'cpufreq.rcd' + 'cpufreq.confd' + '0001-Only-x86-has-cpuid-instruction.patch') +options=('!libtool' '!makeflags') +md5sums=('c59b71c044d463896f3247e8dd83dd7e' '7f2b5085df44d2df3e7c2d0b9f6dab08' - 'baae1f2abffc6bef2bd32a8dd8263c09') + 'baae1f2abffc6bef2bd32a8dd8263c09' + '9ed71a50670aa99e12245cb3f5199142') -build() -{ +build() { cd "${srcdir}/${pkgname}-${pkgver}" - make -j1 || return 1 - make INSTALL="/bin/install -c" mandir=/usr/share/man DESTDIR="${pkgdir}" install || return 1 + patch -p1 -i "${srcdir}/0001-Only-x86-has-cpuid-instruction.patch" - install -D -m755 ${srcdir}/cpufreq.rcd "${pkgdir}/etc/rc.d/cpufreq" || return 1 - install -D -m644 ${srcdir}/cpufreq.confd "${pkgdir}/etc/conf.d/cpufreq" || return 1 + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make INSTALL="/usr/bin/install -c" mandir=/usr/share/man DESTDIR="${pkgdir}" install + + install -D -m755 ${srcdir}/cpufreq.rcd "${pkgdir}/etc/rc.d/cpufreq" + install -D -m644 ${srcdir}/cpufreq.confd "${pkgdir}/etc/conf.d/cpufreq" }