Skip to contentSkip to conversation

package/tzdata: only compile the zoneinfo once

PATCH New Yann E. MORIN 2 participants 2 messages May 22, 2014 – Jun 2, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/tzdata: only compile the zoneinfo once

From: "Yann E. MORIN" <[email protected]>

We already compile the zoneinfo once for the host, so there is no need to recompile it for the target, we can just re-use the host files.

This has no impact on tz (the uClibc counterpart of tzdata), since it already made use of the host files anyway.

This means we no longer need to extract the target variant of tzdata, too.

---
 package/tzdata/tzdata.mk | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)
package/tzdata/tzdata.mk +6 -17
index 58b5f13..b619851 100644
@@ -7,7 +7,8 @@
 TZDATA_VERSION = 2014a
 TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz
 TZDATA_SITE = ftp://ftp.iana.org/tz/releases
-TZDATA_DEPENDENCIES = host-zic
+TZDATA_DEPENDENCIES = host-tzdata
+HOST_TZDATA_DEPENDENCIES = host-zic
 TZDATA_LICENSE = Public domain
 
 TZDATA_DEFAULT_ZONELIST = africa antarctica asia australasia backward etcetera \
@@ -21,24 +22,12 @@ endif
 
 TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
 
-# Don't strip any path components during extraction.
-define TZDATA_EXTRACT_CMDS
-	gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \
-		| $(TAR) --strip-components=0 -C $(@D) -xf -
-endef
-
-define TZDATA_BUILD_CMDS
-	(cd $(@D); \
-		for zone in $(TZDATA_ZONELIST); do \
-			$(ZIC) -d _output/posix -y yearistype.sh $$zone; \
-			$(ZIC) -d _output/right -L leapseconds -y yearistype.sh $$zone; \
-		done; \
-	)
-endef
+# No need to extract for target, we're using the host-installed files
+TZDATA_EXTRACT_CMDS =
 
 define TZDATA_INSTALL_TARGET_CMDS
-	mkdir -p $(TARGET_DIR)/usr/share/zoneinfo
-	cp -a $(@D)/_output/* $(@D)/*.tab $(TARGET_DIR)/usr/share/zoneinfo
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share
+	cp -a $(HOST_DIR)/usr/share/zoneinfo $(TARGET_DIR)/usr/share/zoneinfo
 	cd $(TARGET_DIR)/usr/share/zoneinfo;    \
 	for zone in posix/*; do                 \
 	    ln -sfn "$${zone}" "$${zone##*/}";  \
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 package/tzdata: only compile the zoneinfo once

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: "Yann E. MORIN" <[email protected]>
We already compile the zoneinfo once for the host, so there is no need to recompile it for the target, we can just re-use the host files.

Quoted 7 lines

This has no impact on tz (the uClibc counterpart of tzdata), since it already made use of the host files anyway.

This means we no longer need to extract the target variant of tzdata, too.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard