From 29d16a42da3e45cfa889d2a13d63b4b48827d51d Mon Sep 17 00:00:00 2001 From: Dmitri Goutnik Date: Fri, 20 Sep 2019 11:31:49 +0000 Subject: [PATCH] Go ports: cleanup, make use of the new GO_TARGET tuple syntax - Remove custom build/install targets left in place after r505321 - Switch to the new GO_TARGET tuple syntax introduced in r512001 Approved by: araujo (mentor) Differential Revision: https://reviews.freebsd.org/D21721 --- devel/awless/Makefile | 6 --- devel/gogs/Makefile | 6 +-- devel/grv/Makefile | 42 +++++++++---------- ...endor_gopkg.in_libgit2_git2go.v27_diff.go} | 4 +- ...pkg.in_libgit2_git2go.v27_git__dynamic.go} | 4 +- net-im/slack-term/Makefile | 7 ---- security/2fa/Makefile | 8 +--- sysutils/docker-credential-pass/Makefile | 5 +-- 8 files changed, 29 insertions(+), 53 deletions(-) rename devel/grv/files/{patch-src_gopkg.in_libgit2_git2go.v27_diff.go => patch-vendor_gopkg.in_libgit2_git2go.v27_diff.go} (75%) rename devel/grv/files/{patch-src_gopkg.in_libgit2_git2go.v27_git__dynamic.go => patch-vendor_gopkg.in_libgit2_git2go.v27_git__dynamic.go} (72%) diff --git a/devel/awless/Makefile b/devel/awless/Makefile index ab75c940bae1..cb14b3715c8e 100644 --- a/devel/awless/Makefile +++ b/devel/awless/Makefile @@ -22,12 +22,6 @@ OPTIONS_DEFINE= DOCS PLIST_FILES= bin/awless PORTDOCS= README.md CHANGELOG.md -do-build: - @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go build -o ${PORTNAME} ) - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin - do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} diff --git a/devel/gogs/Makefile b/devel/gogs/Makefile index 588b1071569f..6f9a794eb6a3 100644 --- a/devel/gogs/Makefile +++ b/devel/gogs/Makefile @@ -22,6 +22,8 @@ USE_GITHUB= yes GH_ACCOUNT= gogs GH_SUBDIR= src/github.com/${GH_ACCOUNT}/${PORTNAME} +GO_TARGET= :${PREFIX}/libexec/${PORTNAME}/${PORTNAME} + OPTIONS_DEFINE= DOCS USERS= git @@ -57,9 +59,7 @@ post-patch: -e 's|^DB_TYPE = mysql$$|DB_TYPE = sqlite3|' \ ${WRKSRC}/conf/app.ini -do-install: - @${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME} - ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${PORTNAME} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/ +post-install: ${INSTALL_SCRIPT} ${WRKDIR}/gogs ${STAGEDIR}${PREFIX}/bin/ ${INSTALL_SCRIPT} ${WRKDIR}/gogs-rm-data ${STAGEDIR}${PREFIX}/bin/ ${INSTALL_SCRIPT} ${WRKDIR}/gogs-service ${STAGEDIR}${PREFIX}/etc/rc.d/gogs diff --git a/devel/grv/Makefile b/devel/grv/Makefile index 04424b235bd1..b1b9da5c8043 100644 --- a/devel/grv/Makefile +++ b/devel/grv/Makefile @@ -18,21 +18,24 @@ USES= go ncurses pkgconfig readline:port USE_GITHUB= yes GH_ACCOUNT= rgburke GH_SUBDIR= src/github.com/rgburke/grv -GH_TUPLE= bradfitz:slice:2b758aa:slice/src/github.com/bradfitz/slice \ - camlistore:go4:94abd69:reflectutil/src/go4.org \ - davecgh:go-spew:d8f796a:spew/src/github.com/davecgh/go-spew \ - gobwas:glob:e7a84e9:glob/src/github.com/gobwas/glob \ - golang:crypto:a1f597e:crypto/src/golang.org/x/crypto \ - golang:sys:fead790:sys/src/golang.org/x/sys \ - mattn:go-runewidth:703b5e6:runewidth/src/github.com/mattn/go-runewidth \ - pmezard:go-difflib:5d4384e:difflib/src/github.com/pmezard/go-difflib \ - rgburke:goncurses:74f667a:goncurses/src/github.com/rgburke/goncurses \ - rjeczalik:notify:629144b:notify/src/github.com/rjeczalik/notify \ - Sirupsen:logrus:v1.4.0:logrus/src/github.com/Sirupsen/logrus \ - stretchr:objx:c61a9df:objx/src/github.com/stretchr/objx \ - stretchr:testify:34c6fa2:testify/src/github.com/stretchr/testify \ - tchap:go-patricia:v2.3.0:patricia/src/github.com/tchap/go-patricia \ - libgit2:git2go:ecaeb7a:git2go/src/gopkg.in/libgit2/git2go.v27 # Keep git2go branch in sync with devel/libgit2 version +GH_TUPLE= bradfitz:slice:2b758aa:slice/vendor/github.com/bradfitz/slice \ + camlistore:go4:94abd69:reflectutil/vendor/go4.org \ + davecgh:go-spew:d8f796a:spew/vendor/github.com/davecgh/go-spew \ + gobwas:glob:e7a84e9:glob/vendor/github.com/gobwas/glob \ + golang:crypto:a1f597e:crypto/vendor/golang.org/x/crypto \ + golang:sys:fead790:sys/vendor/golang.org/x/sys \ + mattn:go-runewidth:703b5e6:runewidth/vendor/github.com/mattn/go-runewidth \ + pmezard:go-difflib:5d4384e:difflib/vendor/github.com/pmezard/go-difflib \ + rgburke:goncurses:74f667a:goncurses/vendor/github.com/rgburke/goncurses \ + rjeczalik:notify:629144b:notify/vendor/github.com/rjeczalik/notify \ + Sirupsen:logrus:v1.4.0:logrus/vendor/github.com/Sirupsen/logrus \ + stretchr:objx:c61a9df:objx/vendor/github.com/stretchr/objx \ + stretchr:testify:34c6fa2:testify/vendor/github.com/stretchr/testify \ + tchap:go-patricia:v2.3.0:patricia/vendor/github.com/tchap/go-patricia \ + libgit2:git2go:ecaeb7a:git2go/vendor/gopkg.in/libgit2/git2go.v27 # Keep this in sync with devel/libgit2 version + +GO_TARGET= ./cmd/grv +GO_BUILDFLAGS= -ldflags "-X main.version=${PORTVERSION}" PLIST_FILES= bin/grv @@ -40,14 +43,9 @@ OPTIONS_DEFINE= DOCS PORTDOCS= * -do-build: - cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go build ./cmd/${PORTNAME} - do-test: - cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go test ./cmd/${PORTNAME} - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin + cd ${WRKSRC}; \ + ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} test ${GO_BUILDLAGS} ${GO_TARGET} do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} diff --git a/devel/grv/files/patch-src_gopkg.in_libgit2_git2go.v27_diff.go b/devel/grv/files/patch-vendor_gopkg.in_libgit2_git2go.v27_diff.go similarity index 75% rename from devel/grv/files/patch-src_gopkg.in_libgit2_git2go.v27_diff.go rename to devel/grv/files/patch-vendor_gopkg.in_libgit2_git2go.v27_diff.go index f1f0b9cbbefd..faf7e0fc7300 100644 --- a/devel/grv/files/patch-src_gopkg.in_libgit2_git2go.v27_diff.go +++ b/devel/grv/files/patch-vendor_gopkg.in_libgit2_git2go.v27_diff.go @@ -1,5 +1,5 @@ ---- src/gopkg.in/libgit2/git2go.v27/diff.go.orig 2018-07-05 13:56:38 UTC -+++ src/gopkg.in/libgit2/git2go.v27/diff.go +--- vendor/gopkg.in/libgit2/git2go.v27/diff.go.orig 2018-07-05 13:56:38 UTC ++++ vendor/gopkg.in/libgit2/git2go.v27/diff.go @@ -14,7 +14,7 @@ import ( "unsafe" ) diff --git a/devel/grv/files/patch-src_gopkg.in_libgit2_git2go.v27_git__dynamic.go b/devel/grv/files/patch-vendor_gopkg.in_libgit2_git2go.v27_git__dynamic.go similarity index 72% rename from devel/grv/files/patch-src_gopkg.in_libgit2_git2go.v27_git__dynamic.go rename to devel/grv/files/patch-vendor_gopkg.in_libgit2_git2go.v27_git__dynamic.go index d5872c077082..19fcda0962ea 100644 --- a/devel/grv/files/patch-src_gopkg.in_libgit2_git2go.v27_git__dynamic.go +++ b/devel/grv/files/patch-vendor_gopkg.in_libgit2_git2go.v27_git__dynamic.go @@ -1,7 +1,7 @@ Temporarily disable libgit2 version check in git2go until v0.28 tag is added. Upstream issue: https://github.com/libgit2/git2go/issues/502 ---- src/gopkg.in/libgit2/git2go.v27/git_dynamic.go.orig 2019-03-23 19:12:03 UTC -+++ src/gopkg.in/libgit2/git2go.v27/git_dynamic.go +--- vendor/gopkg.in/libgit2/git2go.v27/git_dynamic.go.orig 2019-03-23 19:12:03 UTC ++++ vendor/gopkg.in/libgit2/git2go.v27/git_dynamic.go @@ -6,9 +6,5 @@ package git #include #cgo pkg-config: libgit2 diff --git a/net-im/slack-term/Makefile b/net-im/slack-term/Makefile index 6f20d65f53e4..4c49027c9b4a 100644 --- a/net-im/slack-term/Makefile +++ b/net-im/slack-term/Makefile @@ -26,13 +26,6 @@ PLIST_FILES= bin/slack-term OPTIONS_DEFINE= DOCS -do-build: - cd ${WRKSRC}/${GH_SUBDIR} && \ - ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go build -o ${PORTNAME} - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin - do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} diff --git a/security/2fa/Makefile b/security/2fa/Makefile index d57bf63ac1e4..97e348fb8a1f 100644 --- a/security/2fa/Makefile +++ b/security/2fa/Makefile @@ -22,14 +22,8 @@ OPTIONS_DEFINE= DOCS PLIST_FILES= bin/2fa PORTDOCS= README.md -do-build: - @cd ${WRKSRC}/${GH_SUBDIR} && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go build -o ${PORTNAME} - do-test: - @cd ${WRKSRC}/${GH_SUBDIR} && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go test - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin + @cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} test ${GO_BUILDFLAGS} do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} diff --git a/sysutils/docker-credential-pass/Makefile b/sysutils/docker-credential-pass/Makefile index 75d93395a3e6..b66d0706c6ad 100644 --- a/sysutils/docker-credential-pass/Makefile +++ b/sysutils/docker-credential-pass/Makefile @@ -16,7 +16,7 @@ RUN_DEPENDS= ${LOCALBASE}/bin/pass:sysutils/password-store USES= go GO_PKGNAME= github.com/docker/docker-credential-helpers -GO_TARGET= ./pass/cmd +GO_TARGET= ./pass/cmd:${PORTNAME} USE_GITHUB= yes GH_ACCOUNT= docker @@ -28,7 +28,4 @@ pre-build: ${LN} -s ${GO_WRKSRC}/pass/cmd/main_linux.go ${GO_WRKSRC}/pass/cmd/main_freebsd.go ${LN} -s ${GO_WRKSRC}/pass/pass_linux.go ${GO_WRKSRC}/pass/pass_freebsd.go -do-install: - ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/cmd ${STAGEDIR}${PREFIX}/bin/${PORTNAME} - .include