Alexander Pyhalov
2018-09-06 44f1c2ebd9a7a3036f44c216d9fcf4b228cd5432
make-rules: support Python 3.5
1 files added
3 files modified
76 ■■■■ changed files
make-rules/ips.mk 7 ●●●●● patch | view | raw | blame | history
make-rules/setup.py.mk 28 ●●●●● patch | view | raw | blame | history
make-rules/shared-macros.mk 8 ●●●●● patch | view | raw | blame | history
transforms/python-3-no-32bit 33 ●●●●● patch | view | raw | blame | history
make-rules/ips.mk
@@ -81,6 +81,7 @@
PUBLISH_TRANSFORMS +=    $(WS_TOP)/transforms/docs
PUBLISH_TRANSFORMS +=    $(WS_TOP)/transforms/locale
PUBLISH_TRANSFORMS +=    $(WS_TOP)/transforms/python-3-soabi
PUBLISH_TRANSFORMS +=    $(WS_TOP)/transforms/python-3-no-32bit
PUBLISH_TRANSFORMS +=    $(PKGMOGRIFY_TRANSFORMS)
PUBLISH_TRANSFORMS +=    $(WS_TOP)/transforms/publish-cleanup
@@ -123,6 +124,8 @@
PKG_MACROS +=           PYTHON_2.7_ONLY=\#
PKG_MACROS +=           PYTHON_3.4_ONLY=\#
PKG_MACROS +=           PYTHON_3.5_ONLY=\#
PKG_MACROS +=           PYTHON_32_ONLY=
MANGLED_DIR =    $(PROTO_DIR)/mangled
@@ -239,6 +242,10 @@
define python-manifest-rule
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).mogrified: PKG_MACROS += PYTHON_$(1)_ONLY=
ifneq ($(filter $(1),$(PYTHON_64_ONLY_VERSIONS)),)
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).mogrified: PKG_MACROS += PYTHON_32_ONLY=\#
endif
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).p5m: %-PYVER.p5m
    $(PKGMOGRIFY) -D PYVER=$(1) -D PYV=$(shell echo $(1) | tr -d .) $$< > $$@
endef
make-rules/setup.py.mk
@@ -24,32 +24,42 @@
$(BUILD_DIR)/%-2.6/.built:        PYTHON_VERSION=2.6
$(BUILD_DIR)/%-2.7/.built:        PYTHON_VERSION=2.7
$(BUILD_DIR)/%-3.4/.built:        PYTHON_VERSION=3.4
$(BUILD_DIR)/%-3.5/.built:        PYTHON_VERSION=3.5
$(BUILD_DIR)/$(MACH32)-%/.built:    BITS=32
$(BUILD_DIR)/$(MACH64)-%/.built:    BITS=64
$(BUILD_DIR)/%-2.6/.installed:        PYTHON_VERSION=2.6
$(BUILD_DIR)/%-2.7/.installed:        PYTHON_VERSION=2.7
$(BUILD_DIR)/%-3.4/.installed:        PYTHON_VERSION=3.4
$(BUILD_DIR)/%-3.5/.installed:        PYTHON_VERSION=3.5
$(BUILD_DIR)/$(MACH32)-%/.installed:    BITS=32
$(BUILD_DIR)/$(MACH64)-%/.installed:    BITS=64
$(BUILD_DIR)/%-2.6/.tested:        PYTHON_VERSION=2.6
$(BUILD_DIR)/%-2.7/.tested:        PYTHON_VERSION=2.7
$(BUILD_DIR)/%-3.4/.tested:        PYTHON_VERSION=3.4
$(BUILD_DIR)/%-3.5/.tested:        PYTHON_VERSION=3.5
$(BUILD_DIR)/$(MACH32)-%/.tested:    BITS=32
$(BUILD_DIR)/$(MACH64)-%/.tested:    BITS=64
$(BUILD_DIR)/%-2.6/.tested-and-compared:    PYTHON_VERSION=2.6
$(BUILD_DIR)/%-2.7/.tested-and-compared:    PYTHON_VERSION=2.7
$(BUILD_DIR)/%-3.4/.tested-and-compared:    PYTHON_VERSION=3.4
$(BUILD_DIR)/%-3.5/.tested-and-compared:    PYTHON_VERSION=3.5
$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared:    BITS=32
$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared:    BITS=64
BUILD_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.built)
PYTHON_32_VERSIONS = $(filter-out $(PYTHON_64_ONLY_VERSIONS), $(PYTHON_VERSIONS))
BUILD_32 = $(PYTHON_32_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.built)
BUILD_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
BUILD_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.built)
INSTALL_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.installed)
ifeq ($(PYTHON_VERSION),3.5)
BUILD_32_and_64 = $(BUILD_64)
endif
INSTALL_32 = $(PYTHON_32_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.installed)
INSTALL_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
INSTALL_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.installed)
@@ -63,16 +73,16 @@
# Reset arguments specified as environmnent variables
COMPONENT_BUILD_ARGS =
# If we are building Python 2.6 or 3.4 support, build them and install them
# If we are building Python 3.4 or 3.5 support, build them and install them
# before Python 2.7, so 2.7 is installed last and is the canonical version.
# When we change the default, the new default should go last.
ifneq ($(findstring 2.6,$(PYTHON_VERSIONS)),)
$(BUILD_DIR)/%-2.7/.built:     $(BUILD_DIR)/%-2.6/.built
$(BUILD_DIR)/%-2.7/.installed: $(BUILD_DIR)/%-2.6/.installed
endif
ifneq ($(findstring 3.4,$(PYTHON_VERSIONS)),)
$(BUILD_DIR)/%-2.7/.built:     $(BUILD_DIR)/%-3.4/.built
$(BUILD_DIR)/%-2.7/.installed: $(BUILD_DIR)/%-3.4/.installed
endif
ifneq ($(findstring 3.5,$(PYTHON_VERSIONS)),)
$(BUILD_DIR)/%-2.7/.built:     $(BUILD_DIR)/%-3.5/.built
$(BUILD_DIR)/%-2.7/.installed: $(BUILD_DIR)/%-3.5/.installed
endif
# Create a distutils config file specific to the combination of build
@@ -128,11 +138,11 @@
# determine the type of tests we want to run.
ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR)/results-*.master)),)
TEST_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested)
TEST_32 = $(PYTHON_32_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested)
TEST_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested)
TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested)
else
TEST_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared)
TEST_32 = $(PYTHON_32_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared)
TEST_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared)
TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested-and-compared)
endif
make-rules/shared-macros.mk
@@ -148,6 +148,8 @@
PYTHON_VERSION =    2.7
PYTHON_VERSIONS =    2.7
PYTHON_64_ONLY_VERSIONS = 3.5
BASS_O_MATIC =    $(WS_TOOLS)/bass-o-matic
CLONEY =    $(WS_TOOLS)/cloney
@@ -613,6 +615,9 @@
PYTHON.3.4.VENDOR_PACKAGES.64 = /usr/lib/python3.4/vendor-packages/64
PYTHON.3.4.VENDOR_PACKAGES = $(PYTHON.3.4.VENDOR_PACKAGES.$(BITS))
PYTHON.3.5.VENDOR_PACKAGES.64 = /usr/lib/python3.5/vendor-packages
PYTHON.3.5.VENDOR_PACKAGES = $(PYTHON.3.5.VENDOR_PACKAGES.$(BITS))
ifeq   ($(strip $(PARFAIT_BUILD)),yes)
CC.studio.32 =    $(WS_TOOLS)/parfait/cc
CXX.studio.32 =    $(WS_TOOLS)/parfait/CC
@@ -661,6 +666,9 @@
PYTHON.3.4.32 =    /usr/bin/python3.4
PYTHON.3.4.64 =    /usr/bin/$(MACH64)/python3.4
PYTHON.3.5.32 =    /usr/bin/python3.5
PYTHON.3.5.64 =    /usr/bin/python3.5
PYTHON.32 =    $(PYTHON.$(PYTHON_VERSION).32)
PYTHON.64 =    $(PYTHON.$(PYTHON_VERSION).64)
PYTHON =    $(PYTHON.$(PYTHON_VERSION).$(BITS))
transforms/python-3-no-32bit
New file
@@ -0,0 +1,33 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
#
#
# For Python 3.5: drop the path with /64/ in it (i.e., we put the 64-bit
# library in the 32-bit path for simplicity), and tell pkglint that
# doing so is OK.
#
<transform file path=usr/lib/python3.5/vendor-packages(.*/64/).+\.so$ -> drop>
<transform file path=usr/lib/python3.5/vendor-packages(?!.*/64/).+\.so$ -> \
    add pkg.linted.userland.action001.2 true>