aboutsummaryrefslogtreecommitdiffstats
path: root/testing/cpupower
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-07-11 18:46:16 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2016-07-11 18:46:16 +0000
commitab89c3e0edc43f13ef18a9a06dac318dacad83d8 (patch)
tree1704ed57055156972b09998e93d8a5ce93ba9ae6 /testing/cpupower
parentee49a8451a1aded3ab2862643f420c4f3c8d2afe (diff)
downloadaports-ab89c3e0edc43f13ef18a9a06dac318dacad83d8.tar.bz2
aports-ab89c3e0edc43f13ef18a9a06dac318dacad83d8.tar.xz
testing/cpupower: fix build without nls
Diffstat (limited to 'testing/cpupower')
-rw-r--r--testing/cpupower/APKBUILD26
-rw-r--r--testing/cpupower/nls.patch71
2 files changed, 86 insertions, 11 deletions
diff --git a/testing/cpupower/APKBUILD b/testing/cpupower/APKBUILD
index 2b7ae05327..5556a3bf0f 100644
--- a/testing/cpupower/APKBUILD
+++ b/testing/cpupower/APKBUILD
@@ -10,24 +10,25 @@ pkgdesc="Linux kernel tool to examine and tune power saving related features of
url="http://www.kernel.org"
arch="all"
license="GPL2"
-depends_dev="pciutils-dev readline-dev gettext-dev"
+depends_dev="pciutils-dev readline-dev"
makedepends="$depends_dev bash linux-headers"
-subpackages="$pkgname-doc $pkgname-lang $pkgname-dev"
+subpackages="$pkgname-doc $pkgname-lang $pkgname-dev"
replaces="linux-tools-cpupower"
source="http://ftp.kernel.org/pub/linux/kernel/v4.x/linux-$pkgver.tar.xz
cpupower.initd
- cpupower.confd"
+ cpupower.confd
+ nls.patch
+ "
-_builddir="$srcdir"/linux-$pkgver
+builddir="$srcdir"/linux-$pkgver
build() {
- cd "$_builddir"/tools/power/cpupower
- CFLAGS="$CFLAGS -lintl" \
- make VERSION=$pkgver-$pkgrel
+ cd "$builddir"/tools/power/cpupower
+ make NLS=false VERSION=$pkgver-$pkgrel
}
package() {
- cd "$_builddir"/tools/power/cpupower
+ cd "$builddir"/tools/power/cpupower
make DESTDIR="$pkgdir" mandir="/usr/share/man" install || return 1
install -Dm755 "$srcdir"/$pkgname.initd \
@@ -38,10 +39,13 @@ package() {
md5sums="59e99c3bf5d495f1f95d26257962ca3e linux-4.4.14.tar.xz
209e4f95728bd7c7c4ba35c320683a9b cpupower.initd
-fc335236f7617b042066c6231d5c9b87 cpupower.confd"
+fc335236f7617b042066c6231d5c9b87 cpupower.confd
+7dc0db8ecffc644ecb5ceb0f9bba01a5 nls.patch"
sha256sums="5953ba12797160a68b1068378f826ddac8a298f8f3273876d3bd18222b0555f9 linux-4.4.14.tar.xz
bd7133303c9a0fc892267335b6fb371d6179c6f4251d7f360ae82d7d1f0b321f cpupower.initd
-9ab6f022d2b2948660decf5e383984e6ddb9e9e5e6e2761c3031378ddd87e947 cpupower.confd"
+9ab6f022d2b2948660decf5e383984e6ddb9e9e5e6e2761c3031378ddd87e947 cpupower.confd
+14348a34a8936bee6c287fc8d48d0d2db01768a8ade7b4df9716f249093d21a7 nls.patch"
sha512sums="c9d4f3e8949cfb715ff2fc4169a12938132f967ad509c154f5c8598c70ac14989364083f1ab29c2fbab120945363f1343f2a30819df9be53938d4ef43391dbc5 linux-4.4.14.tar.xz
97ecfeaaaa8efca7af585316b843bf7be885e88095bbdfbf52bc9a96b14dc862435482781e205ea022ab208978aaa4aabb317354fab890ed514a5088ae5045c8 cpupower.initd
-63cd12a4d8782198c71662e9205e346e064b65bae5e3e175b5bc43bdf7ec6ddf675b60349750afe3c37c8a925f9ae9a93530671821342581bd282a69e0773b8c cpupower.confd"
+63cd12a4d8782198c71662e9205e346e064b65bae5e3e175b5bc43bdf7ec6ddf675b60349750afe3c37c8a925f9ae9a93530671821342581bd282a69e0773b8c cpupower.confd
+41e48942786a253b74261aa860d049323f2084fa2f9fa9ab4bf5721dab100a9623bda46fec5dadd2f5d21051610ce7fdb918607bcb7f6b99552a2b39c8a70720 nls.patch"
diff --git a/testing/cpupower/nls.patch b/testing/cpupower/nls.patch
new file mode 100644
index 0000000000..85398b4cda
--- /dev/null
+++ b/testing/cpupower/nls.patch
@@ -0,0 +1,71 @@
+diff --git a/tools/power/cpupower/utils/cpupower-info.c b/tools/power/cpupower/utils/cpupower-info.c
+index 10299f2..b26cc08 100644
+--- a/tools/power/cpupower/utils/cpupower-info.c
++++ b/tools/power/cpupower/utils/cpupower-info.c
+@@ -41,8 +41,10 @@ int cmd_info(int argc, char **argv)
+ } params = {};
+ int ret = 0;
+
++#ifdef NLS
+ setlocale(LC_ALL, "");
+ textdomain(PACKAGE);
++#endif
+
+ /* parameter parsing */
+ while ((ret = getopt_long(argc, argv, "b", set_opts, NULL)) != -1) {
+diff --git a/tools/power/cpupower/utils/cpupower-set.c b/tools/power/cpupower/utils/cpupower-set.c
+index 3e6f374..a40b50d 100644
+--- a/tools/power/cpupower/utils/cpupower-set.c
++++ b/tools/power/cpupower/utils/cpupower-set.c
+@@ -43,8 +43,10 @@ int cmd_set(int argc, char **argv)
+ int perf_bias = 0;
+ int ret = 0;
+
++#ifdef NLS
+ setlocale(LC_ALL, "");
+ textdomain(PACKAGE);
++#endif
+
+ params.params = 0;
+ /* parameter parsing */
+diff --git a/tools/power/cpupower/utils/cpupower.c b/tools/power/cpupower/utils/cpupower.c
+index 9ea9143..24d19db 100644
+--- a/tools/power/cpupower/utils/cpupower.c
++++ b/tools/power/cpupower/utils/cpupower.c
+@@ -189,8 +189,10 @@ int main(int argc, const char *argv[])
+ return EXIT_FAILURE;
+ }
+
++#ifdef NLS
+ setlocale(LC_ALL, "");
+ textdomain(PACKAGE);
++#endif
+
+ /* Turn "perf cmd --help" into "perf help cmd" */
+ if (argc > 1 && !strcmp(argv[1], "--help")) {
+diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
+index 05f953f..dec8ff9 100644
+--- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
++++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
+@@ -268,7 +268,7 @@ void list_monitors(void)
+ * percent, time (granlarity)
+ */
+ printf("%s\t[%c] -> %s\n", s.name, range_abbr[s.range],
+- gettext(s.desc));
++ _(s.desc));
+ }
+ }
+ }
+diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
+index 9e43f33..d96d618 100644
+--- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
++++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
+@@ -60,7 +60,7 @@ extern long long timespec_diff_us(struct timespec start, struct timespec end);
+
+ #define print_overflow_err(mes, ov) \
+ { \
+- fprintf(stderr, gettext("Measure took %u seconds, but registers could " \
++ fprintf(stderr, _("Measure took %u seconds, but registers could " \
+ "overflow at %u seconds, results " \
+ "could be inaccurate\n"), mes, ov); \
+ }