blob: 081a28edb509c58dfbd521de777b3def64142597 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
PORTNAME= gh
DISTVERSIONPREFIX= v
DISTVERSION= 1.11.0
CATEGORIES= devel
MAINTAINER= lcook@FreeBSD.org
COMMENT= GitHub's official command line tool
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= git:devel/git
USES= go:modules
_BUILD_VERSION= ${DISTVERSION}
_BUILD_DATE= $$(date +%Y-%m-%d)
GO_MODULE= github.com/cli/cli
GO_TARGET= ./cmd/${PORTNAME}
GO_BUILDFLAGS= -ldflags "\
-s -w \
-X ${GO_MODULE}/internal/build.Version=${_BUILD_VERSION} \
-X ${GO_MODULE}/internal/build.Date=${_BUILD_DATE}"
_DOCS= README.md docs/gh-vs-hub.md docs/releasing.md \
docs/command-line-syntax.md docs/source.md
PORTDOCS= ${_DOCS:T}
OPTIONS_DEFINE= COMPLETIONS DOCS MANPAGES
OPTIONS_DEFAULT= COMPLETIONS MANPAGES
OPTIONS_SUB= yes
COMPLETIONS_DESC= Build and install shell completions
do-build-COMPLETIONS-on:
.for SHELL in bash fish zsh
${GO_WRKDIR_BIN}/${PORTNAME} completion -s ${SHELL} > ${WRKSRC}/${SHELL}
.endfor
do-build-MANPAGES-on:
(cd ${WRKSRC} && \
${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} run ${GO_BUILDFLAGS} \
./cmd/gen-docs --man-page --doc-path docs/man 2>/dev/null)
post-install-COMPLETIONS-on:
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d \
${STAGEDIR}${PREFIX}/share/fish/vendor_completions.d \
${STAGEDIR}${PREFIX}/share/zsh/site-functions
${INSTALL_DATA} ${WRKSRC}/bash \
${STAGEDIR}${PREFIX}/etc/bash_completion.d/${PORTNAME}
${INSTALL_DATA} ${WRKSRC}/fish \
${STAGEDIR}${PREFIX}/share/fish/vendor_completions.d/${PORTNAME}.fish
${INSTALL_DATA} ${WRKSRC}/zsh \
${STAGEDIR}${PREFIX}/share/zsh/site-functions/_${PORTNAME}
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC} && \
${INSTALL_DATA} ${_DOCS} \
${STAGEDIR}${DOCSDIR})
post-install-MANPAGES-on:
${INSTALL_MAN} ${WRKSRC}/docs/man/*.1 \
${STAGEDIR}${MAN1PREFIX}/man/man1
.include <bsd.port.mk>
|