python27: remove tcl/tk dep
[unleashed-userland.git] / components / python / python27 / Makefile
blobc349a6c25d1f60bb3b955505b5ee45de1ec07731
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
21 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
24 include ../../../make-rules/shared-macros.mk
26 PATH=/usr/bin:/usr/gnu/bin:/usr/sbin
28 COMPONENT_NAME= Python
29 COMPONENT_VERSION= 2.7.13
30 COMPONENT_PROJECT_URL= http://python.org/
31 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
32 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
33 COMPONENT_ARCHIVE_HASH= \
34 sha256:35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731
35 COMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)ftp/python/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
36 COMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).asc
37 COMPONENT_BUGDB= utility/python
39 include $(WS_TOP)/make-rules/prep.mk
40 include $(WS_TOP)/make-rules/configure.mk
41 include $(WS_TOP)/make-rules/ips.mk
43 # Need to preserve timestamp for Grammar files. If the pickle files are older,
44 # Python will try to rebuild them.
45 PKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.txt
46 PKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.pickle
48 # We patch auto* files, so regenerate headers and configure
49 COMPONENT_PREP_ACTION = \
50 (cd $(@D) ; autoheader ; autoconf)
52 # we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with
53 # python-config
54 CC += $(CFLAGS)
56 C99MODE=
57 CPPFLAGS += -IPython
59 # to find the ncurses headers
60 CPPFLAGS += -I/usr/include/ncurses
61 # enable large files how they did in JDS
62 CPPFLAGS += -D_LARGEFILE64_SOURCE
64 # libffi for _ctypes
65 CPPFLAGS += $(shell pkg-config --cflags-only-I libffi)
67 # because python links with $(CC) ... $(LDFLAGS) ...
68 LDFLAGS = $(CC_BITS) $(CC_PIC)
70 # build pic
71 CFLAGS += $(CC_PIC)
73 # add /usr/gnu/lib to the library search/run path
74 LDFLAGS.32 = -R/usr/gnu/lib -L/usr/gnu/lib
75 LDFLAGS.64 = -R/usr/gnu/lib/$(MACH64) -L/usr/gnu/lib/$(MACH64)
76 LDFLAGS += $(LDFLAGS.$(BITS))
78 # Python puts its header files in a special place.
79 LINT_FLAGS += -I$(SOURCE_DIR)/Include
81 CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
82 CONFIGURE_OPTIONS += --enable-shared
83 CONFIGURE_OPTIONS += --with-system-expat
84 CONFIGURE_OPTIONS += --with-system-ffi
85 CONFIGURE_OPTIONS += --without-gcc
86 CONFIGURE_OPTIONS += --enable-ipv6
87 CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)"
88 CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
89 CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
90 CONFIGURE_OPTIONS += DFLAGS="-$(BITS)"
92 COMPONENT_BUILD_ENV += DFLAGS="-$(BITS)"
94 # 64 bit shared objects need to go in a 64-bit directory
95 COMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python2.7/lib-dynload
97 # Setup pyconfig.h file to support 32 & 64 bit.
98 # If the /usr/lib/python2.7/lib2to3/*.pickle files are older than the related
99 # *.txt files in the same directory, it will rebuild them anytime you try to
100 # build a Python module. So here we also touch the pickle files to avoid this.
102 COMPONENT_POST_INSTALL_ACTION= \
103 (cd $(PROTOUSRDIR) ; \
104 $(MV) include/python2.7/pyconfig.h include/python2.7/pyconfig-$(BITS).h ; \
105 $(TOUCH) lib/python2.7/lib2to3/*.pickle)
107 # common targets
108 $(INSTALL_32): $(INSTALL_64)
109 build: $(BUILD_32_and_64)
110 install: $(INSTALL_32_and_64)
112 # Using "-uall,-network" ensures all tests are run except the network tests.
113 # The network tests contain many expected failures when run behind a firewall.
114 # The "-v" ensures verbose mode. You can set TESTOPTS_PYTHON_TEST to a
115 # particular test if you want to run just one test. For example, run gmake with
116 # "-k" so it continues and does both 32-bit and 64-bit tests, even if there is a
117 # failure, like this:
118 # $ TESTOPTS_PYTHON_TEST=test_sys gmake -k test
119 # Note that when a test succeeds, the builds/*/.tested file gets created. You
120 # may need to remove these files, or run "gmake clobber" or "gmake clean"
121 # between tests.
123 COMPONENT_TEST_ENV = EXTRATESTOPTS="-v -uall,-network $(TESTOPTS_PYTHON_TEST)"
124 COMPONENT_TEST_TARGETS = test
126 test: $(TEST_32_and_64)
128 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
130 include $(WS_TOP)/make-rules/depend.mk
132 REQUIRED_PACKAGES += compress/bzip2
133 REQUIRED_PACKAGES += database/sqlite-3
134 REQUIRED_PACKAGES += library/database/gdbm
135 REQUIRED_PACKAGES += library/expat
136 REQUIRED_PACKAGES += library/libffi
137 REQUIRED_PACKAGES += library/ncurses
138 REQUIRED_PACKAGES += library/python-2/pip-27
139 REQUIRED_PACKAGES += library/readline
140 REQUIRED_PACKAGES += library/security/openssl
141 REQUIRED_PACKAGES += library/zlib
142 REQUIRED_PACKAGES += runtime/python-27
143 REQUIRED_PACKAGES += runtime/python-27/tests
144 REQUIRED_PACKAGES += SUNWcs
145 REQUIRED_PACKAGES += system/library
146 REQUIRED_PACKAGES += system/library/math