pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
hub: Use lang/go/go-package.mk and inject `do-install'
Module Name: pkgsrc-wip
Committed By: Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By: leot
Date: Thu Feb 15 13:49:50 2018 +0100
Changeset: 38d9df43d96b87b9e860e4edc05af3ae1c2d962e
Modified Files:
hub/Makefile
Log Message:
hub: Use lang/go/go-package.mk and inject `do-install'
Instead of doing post-extract/do-build and other Go contortions
just reuse all the functionalities provided by `.../../lang/go/go-package.mk'.
This also simplify the Makefile a lot.
If we do not define do-install a lot of not needed files are automatically
installed (and usually this is not desiderable for Go packages that just provide
a binary). Inject do-install accordingly and also manually install the man page.
Thanks a lot to <bsiegert> for kindly pointing out that and for
suggesting to see www/caddy as example!
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=38d9df43d96b87b9e860e4edc05af3ae1c2d962e
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
hub/Makefile | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diffs:
diff --git a/hub/Makefile b/hub/Makefile
index 2c645a1165..93819b020b 100644
--- a/hub/Makefile
+++ b/hub/Makefile
@@ -10,29 +10,18 @@ HOMEPAGE= https://hub.github.com/
COMMENT= hub helps you win at git
LICENSE= mit
-WRKSRC= ${WRKDIR}/src/github.com/github/hub
+GO_DIST_BASE= ${DISTNAME}
+GO_SRCPATH= github.com/github/hub
-.include "../../lang/go/version.mk"
-
-BUILD_DEPENDS+= go-${GO_VERSION}*:../../lang/go
DEPENDS+= git-base>=1.7.3:../../devel/git-base
-MAKE_ENV+= GOPATH=${WRKDIR}:${PREFIX}/gopkg
-
INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1
CHECK_RELRO_SKIP+= bin/hub
-post-extract:
- ${MKDIR} ${WRKSRC}
- ${MV} ${WRKDIR}/${DISTNAME}/* ${WRKSRC}
-
-do-build:
- cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
- go build -ldflags "-X github.com/github/hub/version.Version=${PKGVERSION_NOREV}" -o bin/hub
-
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/bin/hub ${DESTDIR}${PREFIX}/bin
+ ${INSTALL_PROGRAM} ${WRKDIR}/bin/hub ${DESTDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/man/hub.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+.include "../../lang/go/go-package.mk"
.include "../../mk/bsd.pkg.mk"
Home |
Main Index |
Thread Index |
Old Index