python/types-six: update to 1.16.21.20241105
[oi-userland.git] / make-rules / prep-unpack.mk
blob77de2803ec4ea014fd4b0711072ffb22f81415b7
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.
22 # Copyright (c) 2018, Michal Nowak
25 UNPACK = $(WS_TOOLS)/userland-unpack
28 # Anything that we downloaded and want to unpack must have a
29 # COMPONENT_ARCHIVE{_[0-9]+} macro.
31 PCK_SUFFIXES = $(subst COMPONENT_ARCHIVE_,, \
32 $(filter COMPONENT_ARCHIVE_%, $(.VARIABLES)))
34 # Template for unpacking rules.
35 define unpack-rules
36 ifdef COMPONENT_ARCHIVE$(1)
37 ifdef COMPONENT_SRC$(1)
39 CLEAN_PATHS += $$(COMPONENT_SRC$(1))
40 SOURCE_DIR$(1) = $$(COMPONENT_DIR)/$$(COMPONENT_SRC$(1))
42 UNPACK_STAMP$(1) = $$(SOURCE_DIR$(1))/.unpacked
44 # RUBY_VERSION is passed on to ensure userland-unpack uses the
45 # correct gem command for the ruby version specified
46 $$(UNPACK_STAMP$(1)): $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)) $(MAKEFILE_PREREQ) download
47 $$(RM) -r $$(SOURCE_DIR$(1))
48 $(ENV) RUBY_VERSION=$(RUBY_VERSION) \
49 $$(UNPACK) $$(UNPACK_ARGS$(1)) $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
50 $$(COMPONENT_POST_UNPACK_ACTION$(1))
51 $$(TOUCH) $$@
53 unpack:: $$(UNPACK_STAMP$(1))
55 USERLAND_REQUIRED_PACKAGES += archiver/gnu-tar
56 USERLAND_REQUIRED_PACKAGES += compress/bzip2
57 USERLAND_REQUIRED_PACKAGES += compress/gzip
58 USERLAND_REQUIRED_PACKAGES += compress/p7zip
59 USERLAND_REQUIRED_PACKAGES += compress/unzip
60 USERLAND_REQUIRED_PACKAGES += compress/lzip
61 USERLAND_REQUIRED_PACKAGES += compress/xz
62 USERLAND_REQUIRED_PACKAGES += compress/zip
63 USERLAND_REQUIRED_PACKAGES += compress/zstd
64 USERLAND_REQUIRED_PACKAGES += developer/java/openjdk8
65 USERLAND_REQUIRED_PACKAGES += runtime/ruby
67 endif
68 endif
69 endef
72 # Define the rules required to download any source archives and augment any
73 # cleanup macros.
75 $(eval $(call unpack-rules,))
76 $(foreach suffix, $(PCK_SUFFIXES), $(eval $(call unpack-rules,_$(suffix))))