Skip to contentSkip to conversation

Optionally disable NLS

PATCH In review RickZero_Chaos Farina 3 participants 4 messages Apr 16, 2014 – May 9, 2014

lore
Share & tools
lore

RickZero_Chaos Farina

author
#0 lore raw

PATCH 1/1 Optionally disable NLS

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A report on Gentoo's bug tracker
(https://bugs.gentoo.org/show_bug.cgi?id=505366) notes that while the configure script support --disable-nls, the nls code is not conditionally disabled which causes build failures on uclibc. This patch from René Rhéaume fixes the affected code:

- --- powertop-2.5/src/lib.h
+++ powertop-2.5-nls/src/lib.h
@@ -33,7 +33,11 @@
#include "config.h"
#endif

+#ifdef ENABLE_NLS
#define _(STRING) gettext(STRING)
+#else
+#define _(STRING) (STRING)
+#endif

#define POWERTOP_VERSION "v"PACKAGE_VERSION #define POWERTOP_SHORT_VERSION PACKAGE_VERSION
- --- powertop-2.5/src/main.cpp
+++ powertop-2.5-nls/src/main.cpp
@@ -369,8 +369,10 @@ int main(int argc, char **argv)
set_new_handler(out_of_memory);

setlocale (LC_ALL, "");
+#ifdef ENABLE_NLS
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+#endif

while (1) { /* parse commandline options */
c = getopt_long (argc, argv, "ch:C:i:t:uVw:q", long_options,
&option_index);
- --- powertop-2.5/src/report/report-maker.h
+++ powertop-2.5-nls/src/report/report-maker.h
@@ -75,8 +75,13 @@
#include <string>

/* Conditional gettext. We need original strings for CSV. */
+#ifdef ENABLE_NLS
#define __(STRING) \
((report.get_type() == REPORT_CSV) ? (STRING) : gettext(STRING))
+#else
+#define __(STRING) (STRING)
+#endif
+

#ifndef UNUSED
#define UNUSED __attribute__((unused))

original patch: https://505366.bugs.gentoo.org/attachment.cgi?id=373272

Please accept this patch.

Thanks,
Zero
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTTp/tAAoJEKXdFCfdEflKqIMP/14P/29kiuSFkm7R3A1AdiHq R9t7uS6b34dFQ+NX2loegFqwsyxcRvn3+19iG/u6Oa3uYIKRs1XnIuilZ6AQKQEW 79yDNm9bH/B/K+68hCXOWBnfO625GxTeaOt/vJDYJiUSJR7/VI4eu1+eeC87BS/p +d9XxbsDyn+SKdCuPAk7/Vju9XISQdjGla7DwEZYDF331iKZCFEdPkX09RW5/Zss iQGbHzsRZWyOpnHVeYwMKIdGUBfOB3dlnVMyecaXoBv/ybyxxw2cgLjZpav4m6D4 wLIgL6Fc7tRDmCO7aNuUVUznjx1XvxsZuh64wXc36E8XBO10xtMHlk03di0tn7RC 0eT6qwOkUpBsqFZKVRvfC25FrpgjI3b/XNnWctJvlJPvQRzTRe+OCERhnJlR+NND T/PzGSlqGyCIpLhuXlJ0MUgwDW9BaUFjY84Fi0sruuFOleqN/UKPcJJO3IPwNvXH 98Yia9cve8rzaJJgvtwkAEnjiph4SlDlU3w/K8XBmrOTl7c2CZUGoesv5A7YH57y rcWzRLS7H5XUqpdn+l3dqBdsWTOsP9n/76VXNaUh6BSvK56b1Ud10VvY5ayxtDs1 xCFYRbgTc34oAtk3P8xNwX08wqIyZu8UfT9HhYkUNrDxExnC5XRmgpfaHCXT101k d5ix6cGYZiikCtzUlB1M
=H1V6
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 6 lines · Rick "Zero_Chaos" Farina

A report on Gentoo's bug tracker
(https://bugs.gentoo.org/show_bug.cgi?id=505366) notes that while the configure script support --disable-nls, the nls code is not conditionally disabled which causes build failures on uclibc. This patch from René Rhéaume fixes the affected code:

looks good.

	-ss
Quoted 75 lines

- --- powertop-2.5/src/lib.h
+++ powertop-2.5-nls/src/lib.h

(quoted diff) +7 -1
@@ -33,7 +33,11 @@
 #include "config.h"
 #endif
 
+#ifdef ENABLE_NLS
 #define _(STRING)    gettext(STRING)
+#else
+#define _(STRING)    (STRING)
+#endif
 
 #define POWERTOP_VERSION "v"PACKAGE_VERSION
 #define POWERTOP_SHORT_VERSION PACKAGE_VERSION
- --- powertop-2.5/src/main.cpp
+++ powertop-2.5-nls/src/main.cpp
@@ -369,8 +369,10 @@ int main(int argc, char **argv)
 	set_new_handler(out_of_memory);
 
 	setlocale (LC_ALL, "");
+#ifdef ENABLE_NLS
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
+#endif
 
 	while (1) { /* parse commandline options */
 		c = getopt_long (argc, argv, "ch:C:i:t:uVw:q", long_options,

&option_index);
- --- powertop-2.5/src/report/report-maker.h
+++ powertop-2.5-nls/src/report/report-maker.h

(quoted diff) +5 -0
@@ -75,8 +75,13 @@
 #include <string>
 
 /* Conditional gettext. We need original strings for CSV. */
+#ifdef ENABLE_NLS
 #define __(STRING) \
 	((report.get_type() == REPORT_CSV) ? (STRING) : gettext(STRING))
+#else
+#define __(STRING) (STRING)
+#endif
+
 
 #ifndef UNUSED
 #define UNUSED __attribute__((unused))

original patch: https://505366.bugs.gentoo.org/attachment.cgi?id=373272

Please accept this patch.

Thanks,
Zero
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTTp/tAAoJEKXdFCfdEflKqIMP/14P/29kiuSFkm7R3A1AdiHq R9t7uS6b34dFQ+NX2loegFqwsyxcRvn3+19iG/u6Oa3uYIKRs1XnIuilZ6AQKQEW 79yDNm9bH/B/K+68hCXOWBnfO625GxTeaOt/vJDYJiUSJR7/VI4eu1+eeC87BS/p +d9XxbsDyn+SKdCuPAk7/Vju9XISQdjGla7DwEZYDF331iKZCFEdPkX09RW5/Zss iQGbHzsRZWyOpnHVeYwMKIdGUBfOB3dlnVMyecaXoBv/ybyxxw2cgLjZpav4m6D4 wLIgL6Fc7tRDmCO7aNuUVUznjx1XvxsZuh64wXc36E8XBO10xtMHlk03di0tn7RC 0eT6qwOkUpBsqFZKVRvfC25FrpgjI3b/XNnWctJvlJPvQRzTRe+OCERhnJlR+NND T/PzGSlqGyCIpLhuXlJ0MUgwDW9BaUFjY84Fi0sruuFOleqN/UKPcJJO3IPwNvXH 98Yia9cve8rzaJJgvtwkAEnjiph4SlDlU3w/K8XBmrOTl7c2CZUGoesv5A7YH57y rcWzRLS7H5XUqpdn+l3dqBdsWTOsP9n/76VXNaUh6BSvK56b1Ud10VvY5ayxtDs1 xCFYRbgTc34oAtk3P8xNwX08wqIyZu8UfT9HhYkUNrDxExnC5XRmgpfaHCXT101k d5ix6cGYZiikCtzUlB1M
=H1V6
-----END PGP SIGNATURE-----
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop

#2 lore raw
Quoted 84 lines · Rick "Zero_Chaos" Farina
Quoted 6 lines

A report on Gentoo's bug tracker
(https://bugs.gentoo.org/show_bug.cgi?id=505366) notes that while the configure script support --disable-nls, the nls code is not conditionally disabled which causes build failures on uclibc. This patch from René Rhéaume fixes the affected code:

looks good.

	-ss
Quoted 71 lines

- --- powertop-2.5/src/lib.h
+++ powertop-2.5-nls/src/lib.h

(quoted diff) +7 -1
@@ -33,7 +33,11 @@
 #include "config.h"
 #endif
 
+#ifdef ENABLE_NLS
 #define _(STRING)    gettext(STRING)
+#else
+#define _(STRING)    (STRING)
+#endif
 
 #define POWERTOP_VERSION "v"PACKAGE_VERSION
 #define POWERTOP_SHORT_VERSION PACKAGE_VERSION
- --- powertop-2.5/src/main.cpp
+++ powertop-2.5-nls/src/main.cpp
@@ -369,8 +369,10 @@ int main(int argc, char **argv)
 	set_new_handler(out_of_memory);
 
 	setlocale (LC_ALL, "");
+#ifdef ENABLE_NLS
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
+#endif
 
 	while (1) { /* parse commandline options */
 		c = getopt_long (argc, argv, "ch:C:i:t:uVw:q", long_options,

&option_index);
- --- powertop-2.5/src/report/report-maker.h
+++ powertop-2.5-nls/src/report/report-maker.h

(quoted diff) +5 -0
@@ -75,8 +75,13 @@
 #include <string>
 
 /* Conditional gettext. We need original strings for CSV. */
+#ifdef ENABLE_NLS
 #define __(STRING) \
 	((report.get_type() == REPORT_CSV) ? (STRING) : gettext(STRING))
+#else
+#define __(STRING) (STRING)
+#endif
+
 
 #ifndef UNUSED
 #define UNUSED __attribute__((unused))

original patch: https://505366.bugs.gentoo.org/attachment.cgi?id=373272

Please accept this patch.

Thanks,
Zero
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTTp/tAAoJEKXdFCfdEflKqIMP/14P/29kiuSFkm7R3A1AdiHq R9t7uS6b34dFQ+NX2loegFqwsyxcRvn3+19iG/u6Oa3uYIKRs1XnIuilZ6AQKQEW 79yDNm9bH/B/K+68hCXOWBnfO625GxTeaOt/vJDYJiUSJR7/VI4eu1+eeC87BS/p +d9XxbsDyn+SKdCuPAk7/Vju9XISQdjGla7DwEZYDF331iKZCFEdPkX09RW5/Zss iQGbHzsRZWyOpnHVeYwMKIdGUBfOB3dlnVMyecaXoBv/ybyxxw2cgLjZpav4m6D4 wLIgL6Fc7tRDmCO7aNuUVUznjx1XvxsZuh64wXc36E8XBO10xtMHlk03di0tn7RC 0eT6qwOkUpBsqFZKVRvfC25FrpgjI3b/XNnWctJvlJPvQRzTRe+OCERhnJlR+NND T/PzGSlqGyCIpLhuXlJ0MUgwDW9BaUFjY84Fi0sruuFOleqN/UKPcJJO3IPwNvXH 98Yia9cve8rzaJJgvtwkAEnjiph4SlDlU3w/K8XBmrOTl7c2CZUGoesv5A7YH57y rcWzRLS7H5XUqpdn+l3dqBdsWTOsP9n/76VXNaUh6BSvK56b1Ud10VvY5ayxtDs1 xCFYRbgTc34oAtk3P8xNwX08wqIyZu8UfT9HhYkUNrDxExnC5XRmgpfaHCXT101k d5ix6cGYZiikCtzUlB1M
=H1V6
-----END PGP SIGNATURE-----
_______________________________________________

Quoted 9 lines
Quoted 4 lines

PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop

_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop

I'm having issues adding this patch to the repo. I get error:

Patch is empty. Was it split wrong?

Sergey, did you have any problems applying this patch to your branch?

Rick, please check your patch and send it?

Thank you,
Alexandra.

#3 lore raw
Quoted 66 lines · Alexandra Yates
Quoted 58 lines · Rick "Zero_Chaos" Farina
Quoted 6 lines

A report on Gentoo's bug tracker
(https://bugs.gentoo.org/show_bug.cgi?id=505366) notes that while the configure script support --disable-nls, the nls code is not conditionally disabled which causes build failures on uclibc. This patch from René Rhéaume fixes the affected code:

looks good.

	-ss
Quoted 46 lines

- --- powertop-2.5/src/lib.h
+++ powertop-2.5-nls/src/lib.h

(quoted diff) +7 -1
@@ -33,7 +33,11 @@
 #include "config.h"
 #endif
 
+#ifdef ENABLE_NLS
 #define _(STRING)    gettext(STRING)
+#else
+#define _(STRING)    (STRING)
+#endif
 
 #define POWERTOP_VERSION "v"PACKAGE_VERSION
 #define POWERTOP_SHORT_VERSION PACKAGE_VERSION
- --- powertop-2.5/src/main.cpp
+++ powertop-2.5-nls/src/main.cpp
@@ -369,8 +369,10 @@ int main(int argc, char **argv)
 	set_new_handler(out_of_memory);
 
 	setlocale (LC_ALL, "");
+#ifdef ENABLE_NLS
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
+#endif
 
 	while (1) { /* parse commandline options */
 		c = getopt_long (argc, argv, "ch:C:i:t:uVw:q", long_options,

&option_index);
- --- powertop-2.5/src/report/report-maker.h
+++ powertop-2.5-nls/src/report/report-maker.h

(quoted diff) +5 -0
@@ -75,8 +75,13 @@
 #include <string>
 
 /* Conditional gettext. We need original strings for CSV. */
+#ifdef ENABLE_NLS
 #define __(STRING) \
 	((report.get_type() == REPORT_CSV) ? (STRING) : gettext(STRING))
+#else
+#define __(STRING) (STRING)
+#endif
+
 
 #ifndef UNUSED
 #define UNUSED __attribute__((unused))
Quoted 6 lines
Quoted 6 lines

original patch: https://505366.bugs.gentoo.org/attachment.cgi?id=373272

Please accept this patch.

Thanks,
Zero

I'm having issues adding this patch to the repo. I get error:

Quoted 6 lines

Patch is empty. Was it split wrong?

Sergey, did you have any problems applying this patch to your branch?

Rick, please check your patch and send it?

I guess this is because of

--- powertop-2.5
+++ powertop-2.5-nls

	^^^^^^^^^^^^

the following one seems to work.

Rick, can you resend using `git send-email'?

---

 src/lib.h                 | 4 ++++
 src/main.cpp              | 2 ++
 src/report/report-maker.h | 5 +++++
 3 files changed, 11 insertions(+)
src/lib.h +4 -0
index adcc4a2..78391a4 100644
@@ -33,7 +33,11 @@
 #include "config.h"
 #endif
 
+#ifdef ENABLE_NLS
 #define _(STRING)    gettext(STRING)
+#else
+#define _(STRING)    (STRING)
+#endif
 
 #define POWERTOP_VERSION "v"PACKAGE_VERSION
 #define POWERTOP_SHORT_VERSION PACKAGE_VERSION
src/main.cpp +2 -0
index 4e34ee6..8bbc1ff 100644
@@ -369,8 +369,10 @@ int main(int argc, char **argv)
 	set_new_handler(out_of_memory);
 
 	setlocale (LC_ALL, "");
+#ifdef ENABLE_NLS
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
+#endif
 
 	while (1) { /* parse commandline options */
 		c = getopt_long (argc, argv, "ch:C:i:t:uVw:q", long_options, &option_index);
src/report/report-maker.h +5 -0
index 75e0d06..a72aa47 100644
@@ -75,8 +75,13 @@
 #include <string>
 
 /* Conditional gettext. We need original strings for CSV. */
+#ifdef ENABLE_NLS
 #define __(STRING) \
 	((report.get_type() == REPORT_CSV) ? (STRING) : gettext(STRING))
+#else
+#define __(STRING) (STRING)
+#endif
+
 
 #ifndef UNUSED
 #define UNUSED __attribute__((unused))