Revert "gcc-6: drop documentation patches"
[unleashed-userland.git] / make-rules / prep-unpack.mk
blob5da24f2f6ad67953579226c237416678c9ed2564
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) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
24 UNPACK = $(WS_TOOLS)/userland-unpack
27 # Anything that we downloaded and want to unpack must have a
28 # COMPONENT_ARCHIVE{_[0-9]+} macro.
30 PCK_SUFFIXES = $(subst COMPONENT_ARCHIVE_,, \
31 $(filter COMPONENT_ARCHIVE_%, $(.VARIABLES)))
33 # Template for unpacking rules.
34 define unpack-rules
35 ifdef COMPONENT_ARCHIVE$(1)
36 ifdef COMPONENT_SRC$(1)
38 CLEAN_PATHS += $$(COMPONENT_SRC$(1))
39 SOURCE_DIR$(1) = $$(COMPONENT_DIR)/$(COMPONENT_SRC$(1))
41 UNPACK_STAMP$(1) = $$(SOURCE_DIR$(1))/.unpacked
43 # RUBY_VERSION is passed on to ensure userland-unpack uses the
44 # correct gem command for the ruby version specified
45 $$(UNPACK_STAMP$(1)): $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)) download
46 $$(RM) -r $$(SOURCE_DIR$(1))
47 $(ENV) RUBY_VERSION=$(RUBY_VERSION) \
48 $$(UNPACK) $$(UNPACK_ARGS$(1)) $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
49 $$(COMPONENT_POST_UNPACK_ACTION$(1))
50 $$(TOUCH) $$@
52 unpack:: $$(UNPACK_STAMP$(1))
54 REQUIRED_PACKAGES += archiver/gnu-tar
55 REQUIRED_PACKAGES += compress/bzip2
56 REQUIRED_PACKAGES += compress/gzip
57 REQUIRED_PACKAGES += compress/p7zip
58 REQUIRED_PACKAGES += compress/unzip
59 REQUIRED_PACKAGES += compress/xz
60 REQUIRED_PACKAGES += compress/zip
61 REQUIRED_PACKAGES += developer/java/openjdk7
62 REQUIRED_PACKAGES += runtime/ruby
64 endif
65 endif
66 endef
69 # Define the rules required to download any source archives and augment any
70 # cleanup macros.
72 $(eval $(call unpack-rules,))
73 $(foreach suffix, $(PCK_SUFFIXES), $(eval $(call unpack-rules,_$(suffix))))