make-rules/prep-unpack.mk
author Swaroop M S <swaroop.sadare@oracle.com>
Sat, 15 Oct 2016 10:57:06 +0530
changeset 7122 630f5a510c0a
parent 6911 7b878dfe6f0d
child 7860 8991c11f87b1
permissions -rw-r--r--
24824548 ghostscript package breakup breaks graphviz/libspectre
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4196
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     1
#
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     2
# CDDL HEADER START
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     3
#
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     7
#
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    11
# and limitations under the License.
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    12
#
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    18
#
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    19
# CDDL HEADER END
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    20
#
5682
94c0ca64c022 15558602 TCL_LD_SEARCH_FLAGS is wrongly defined in tclConfig.sh
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5678
diff changeset
    21
94c0ca64c022 15558602 TCL_LD_SEARCH_FLAGS is wrongly defined in tclConfig.sh
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5678
diff changeset
    22
#
5477
5eabbdf042bc PSARC/2015/113 Add Ruby 2.1 and EOF and Remove Ruby 1.9
April Chin <april.chin@oracle.com>
parents: 4953
diff changeset
    23
# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
4196
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    24
#
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    25
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    26
UNPACK =		$(WS_TOOLS)/userland-unpack
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    27
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    28
#
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    29
# Anything that we downloaded and want to unpack must have a
6911
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    30
# COMPONENT_ARCHIVE{_[0-9]+} macro.  Filter out a handful of
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    31
# well-known macros that don't correspond to extra archives.
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    32
#
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    33
PCK_SUFFIXES = $(filter-out HASH OVERRIDE SRC URL, $(subst COMPONENT_ARCHIVE_,, \
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    34
                $(filter COMPONENT_ARCHIVE_%, $(.VARIABLES))))
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    35
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    36
# Templates for unpacking variables and rules.  We separate the variable
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    37
# assignments from the rules so that all the variable assignments are given a
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    38
# chance to complete before those variables are used in targets or
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    39
# prerequisites, where they'll be expanded immediately.
4196
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    40
#
6911
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    41
# Some components don't have an archive that we download, but host their source
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    42
# directly in the repo, and a separate unpacking step will fail.  So we don't do
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    43
# any unpacking if COMPONENT_ARCHIVE_SRC is "none", and rely on such components
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    44
# to set that variable specifically.
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    45
#
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    46
# The reason we don't condition on an empty COMPONENT_ARCHIVE is that any
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    47
# components that rely on that being set by default by prep.mk won't have it set
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    48
# for this conditional.  It's easier to make the very few archive-less
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    49
# components declare themselves rather than force everyone else to use
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    50
# boilerplate code to name their archives.
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    51
define unpack-variables
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    52
ifneq ($(strip $(COMPONENT_ARCHIVE_SRC$(1))),none)
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    53
CLEAN_PATHS += $$(COMPONENT_SRC$(1))
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    54
SOURCE_DIR$(1) = $$(COMPONENT_SRC$(1):%=$$(COMPONENT_DIR)/%)
4196
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    55
6911
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    56
UNPACK_STAMP$(1) =	$$(SOURCE_DIR$(1):%=%/.unpacked)
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    57
endif
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    58
endef
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    59
4196
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    60
define unpack-rules
6911
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    61
ifneq ($(strip $(COMPONENT_ARCHIVE_SRC$(1))),none)
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    62
# RUBY_VERSION is passed on to ensure userland-unpack uses the
5477
5eabbdf042bc PSARC/2015/113 Add Ruby 2.1 and EOF and Remove Ruby 1.9
April Chin <april.chin@oracle.com>
parents: 4953
diff changeset
    63
# correct gem command for the ruby version specified
4196
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    64
$$(UNPACK_STAMP$(1)):	$$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)) download
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    65
	$$(RM) -r $$(SOURCE_DIR$(1))
5477
5eabbdf042bc PSARC/2015/113 Add Ruby 2.1 and EOF and Remove Ruby 1.9
April Chin <april.chin@oracle.com>
parents: 4953
diff changeset
    66
	$(ENV) RUBY_VERSION=$(RUBY_VERSION) \
4196
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    67
	$$(UNPACK) $$(UNPACK_ARGS$(1)) $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    68
	$$(COMPONENT_POST_UNPACK_ACTION$(1))
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    69
	$$(TOUCH) $$@
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    70
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    71
unpack::	$$(UNPACK_STAMP$(1))
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    72
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    73
REQUIRED_PACKAGES += archiver/gnu-tar
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    74
REQUIRED_PACKAGES += compress/bzip2
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    75
REQUIRED_PACKAGES += compress/gzip
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    76
REQUIRED_PACKAGES += compress/p7zip
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    77
REQUIRED_PACKAGES += compress/unzip
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    78
REQUIRED_PACKAGES += compress/xz
4953
0c9477f5bdd7 21954633 rabbitmq needs zip to build
John Beck <John.Beck@Oracle.COM>
parents: 4251
diff changeset
    79
REQUIRED_PACKAGES += compress/zip
5678
5b527c1e97be 23018419 remove java7 dependency from userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 5477
diff changeset
    80
REQUIRED_PACKAGES += developer/java/jdk-8
4196
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    81
REQUIRED_PACKAGES += runtime/ruby
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    82
endif
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    83
endef
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    84
6911
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    85
# Evaluate the variable assignments immediately.
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    86
$(eval $(call unpack-variables,))
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    87
$(foreach suffix, $(PCK_SUFFIXES), $(eval $(call unpack-variables,_$(suffix))))
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    88
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    89
# Put the rule evaluations in a variable for deferred evaluation.
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    90
define eval-unpack-rules
4196
d697072a92f5 19782029 userland should be able to build from SCM repositories
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    91
$(eval $(call unpack-rules,))
4251
2bf7e2c1ca74 21029374 probably shouldn't overload TMP_SUFFIXES in userland fragments
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 4196
diff changeset
    92
$(foreach suffix, $(PCK_SUFFIXES), $(eval $(call unpack-rules,_$(suffix))))
6911
7b878dfe6f0d 24661161 COMPONENT_SRC and COMPONENT_ARCHIVE are un-overridable in prep-*.mk
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    93
endef