components/libxml2/Makefile
changeset 1288 ef52cf7d626e
parent 1058 34d7aaa03423
child 1948 2d1537e7942d
--- a/components/libxml2/Makefile	Thu May 02 08:40:39 2013 -0700
+++ b/components/libxml2/Makefile	Fri May 03 00:11:11 2013 -0700
@@ -20,18 +20,18 @@
 #
 
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		libxml2
-COMPONENT_VERSION=	2.9.0
+COMPONENT_VERSION=	2.9.1
 COMPONENT_PROJECT_URL=	http://xmlsoft.org/
 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
-    sha256:ad25d91958b7212abdc12b9611cfb4dc4e5cddb6d1e9891532f48aacee422b82
+    sha256:fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb
 COMPONENT_ARCHIVE_URL=	ftp://xmlsoft.org/libxml2/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	library/libxml
 
@@ -62,16 +62,29 @@
 COMPONENT_PREP_ACTION += (cd $(@D) ; cp ../mapfile libxml2.syms ; autoreconf -if)
 
 # After we have configured, make a copy of the python bits so we
-# can build separate python 2.7 support.
+# can build and test separate python 2.7 support.
 COMPONENT_POST_CONFIGURE_ACTION = (cd $(@D) ; cp -rp python python2.7 ; \
-			$(GSED) -i -e 's/2[.]6/2.7/g' python2.7/Makefile)
+    $(GSED) -i -e 's/2[.]6/2.7/g' `find python2.7 -name Makefile`)
 
 # After we have built/installed libxml2, build/install the python
 # support for python 2.7
 COMPONENT_POST_INSTALL_ACTION = \
     (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_INSTALL_ARGS) install)
 
-COMPONENT_PRE_TEST_ACTION = (cd $(@D) ; gtar xf $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_1))
+# It's nice to test also python 2.7 module.
+COMPONENT_POST_TEST_ACTION = \
+    (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_TEST_ARGS) test)
+
+# We have patched our 64 bit python so it will search for modules only in
+# '64/' directories. Now we need to provide one. Otherwise python will
+# end up using libxml2mod.so installed on system.
+$(BUILD_DIR)/$(MACH64)/.tested: COMPONENT_PRE_TEST_ACTION = ( \
+    $(MKDIR) $(@D)/python/.libs/64 $(@D)/python2.7/.libs/64; \
+    $(SYMLINK) ../libxml2mod.so $(@D)/python/.libs/64/libxml2mod.so; \
+    $(SYMLINK) ../libxml2mod.so $(@D)/python2.7/.libs/64/libxml2mod.so);
+
+COMPONENT_PRE_TEST_ACTION += \
+    (cd $(@D) ; gtar xf $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_1));
 
 # common targets
 build:		$(BUILD_32_and_64)