components/python/pycairo/Makefile
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Wed, 21 Sep 2016 19:51:41 -0700
changeset 6956 35dd98776277
child 6961 7dd9e3f6e602
permissions -rw-r--r--
17702953 Cairo bindings for Python 3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6956
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     1
#
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     2
# CDDL HEADER START
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     3
#
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     7
#
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    11
# and limitations under the License.
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    12
#
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    18
#
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    19
# CDDL HEADER END
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    20
#
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    21
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    22
#
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    23
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    24
#
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    25
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    26
BUILD_BITS =            64
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    27
include ../../../make-rules/shared-macros.mk
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    28
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    29
COMPONENT_NAME=		pycairo
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    30
COMPONENT_VERSION=	1.10.0
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    31
COMPONENT_PROJECT_URL=	http://cairographics.org/pycairo/
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    32
COMPONENT_ARCHIVE=      $(COMPONENT_NAME)-$(COMPONENT_VERSION).tar.bz2
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    33
COMPONENT_ARCHIVE_HASH=	\
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    34
    sha256:9aa4078e7eb5be583aeabbe8d87172797717f95e8c4338f0d4a17b683a7253be
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    35
COMPONENT_ARCHIVE_URL=	http://cairographics.org/releases/$(COMPONENT_ARCHIVE)
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    36
COMPONENT_BUGDB=	python-mod/pycairo
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    37
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    38
TPNO=			30739
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    39
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    40
# upstream delivers python2 support separately as "py2cairo"
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    41
PYTHON_VERSIONS=        $(PYTHON3_VERSIONS)
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    42
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    43
BUILD_STYLE= waf
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    44
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    45
# replicated from $(WS_MAKE_RULES)/setup.py.mk since this uses waf.mk instead
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    46
CONFIGURE_64 = $(PYTHON3_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.configured)
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    47
BUILD_64     = $(PYTHON3_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    48
INSTALL_64   = $(PYTHON3_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    49
TEST_64      = $(PYTHON3_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared)
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    50
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    51
# Cannot run tests until build machines update to s12_105 due to bug 23763105
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    52
TEST_TARGET = $(SKIP_TEST)
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    53
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    54
include $(WS_MAKE_RULES)/common.mk
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    55
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    56
# Trick bundled waf into unpacking itself so we can patch it
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    57
COMPONENT_POST_UNPACK_ACTION += \
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    58
	(cd $(@D) ; $(PYTHON.3.5) waf --help >> /dev/null );
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    59
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    60
# Do not install optimised compiled .pyo files
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    61
CONFIGURE_OPTIONS += --nopyo
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    62
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    63
# The bundled waf compiles to the old pre-python-3.2 locations, so
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    64
# tell it not to bother, and take care of it ourselves
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    65
CONFIGURE_OPTIONS += --nopyc
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    66
COMPONENT_POST_INSTALL_ACTION += \
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    67
	$(PYTHON) -m compileall $(PROTO_DIR)$(PYTHON_LIB)/cairo ;
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    68
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    69
# waf picks up the PYTHONDIR & PYTHONARCHDIR settings at configure time,
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    70
# but still insists on installing to site-packages instead of vendor-packages
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    71
PYTHON_SITE_DIR = $(USRLIB)/python$(PYTHON_VERSION)/site-packages
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    72
COMPONENT_PRE_INSTALL_ACTION += \
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    73
	$(MKDIR) $(PROTO_DIR)$(PYTHON_LIB)/cairo \
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    74
		 $(PROTO_DIR)$(PYTHON_SITE_DIR) ; \
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    75
	$(RM) -r $(PROTO_DIR)$(PYTHON_SITE_DIR) ; \
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    76
	$(LN) -s $(PROTO_DIR)$(PYTHON_LIB) $(PROTO_DIR)$(PYTHON_SITE_DIR) ; \
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    77
	$(RM) -r $(PROTO_DIR)$(PYTHON_LIB)/cairo/64 ; \
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    78
	$(LN) -s . $(PROTO_DIR)$(PYTHON_LIB)/cairo/64
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    79
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    80
# the test scripts aren't hooked into the test target in pycairo, so run directly
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    81
COMPONENT_TEST_DIR = $(@D)/test
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    82
COMPONENT_TEST_CMD = /usr/bin/py.test-$(PYTHON_VERSION)
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    83
COMPONENT_TEST_TARGETS =
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    84
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    85
REQUIRED_PACKAGES += library/desktop/cairo
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    86
REQUIRED_PACKAGES += runtime/python-34
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    87
REQUIRED_PACKAGES += runtime/python-35
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    88
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    89
# py.test is required for testing, not building or runtime
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    90
REQUIRED_PACKAGES += library/python/pytest
35dd98776277 17702953 Cairo bindings for Python 3
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    91