FreeBSD Bugzilla – Attachment 164250 Details for
Bug 205282
[NEW MODULE] Mk/Uses/go.mk Framework for Go projects/ports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
mk-go.patch (text/plain), 5.04 KB, created by
Yuri Victorovich
on 2015-12-15 01:30:14 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2015-12-15 01:30:14 UTC
Size:
5.04 KB
patch
obsolete
>diff -ruN Mk1/Uses/go.mk Mk2/Uses/go.mk >--- Mk1/Uses/go.mk 1969-12-31 16:00:00.000000000 -0800 >+++ Mk2/Uses/go.mk 2015-12-14 17:28:39.756802000 -0800 >@@ -0,0 +1,115 @@ >+# $FreeBSD$ >+# >+# Provide support for NodeJS based projects >+# >+# Feature: go >+# Usage: USES=go >+# >+# MAINTAINER: portmgr@FreeBSD.org >+ >+# GO_MAIN_PATH : where is the main part of the project, >+# main distfile is extracted there and build >+# is performed >+# GO_EXTRA_PATH : additional directory to perform the build in >+# GO_ARGS : arguments to supply to the go command >+# GO_TAGS : tags to use with the go command >+# GO_PATCH_FLAGS : C/C++ go-files that need to have the CFLAGS or LDFLAGS set >+# GO_PATCH_FLAGS_CFLAGS : CFLAGS to supply to GO_PATCH_FLAGS >+# GO_PATCH_FLAGS_LDFLAGS : LDFLAGS to supply to GO_PATCH_FLAGS >+# >+# Port's Makefile should supply these items: >+# * base go packages in GO_BASE in the form: commit-tag:package ... >+# * (optional) the list of packages from GitHub in GH_TUPLE variable >+# account:project:tagname:group:gh (with suffix :gh) >+# * (optional) the list of go modules in the form >+# account:project:tagname:group:version#:pkg (with suffix :pkg) >+# >+# Framework installs one executable: ${LOCALBASE}/libexec/${PORTNAME}. >+# In post-install port is expected to add symbolic links or services >+# that use this executable. >+# >+ >+.if !defined(_INCLUDE_USES_GO_MK) >+_INCLUDE_USES_GO_MK= yes >+ >+# depends >+BUILD_DEPENDS+= go:${PORTSDIR}/lang/go >+ >+# commands >+GO_CMD?= ${LOCALBASE}/bin/go >+ >+GO_MAIN_PATH?= github.com/${GH_TUPLE:N*\:*\:*\:*:C@:[^:]+$@@:C@:@/@} >+GO_MAIN_BUILD_PATH?= ${GO_MAIN_PATH} >+ >+# internal variables >+_GO_DIR?= ${PORTNAME}-${PORTVERSION} >+_GO_DO_FAIL?= return 1 >+GO_PATCH_FLAGS_CFLAGS?= ${CFLAGS} -I${LOCALBASE}/include >+GO_PATCH_FLAGS_LDFLAGS?=${LDFLAGS} -L${LOCALBASE}/lib >+ >+# paths and environment >+WRKSRC= ${WRKDIR}/${_GO_DIR} >+GOPATH:= ${WRKSRC} >+GO_ENV+= GOPATH=${GOPATH} >+.for opt in ${OPTIONS_FILE_SET} >+GO_TAGS+= ${${opt}_GO_TAGS} >+.endfor >+.if defined(GO_TAGS) >+GO_ARGS+= -tags="${GO_TAGS}" >+.endif >+ >+# distfiles >+.for _GO_BASE_ONE in ${GO_BASE} >+#MASTER_SITES+= https://go.googlesource.com/${_GO_BASE_ONE:C@.*:@@}/+archive/${_GO_BASE_ONE:C@:.*@@}.tar.gz?dummy=/:golang-${_GO_BASE_ONE:C@.*:@@} >+MASTER_SITES+= https://codeload.github.com/golang/${_GO_BASE_ONE:C@.*:@@}/tar.gz/${_GO_BASE_ONE:C@:.*@@}?dummy=/:golang-${_GO_BASE_ONE:C@.*:@@} >+#https://codeload.github.com/coreos/etcd/tar.gz/v2.2.2?dummy=/coreos-etcd-v2.2.2_GH0.tar.gz >+#DISTFILES+= golang-${_GO_BASE_ONE:C@.*:@@}-${_GO_BASE_ONE:C@:.*@@}.tgz:golang-${_GO_BASE_ONE:C@.*:@@} >+DISTFILES+= golang-${_GO_BASE_ONE:C@.*:@@}-${_GO_BASE_ONE:C@:.*@@}.tar.gz:golang-${_GO_BASE_ONE:C@.*:@@} >+.endfor >+ >+# targets >+_GO_GH_TUPLE_GH= ${GH_TUPLE:M*\:*\:*\:*\:gh:C@:gh@@} >+_GO_GH_TUPLE_PKG= ${GH_TUPLE:M*\:pkg:C@:pkg$@@} >+ >+do-extract: >+ @${MKDIR} ${WRKDIR}/${_GO_DIR} && \ >+ cd ${WRKDIR}/${_GO_DIR} && \ >+ ${MKDIR} src/${GO_MAIN_PATH} && \ >+ ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${DISTFILES:N*\:*} ${EXTRACT_AFTER_ARGS} \ >+ -C src/${GO_MAIN_PATH} --strip 1 && \ >+ ${ECHO} ${_GO_GH_TUPLE_GH:M*\:*\:*\:*:C@:@ @g} | xargs -n4 \ >+ ${SH} -c 'acc=$$0;proj=$$1;h=$$2;grp=$$3; df=$$(echo ${DISTFILES} | tr " " "\\n" | grep ":$${grp}$$" | ${SED} -e "s/:.*//g"); \ >+ '"${MKDIR} src/github.com/"'$$acc'"/"'$$proj'"; \ >+ ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} "'${DISTDIR}/$${df}'" ${EXTRACT_AFTER_ARGS} -C src/github.com/"'$$acc'"/"'$$proj'" --strip 1" && \ >+ ${ECHO} ${_GO_GH_TUPLE_PKG:M*\:*\:*\:*:C@:@ @g} | xargs -n5 \ >+ ${SH} -c 'acc=$$0;proj=$$1;h=$$2;grp=$$3;vers=$$4; df=$$(echo ${DISTFILES} | tr " " "\\n" | grep ":$${grp}$$" | ${SED} -e "s/:.*//g"); \ >+ '"${MKDIR} src/gopkg.in/"'$${proj}.$${vers}'"; \ >+ ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} "'${DISTDIR}/$${df}'" ${EXTRACT_AFTER_ARGS} -C src/gopkg.in/"'$${proj}.$${vers}'" --strip 1" && \ >+ ${ECHO} ${GO_BASE} | ${SED} -e 's/:/ /g' | xargs -n2 \ >+ ${SH} -c 'pkg=$$1; df=$$(echo ${DISTFILES} | tr " " "\\n" | grep ":golang-$${pkg}$$" | ${SED} -e "s/:.*//g"); \ >+ '"${MKDIR} src/golang.org/x/"'$$pkg'"; \ >+ ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} "'${DISTDIR}/$${df}'" ${EXTRACT_AFTER_ARGS} -C src/golang.org/x/"'$${pkg} --strip 1' >+ >+_USES_patch+= 750:go-patch-cflags >+go-patch-cflags: >+.for gofile in ${GO_PATCH_FLAGS} >+ @${AWK} '/^\/\*([^*]|\*[^\/])*$$/ {print;print "#cgo CFLAGS: ${GO_PATCH_FLAGS_CFLAGS}";print "#cgo LDFLAGS: ${GO_PATCH_FLAGS_LDFLAGS}"} /^([^\/]|\/[^*]).*$$/ {print} /^$$/ {print}' \ >+ < ${WRKSRC}/${gofile} > ${WRKSRC}/${gofile}.new && \ >+ ${MV} ${WRKSRC}/${gofile}.new ${WRKSRC}/${gofile} >+.endfor >+ >+do-build: >+ @for dir in ${GO_MAIN_BUILD_PATH} ${GO_EXTRA_PATH}; do \ >+ ${ECHO} "===> Building in the Go directory $$dir" && \ >+ (cd ${GOPATH}/src/$$dir && \ >+ ${GO_ENV} ${GO_CMD} build ${GO_ARGS}) || ${_GO_DO_FAIL}; \ >+ done >+ >+# install: only install when one simple program is produced >+ >+.if !target(do-install) >+do-install: >+ ${INSTALL_PROGRAM} ${WRKSRC}/src/${GO_MAIN_PATH}/${PORTNAME} ${STAGEDIR}${LOCALBASE}/bin/ >+ >+.endif >+.endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 205282
:
164172
|
164174
|
164226
|
164246
|
164250
|
164255