5329N/A# The contents of this file are subject to the terms of the 5329N/A# Common Development and Distribution License (the "License"). 5329N/A# You may not use this file except in compliance with the License. 5329N/A# See the License for the specific language governing permissions 5329N/A# and limitations under the License. 5329N/A# When distributing Covered Code, include this CDDL HEADER in each 5329N/A# If applicable, add the following below this CDDL HEADER, with the 5329N/A# fields enclosed by brackets "[]" replaced with your own identifying 5329N/A# information: Portions Copyright [yyyy] [name of copyright owner] 5426N/A# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. 5329N/A# The golang build process just doesn't work with Parfait. 5329N/A# Go has a number of supplementary tools and packages that are located in 5329N/A# separate archives or source repositories. Because Go currently forces a 5329N/A# recompile of all packages whenever the compiler changes, building and 5329N/A# delivering them within the same build component build process is the best 5713N/A# The long-term plan for packaging Go is roughly as follows: 5329N/A# - when SPARC support is integrated into Go upstream, build upstream version 5329N/A# using system Go for x86, then build Go for SPARC using upstream version 5329N/A# just built for x86 (cross-compilation), package both at the same time 5329N/A# - after SPARC version has been available for at least a few builds in the 5329N/A# WOS, switch to building Go with system version for x86 and SPARC 5329N/A# Supplementary packages; these are delivered as source only for now as the 5329N/A# paths to the compiled packages are written directly into the binaries and 5329N/A# there's no way (currently) to fix that during the build process. 5329N/A# Desired "revision" of Go's "community" libraries; these are arbitrary 5329N/A# revisions chosen from the last commit to the respective repository at the 5329N/A# same time that this component was updated as there is no formal release 5329N/A# process for these packages. Whenever Go is updated, these should be as well. 5329N/A# Resulting hash of related git commit once archived. 5329N/A# Go package imports for lint are found in github directory. 5426N/A# Go's "not well-formed" elf objects confuse elfsign, which then causes 5426N/A# problems for RE. For now, we workaround this by adding the 5329N/A# Bake in where Go package will be installed. 5329N/A# Enable easier stack unwinding for debugging. 5329N/A# Install root for supplementary packages. 5329N/A# For convenience during installation of supplementary packages. 5329N/A# Simplify source copying for install by eliding patch detritus. 5329N/A# Avoid some of the default transforms: 5329N/A# - facet.doc wrongly assumes all things in a doc directory are documentation; 5329N/A# in Go's case, some are binaries 5329N/A# This requires completely redefining PUBLISH_TRANSFORMS for now. 5426N/A $(GSED) -e
's/^..\(.*\):.*$$/<transform file path=\1$$ -> \\\ 5329N/A# Building go from the source repository version requires that we set an 5329N/A# effective version and add some sort of unique identifier (in the case of 5329N/A# pre-release versions), so we use 'devel' + archive hash + date similar to how 5329N/A# Go internally determines one normally from git revision info. Uncomment the 5329N/A# block below when building from the upstream source repository: 5329N/A#COMPONENT_POST_UNPACK_ACTION= \ 5329N/A# $(MV) go-master $(COMPONENT_SRC) && \ 5329N/A# $(TOUCH) $(COMPONENT_SRC)/VERSION && \ 5329N/A# echo "devel $(shell digest -a md5 $(COMPONENT_ARCHIVE)) \ 5329N/A# $(shell date -u +'%a %b %e %T %Z %Y')" > \ 5329N/A# We have to fiddle with the package archives to get them into the same source 5329N/A# directory so that we can use the standard build targets. We're effectively 5329N/A# building multiple components using a single target. 5329N/A# Fixup compressed data affected by patches. 5329N/A# Go doesn't have a standard Makefile-based build process, so override the 5329N/A# We can't do any ASLR'ing as the Go 6l linker has no understanding of the 5329N/A# -z aslr=... option. So just override where needed in the .p5m files. 5778N/A# The timestamp is generated immediately once when the Makefile is evaluated to 5778N/A# ensure every package gets the same one. 5329N/A# Make sure the source code and object files have identical timestamps so 5329N/A# the Go compiler doesn't try to rebuild them. 5329N/A# Extra macros for packaging convenience. 5329N/A# COMPONENT_MAJOR_VERSION suitable for use in regular expressions. 5329N/A# Go's test suite does not have deterministic output or order, and as such, 5329N/A# success can only be determined by exit code, not by output comparison. 5795N/A# clear COMPONENT_POST_INSTALL_ACTION so we can append PERL_SCRIPTS_PROCESS 5329N/A# Magic to deliver supplemental package source into proto area. 5329N/A# Install supplementary packages (this cannot be done one-by-one); install 5329N/A# technically a build and install, but go's build command won't "install" 5329N/A# results, it only verifies a target can be built and dumps it into a temporary 5329N/A# The -trimpath option used here ensures that the paths recorded in the 5778N/A# pre-built packages do not contain the containing directory; the result is a 5778N/A# path that Go will evaluate relative to $GOPATH and so will pass the "stale" 5778N/A# object checks that Go performs at build time allowing reuse of the pre-built 5713N/A# Go's test suite is currently designed to be run from the build area. 5713N/A# Go 1.5 now bootstraps itself using 1.5; 1.6 will bootstrap using 1.5 as well. 5329N/A# Required to build man pages. 5329N/A# There's a single test script which requires perl. 5713N/A# Used for cgo support at runtime; we don't add a package dependency since cgo