4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# CDDL HEADER START
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# The contents of this file are subject to the terms of the
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# Common Development and Distribution License (the "License").
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# You may not use this file except in compliance with the License.
5fbccc935e3f7b916aa7c6e302a212821072e83aTimo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# See the License for the specific language governing permissions
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# and limitations under the License.
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen# If applicable, add the following below this CDDL HEADER, with the
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
5fbccc935e3f7b916aa7c6e302a212821072e83aTimo Sirainen# CDDL HEADER END
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo SirainenCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo Sirainen sha256:ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_ARCHIVE_URL= ftp://xmlsoft.org/libxml2/$(COMPONENT_ARCHIVE)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# W3C XML Conformance Test Suites
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen sha256:96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo SirainenCOMPONENT_ARCHIVE_URL_1= http://www.w3.org/XML/Test/$(COMPONENT_ARCHIVE_1)
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo Sirainen# Once Python 2.6 goes away, the various POST_*_ACTIONs below can be simplified.
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo SirainenCONFIGURE_OPTIONS += --with-python=$(PYTHON.$(BITS))
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo SirainenCONFIGURE_OPTIONS += --with-python-install-dir=$(PYTHON_VENDOR_PACKAGES)
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo Sirainen# Cannot link to lzma since it's not in /lib.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_PREP_ACTION += (cd $(@D) ; cp ../mapfile libxml2.syms ; autoreconf -if)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# After we have configured, make a copy of the python bits so we can build and
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# test separate python 2.7 and 3.4 support. Note for 3.4: .py files need to
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# go in .../vendor-packages (whether building 32-bit or 64-bit) whereas .so
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# files need to go in .../vendor-packages for 32-bit but .../vendor-packages/64
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# for 64-bit. For 2.6 and 2.7, Python is built 32- and 64-bit, so .py files
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# end up in both places even though only the 32-bit location is needed, but the
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# superfluous files in the proto area are harmless; meanwhile, the .so files
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# end up in their proper 32- and 64-bit locations. But Python 3.4 is built
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# 64-bit only, so we have an extra sed edit below to force the .py files into
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# the 32-bit location and we manually specify the 32-bit path in the manifest
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# to correct for the .so file being installed there instead of the 64-bit path
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# where it belongs. Further, Python 3.4 needs an extra 'm' on the link and
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# include paths, plus a tweak to the binary path; see PEP 3149 for details.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(GSED) -i -e 's/2[.]6/2.7/g' `find python2.7 -name Makefile` ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(GSED) -i -e 's|-lpython2[.]6|-lpython3.4m|' \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen -e 's|usr/bin/$(MACH64)/python2[.]6|usr/bin/python3.4m|' \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen -e 's|usr/include/python2[.]6|usr/include/python3.4m|' \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen -e 's/2[.]6/3.4/g' -e 's|vendor-packages/64|vendor-packages|' \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# After we have built/installed libxml2, build/install the python
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# support for python 2.7 and 3.4
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_INSTALL_ARGS) install ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# It's nice to test also python 2.7 and 3.4 modules.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_TEST_ARGS) test ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# We have patched our 64 bit python so it will search for modules only in
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# '64/' directories. Now we need to provide one. Otherwise python will
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# end up using libxml2mod.so installed on system.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen$(BUILD_DIR)/$(MACH64)/.tested: COMPONENT_PRE_TEST_ACTION = ( \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(SYMLINK) ../libxml2mod.so $(@D)/python/.libs/64/libxml2mod.so; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(SYMLINK) ../libxml2mod.so $(@D)/python2.7/.libs/64/libxml2mod.so; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(SYMLINK) ../libxml2mod.so $(@D)/python3.4/.libs/64/libxml2mod.so);
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen (cd $(@D) ; gtar xf $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_1));
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# common targets
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(PYTHON.2.6.32) -m compileall $(PROTO_DIR)/usr/lib/python2.6/vendor-packages
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(PYTHON.2.7.32) -m compileall $(PROTO_DIR)/usr/lib/python2.7/vendor-packages