From: czarkoff Date: Mon, 8 Jun 2015 09:23:01 +0000 (+0000) Subject: Update documentation for lang/go module X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3dcbfd30db9f8779bbdca415e8c63f04e7348692;p=openbsd Update documentation for lang/go module OK sthen@ --- diff --git a/share/man/man5/port-modules.5 b/share/man/man5/port-modules.5 index dc470468658..2e59d78f4b5 100644 --- a/share/man/man5/port-modules.5 +++ b/share/man/man5/port-modules.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: port-modules.5,v 1.188 2015/04/02 15:47:40 jmc Exp $ +.\" $OpenBSD: port-modules.5,v 1.189 2015/06/08 09:23:01 czarkoff Exp $ .\" .\" Copyright (c) 2008 Marc Espie .\" @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 2 2015 $ +.Dd $Mdocdate: June 8 2015 $ .Dt PORT-MODULES 5 .Os .Sh NAME @@ -734,6 +734,121 @@ command can be specified with .Ev MODGHC_SETUP_CONF_ARGS and .Ev MODGHC_SETUP_CONF_ENV . +.It lang/go +Adds Go toolchain support. +Requires +.Ev ALL_TARGET +to be set to canonical Go import path of port. +(Module sets it automatically for ports that use +.Ev GH_ACCOUNT +and +.Ev GH_PROJECT +macros.) +.Pp +During execution of +.Ar post-patch +target module moves source code from +.Pa ${MODGO_SUBDIR} +to +.Pa ${WRKSRC} , +subdirectory of +.Pa ${MODGO_WORKSPACE} +- specially-crafted Go workspace located at +.Pa ${WRKDIR}/go . +During +.Ar do-build +module calls +.Dq go install +with +.Ev GOPATH +set to +.Pa ${MODGO_WORKSPACE} , +runs its output through sed to prevent writes outside +.Ev WRKDIR +sandbox and sends output to +.Xr sh 1 . +During +.Ar do-install +it copies executables from +.Pa ${MODGO_WORKSPACE}/bin +to +.Pa ${PREFIX}/bin , +and/or directories +.Pa ${MODGO_WORKSPACE}/pkg +and +.Pa ${MODGO_WORKSPACE}/src +to +.Pa ${PREFIX}/go , +depending on +.Ev MODGO_TYPE +contents. +.Pp +Sets +.Ev BUILD_DEPENDS , +.Ev RUN_DEPENDS , +.Ev ALL_TARGET , +.Ev TEST_TARGET , +.Ev ONLY_FOR_ARCHS , +.Ev SEPARATE_BUILD , +and +.Ev WRKSRC . +.Pp +Defines: +.Bl -tag -width MODGO_WORKSPACE +.It Ev MODGO_TYPE +Type of port. +May be any combination of: +.Bl -tag -width lib +.It bin +ordinary binary, which should be installed to +.Pa ${PREFIX}/bin , +.It lib +library, which should come with source code. +.El +.Pp +Defaults to +.Ar bin . +.It Ev MODGO_WORKSPACE +Path to Go workspace set up for port build process. +Defaults to +.Pa ${WRKDIR}/go . +See Go documentation for details. +.It Ev MODGO_SUBDIR +Path to Go source code within port's sources tarball. +Defaults to +.Pa ${WRKDIST} . +.It Ev MODGO_SETUP_WORKSPACE +Commands setting up Go workspace for building ports. +By default, happens during execution of +.Ar post-patch +target. +.It Ev MODGO_BUILDDEP +Controls whether contents of +.Ev MODGO_BUILD_DEPENDS +are appended to port's +.Ev BUILD_DEPENDS . +Defaults to +.Ar Yes . +.El +.Pp +Additionally defines +.Ev MODGO_PACKAGES , +.Ev MODGO_SOURCES +and +.Ev MODGO_TOOLS +(paths for installed Go packages, sources and tools respectively), +.Ev MODGO_CMD +and +.Ev MODGO_FLAGS +(source code build command and flags passed as its arguments), +.Ev MODGO_BUILD_CMD +and +.Ev MODGO_TEST_CMD +(commands for building and testing go packages; normally called with canonical +Go package names as arguments), +.Ev MODGO_{BUILD,INSTALL,TEST}_TARGET +and +.Ev MODGO_{BUILD,RUN}_DEPENDS . .It lang/lua Sets .Ev MODLUA_BIN ,