Skip to contentSkip to conversation

icu: add an option to add a custom data library file

PATCH New Johan Derycke 2 participants 2 messages May 13, 2014 – Jul 28, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 icu: add an option to add a custom data library file

---
 package/icu/Config.in |   21 +++++++++++++++++++++
 package/icu/icu.mk    |    9 +++++++++
 2 files changed, 30 insertions(+)
package/icu/Config.in +21 -0
index 9a27894..1f27b4b 100644
@@ -13,8 +13,29 @@ config BR2_PACKAGE_ICU
 
 	  http://site.icu-project.org/
 
+if BR2_PACKAGE_ICU
+
+config BR2_PACKAGE_ICU_CUSTOM_DATA
+	bool "Custom data library"
+	  help
+	    Use a custom data library generated with:
+	    http://apps.icu-project.org/datacustom/ICUData51.html
+
+if BR2_PACKAGE_ICU_CUSTOM_DATA
+
+config BR2_PACKAGE_ICU_CUSTOM_DATA_PATH
+	string "Data library file to use?"
+	default "/path/to/data/library"
+	help
+	  This option allows to set the path of such a data library file
+
+endif
+
+endif
+
 comment "icu needs a toolchain w/ C++, wchar, threads"
 	depends on !BR2_arc
 	depends on !BR2_BINFMT_FLAT
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
 		!BR2_TOOLCHAIN_HAS_THREADS
+
package/icu/icu.mk +9 -0
index f93eab1..664ce1c 100644
@@ -26,5 +26,14 @@ ICU_MAKE = $(MAKE1)
 ICU_SUBDIR = source
 HOST_ICU_SUBDIR = source
 
+define ICU_COPY_CUSTOM_DATA
+	cp $(BR2_PACKAGE_ICU_CUSTOM_DATA_PATH) $(@D)/source/data/in/
+endef
+
+ifeq ($(BR2_PACKAGE_ICU_CUSTOM_DATA),y)
+ICU_POST_EXTRACT_HOOKS += ICU_COPY_CUSTOM_DATA
+endif
+
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 icu: add an option to add a custom data library file

Dear Johan Derycke,

I've applied your patch, after making some changes, see below.

Quoted 9 lines · Johan Derycke
package/icu/Config.in +9 -0
+if BR2_PACKAGE_ICU
+
+config BR2_PACKAGE_ICU_CUSTOM_DATA
+	bool "Custom data library"
+	  help
+	    Use a custom data library generated with:
+	    http://apps.icu-project.org/datacustom/ICUData51.html
+
+if BR2_PACKAGE_ICU_CUSTOM_DATA

package/icu/Config.in config BR2_PACKAGE_ICU · line 34

Quoted 10 lines
package/icu/Config.in +10 -0
+
+config BR2_PACKAGE_ICU_CUSTOM_DATA_PATH
+	string "Data library file to use?"
+	default "/path/to/data/library"
+	help
+	  This option allows to set the path of such a data library file
+
+endif
+
+endif

Doing it this way causes problems in the autobuilders: with a random generated configuration, BR2_PACKAGE_ICU_CUSTOM_DATA might be enabled, but BR2_PACKAGE_ICU_CUSTOM_DATA_PATH will have an invalid value. This would cause build failures in our autobuilders. Therefore, I changed that to simply a single string option, empty by default. When empty, nothing is done. When non-empty, the custom data library file is copied.

package/icu/Config.in config BR2_PACKAGE_ICU · line 41

Quoted 7 lines
package/icu/Config.in +2 -0
+
 comment "icu needs a toolchain w/ C++, wchar, threads"
 	depends on !BR2_arc
 	depends on !BR2_BINFMT_FLAT
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
 		!BR2_TOOLCHAIN_HAS_THREADS
+

No need to add a new empty line here.

package/icu/icu.mk ICU_MAKE = $(MAKE1) · line 35

Quoted 7 lines
package/icu/icu.mk +7 -0
+define ICU_COPY_CUSTOM_DATA
+	cp $(BR2_PACKAGE_ICU_CUSTOM_DATA_PATH) $(@D)/source/data/in/
+endef
+
+ifeq ($(BR2_PACKAGE_ICU_CUSTOM_DATA),y)
+ICU_POST_EXTRACT_HOOKS += ICU_COPY_CUSTOM_DATA
+endif

I've changed the condition to match the change described above. Also, I've moved the definition of the ICU_COPY_CUSTOM_DATA macro inside the condition.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com