148N/A#
148N/A# CDDL HEADER START
148N/A#
148N/A# The contents of this file are subject to the terms of the
148N/A# Common Development and Distribution License (the "License").
148N/A# You may not use this file except in compliance with the License.
148N/A#
148N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
148N/A# or http://www.opensolaris.org/os/licensing.
148N/A# See the License for the specific language governing permissions
148N/A# and limitations under the License.
148N/A#
148N/A# When distributing Covered Code, include this CDDL HEADER in each
148N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
148N/A# If applicable, add the following below this CDDL HEADER, with the
148N/A# fields enclosed by brackets "[]" replaced with your own identifying
148N/A# information: Portions Copyright [yyyy] [name of copyright owner]
148N/A#
148N/A# CDDL HEADER END
148N/A#
148N/A
148N/A#
5680N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
148N/A#
5680N/ABUILD_BITS= 64_and_32
148N/Ainclude ../../make-rules/shared-macros.mk
148N/A
148N/ACOMPONENT_NAME= libxml2
6081N/ACOMPONENT_VERSION= 2.9.4
618N/ACOMPONENT_PROJECT_URL= http://xmlsoft.org/
844N/ACOMPONENT_ARCHIVE_HASH= \
6081N/A sha256:ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c
148N/ACOMPONENT_ARCHIVE_URL= ftp://xmlsoft.org/libxml2/$(COMPONENT_ARCHIVE)
1258N/ACOMPONENT_BUGDB= library/libxml
148N/A
1002N/A# W3C XML Conformance Test Suites
1239N/ACOMPONENT_ARCHIVE_1= xmlts20080827.tar.gz
1002N/ACOMPONENT_ARCHIVE_HASH_1= \
1239N/A sha256:96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7
1002N/ACOMPONENT_ARCHIVE_URL_1= http://www.w3.org/XML/Test/$(COMPONENT_ARCHIVE_1)
1002N/A
6081N/ATPNO= 29079
2899N/A
5680N/ASYSTEM_TEST_TARGET= configure $(SYSTEM_TEST_32_and_64)
5680N/Ainclude $(WS_MAKE_RULES)/common.mk
148N/A
148N/ACFLAGS += $(CPP_LARGEFILES)
148N/ALDFLAGS += $(LD_Z_DEFS) $(LD_Z_TEXT) -lpthread
148N/A
148N/ACONFIGURE_OPTIONS += --disable-static
148N/ACONFIGURE_OPTIONS += --with-pic
148N/ACONFIGURE_OPTIONS += --with-threads
148N/ACONFIGURE_OPTIONS += --with-python=$(PYTHON.$(BITS))
3403N/ACONFIGURE_OPTIONS += --with-python-install-dir=$(PYTHON_VENDOR_PACKAGES)
5680N/A# Cannot link to lzma since it's not in /lib and install media still has separate /usr.
1239N/ACONFIGURE_OPTIONS += --without-lzma
148N/A
690N/ACOMPONENT_PREP_ACTION += (cd $(@D) ; cp ../mapfile libxml2.syms ; autoreconf -if)
148N/A
3056N/A# After we have configured, make a copy of the python bits so we can build and
3056N/A# test separate python 2.7 and 3.4 support. Note for 3.4: .py files need to
3056N/A# go in .../vendor-packages (whether building 32-bit or 64-bit) whereas .so
3056N/A# files need to go in .../vendor-packages for 32-bit but .../vendor-packages/64
4982N/A# for 64-bit. For 2.7, Python is built 32- and 64-bit, so .py files end
4982N/A# up in both places even though only the 32-bit location is needed, but the
3056N/A# superfluous files in the proto area are harmless; meanwhile, the .so files
3056N/A# end up in their proper 32- and 64-bit locations. But Python 3.4 is built
3056N/A# 64-bit only, so we have an extra sed edit below to force the .py files into
3056N/A# the 32-bit location and we manually specify the 32-bit path in the manifest
3056N/A# to correct for the .so file being installed there instead of the 64-bit path
3127N/A# where it belongs. Further, Python 3.4 needs an extra 'm' on the link and
3127N/A# include paths, plus a tweak to the binary path; see PEP 3149 for details.
5680N/ACOMPONENT_POST_CONFIGURE_ACTION += \
4982N/A (cd $(@D) ; cp -rp python python3.4 ; \
4982N/A $(GSED) -i -e 's|-lpython2[.]7|-lpython3.4m|' \
4982N/A -e 's|usr/bin/$(MACH64)/python2[.]7|usr/bin/python3.4m|' \
4982N/A -e 's|usr/include/python2[.]7|usr/include/python3.4m|' \
4982N/A -e 's/2[.]7/3.4/g' -e 's|vendor-packages/64|vendor-packages|' \
3056N/A `find python3.4 -name Makefile` ; \
3056N/A)
727N/A
4982N/A# It's also nice to test python 3.4 modules.
5680N/ACOMPONENT_POST_TEST_ACTION += \
5057N/A ( if [ $(BITS) -eq 64 ]; then \
5057N/A cd $(@D)/python3.4 ; \
5057N/A $(GMAKE) $(COMPONENT_TEST_ARGS) test ; \
5057N/A else \
5057N/A true ; \
5057N/A fi )
1652N/A
1652N/A# We have patched our 64 bit python so it will search for modules only in
1652N/A# '64/' directories. Now we need to provide one. Otherwise python will
1652N/A# end up using libxml2mod.so installed on system.
1652N/A$(BUILD_DIR)/$(MACH64)/.tested: COMPONENT_PRE_TEST_ACTION = ( \
3056N/A $(MKDIR) $(@D)/python/.libs/64 \
3056N/A $(@D)/python3.4/.libs/64; \
1652N/A $(SYMLINK) ../libxml2mod.so $(@D)/python/.libs/64/libxml2mod.so; \
3056N/A $(SYMLINK) ../libxml2mod.so $(@D)/python3.4/.libs/64/libxml2mod.so);
1652N/A
1652N/ACOMPONENT_PRE_TEST_ACTION += \
1652N/A (cd $(@D) ; gtar xf $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_1));
727N/A
4528N/ACOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
4528N/A
4528N/ACOMPONENT_TEST_TRANSFORMS = \
4528N/A '-e "s/^make\[.*$$/[EnD]/" ' \
4528N/A '-e "/^\#\# XML regression tests/,/^\[EnD\]/p" ' \
4528N/A '-e "/^\#\# running Python regression tests/,/^\[EnD\]/p" ' \
4528N/A '-e "/.*/d" '
4528N/A
4528N/ACOMPONENT_SYSTEM_TEST_TARGETS = system-test
5680N/ACOMPONENT_PRE_SYSTEM_TEST_ACTION += $(COMPONENT_PRE_TEST_ACTION)
4528N/A
5680N/ACOMPONENT_POST_INSTALL_ACTION.32 += \
5680N/A $(PYTHON.2.7.32) -m compileall $(PROTOUSRLIBDIR)/python2.7/vendor-packages;
148N/A
5680N/A# After we have built/installed libxml2, build/install the python
5680N/A# support for python 3.4
5680N/ACOMPONENT_POST_INSTALL_ACTION.64 += \
5680N/A cd $(@D)/python3.4 ; \
5680N/A $(GMAKE) $(COMPONENT_INSTALL_ARGS) install ; \
5680N/A $(PYTHON.3.4.64) -m compileall $(PROTOUSRLIBDIR)/python3.4/vendor-packages;
148N/A
3817N/AREQUIRED_PACKAGES += library/libxml2
3817N/AREQUIRED_PACKAGES += library/zlib
3817N/AREQUIRED_PACKAGES += runtime/python-27
3817N/AREQUIRED_PACKAGES += runtime/python-34
3817N/AREQUIRED_PACKAGES += shell/ksh93
3817N/AREQUIRED_PACKAGES += system/library/math