pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint pkgtools/pkglint: don't access the in...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8688eb15cbf1
branches:  trunk
changeset: 387146:8688eb15cbf1
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Nov 10 11:41:40 2018 +0000

description:
pkgtools/pkglint: don't access the internet during the build

Pkglint needs goyacc, which is provided by devel/go-tools. But that
packages pulls in a lot of dependencies that are not needed for pkglint.
This includes a Perl interpreter and various cryptography packages.

Instead, during build, pkglint installs the only needed tool of that
collection (goyacc).

Since go-package.mk assumes that each pkgsrc package only downloads and
installs a single project, but pkglint now needs two of them (goyacc and
pkglint), most parts of go-package.mk had to be copied here and
implemented directly.

diffstat:

 pkgtools/pkglint/Makefile |  59 ++++++++++++++++++++++++++--------------------
 pkgtools/pkglint/distinfo |   6 ++++
 2 files changed, 39 insertions(+), 26 deletions(-)

diffs (112 lines):

diff -r 0072a081bc48 -r 8688eb15cbf1 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sat Nov 10 10:40:55 2018 +0000
+++ b/pkgtools/pkglint/Makefile Sat Nov 10 11:41:40 2018 +0000
@@ -1,8 +1,11 @@
-# $NetBSD: Makefile,v 1.555 2018/11/08 19:41:32 rillig Exp $
+# $NetBSD: Makefile,v 1.556 2018/11/10 11:41:40 rillig Exp $
 
 PKGNAME=       pkglint-5.6.6
-DISTFILES=     # none
 CATEGORIES=    pkgtools
+DISTNAME=      tools
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=golang/}
+GITHUB_PROJECT=        tools
+GITHUB_TAG=    92d8274bd7b8a4c65f24bafe401a029e58392704
 
 MAINTAINER=    rillig%NetBSD.org@localhost
 HOMEPAGE=      https://github.com/rillig/pkglint
@@ -10,56 +13,60 @@
 LICENSE=       2-clause-bsd
 CONFLICTS+=    pkglint4-[0-9]*
 
-NO_CHECKSUM=   yes
-USE_TOOLS+=    pax
-AUTO_MKDIRS=   yes
-GO_SRCPATH=    netbsd.org/pkglint
+USE_TOOLS+=            pax
+AUTO_MKDIRS=           yes
+GO_SRCPATH=            golang.org/x/tools
+GO_DIST_BASE=          ${GO_SRCPATH}
+GO_BUILD_PATTERN=      netbsd.org/pkglint/...
 
 CHECK_RELRO_SKIP+=     bin/pkglint
 
 SUBST_CLASSES+=                pkglint
 SUBST_STAGE.pkglint=   post-configure
-SUBST_FILES.pkglint+=  pkglint.go
-SUBST_SED.pkglint+=    -e s\|@VERSION@\|${PKGNAME:S/pkglint-//}\|g
+SUBST_FILES.pkglint+=  ${WRKSRC.pkglint}/pkglint.go
+SUBST_SED.pkglint+=    -e s\|@VERSION@\|${PKGVERSION}\|g
 SUBST_SED.pkglint+=    -e s\|@BMAKE@\|${MAKE:T:Q}\|g
 
-TOOLS_CREATE+=         goyacc
-TOOLS_PATH.goyacc=     ${WRKDIR}/bin/goyacc
-USE_TOOLS+=            goyacc
-
 # This needs to come before bsd.prefs.mk so that SSP_SUPPORTED is properly set.
 .include "../../lang/go/go-package.mk"
+WRKSRC=                ${WRKDIR}/src   # Is set unconditionally by go-package.mk
 
 .include "../../mk/bsd.prefs.mk"
 
-do-extract:
-       ${RUN} ${MKDIR} ${WRKDIR}/pkglint
-       ${RUN} cd ${FILESDIR} && ${PAX} -rw . ${WRKDIR}/pkglint
-.if !${PKGSRC_RUN_TEST:M[yY][eE][sS]}
-       ${RUN} rm -rf ${WRKDIR}/pkglint/intqa
-.endif
-       ${RUN} ${PKGSRC_SETENV} ${MAKE_ENV} ${GO} get golang.org/x/tools/cmd/goyacc
-       ${RUN} ${PKGSRC_SETENV} ${MAKE_ENV} ${GO} install golang.org/x/tools/cmd/goyacc
+EXTRACT_PAX_ARGS=      ${"${PKGSRC_RUN_TEST:M[yY][eE][sS]}" :?: -s '|.*/intqa/.*||'}
+
+WRKSRC.tools=          ${WRKSRC}/golang.org/x/tools
+WRKSRC.pkglint=                ${WRKSRC}/netbsd.org/pkglint
+
+post-extract:
+       ${RUN} ${MKDIR} ${WRKSRC.pkglint}
+       ${RUN} cd ${FILESDIR} && ${PAX} -rw ${EXTRACT_PAX_ARGS} . ${WRKSRC.pkglint}
+
+       ${RUN} ${MKDIR} ${WRKSRC.tools}
+       ${RUN} ${MV} ${WRKDIR}/tools-*/* ${WRKSRC.tools}
 
 pre-build:
+       ${RUN} ${PKGSRC_SETENV} ${MAKE_ENV} ${GO} install -v golang.org/x/tools/cmd/goyacc
        ${RUN} ${PKGSRC_SETENV} ${MAKE_ENV} ${GO} generate ${GO_BUILD_PATTERN}
 
-pre-install:
-       ${RUN} rm -f ${WRKDIR}/bin/goyacc
-       ${RUN} rm -rf ${WRKDIR}/pkg
+do-test:
+       ${RUN} ${PKGSRC_SETENV} ${MAKE_ENV} ${GO} test -vet=off -v ${GO_BUILD_PATTERN}
+
+do-install:
+       ${RUN} cd ${WRKDIR} && pax -rw bin/pkglint ${DESTDIR}/${PREFIX}
 
 post-install: do-install-man
 
 do-install-man: .PHONY
 .if ${MANINSTALL:Mcatinstall}
 .  if ${CATMAN_SECTION_SUFFIX:M[Yy][Ee][Ss]}
-       ${INSTALL_MAN} ${WRKSRC}/pkglint.0 ${DESTDIR}${PREFIX}/${PKGMANDIR}/cat1/pkglint.1
+       ${INSTALL_MAN} ${WRKSRC.pkglint}/pkglint.0 ${DESTDIR}${PREFIX}/${PKGMANDIR}/cat1/pkglint.1
 .  else
-       ${INSTALL_MAN} ${WRKSRC}/pkglint.0 ${DESTDIR}${PREFIX}/${PKGMANDIR}/cat1
+       ${INSTALL_MAN} ${WRKSRC.pkglint}/pkglint.0 ${DESTDIR}${PREFIX}/${PKGMANDIR}/cat1
 .  endif
 .endif
 .if ${MANINSTALL:Mmaninstall}
-       ${INSTALL_MAN} ${WRKSRC}/pkglint.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+       ${INSTALL_MAN} ${WRKSRC.pkglint}/pkglint.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
 .endif
 
 .if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS])
diff -r 0072a081bc48 -r 8688eb15cbf1 pkgtools/pkglint/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/pkglint/distinfo Sat Nov 10 11:41:40 2018 +0000
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2018/11/10 11:42:23 rillig Exp $
+
+SHA1 (tools-92d8274bd7b8a4c65f24bafe401a029e58392704.tar.gz) = 6d8999e8a535d7fcb40f64276dce3c525bebd7be
+RMD160 (tools-92d8274bd7b8a4c65f24bafe401a029e58392704.tar.gz) = 79c3ef6bf7e941b6eee564023bb109247eea307d
+SHA512 (tools-92d8274bd7b8a4c65f24bafe401a029e58392704.tar.gz) = 92027f221aa802798fd9734ebfc020163ccded95f6f2b208f614f45d8eec4f988ad77b155330fe8933ba3ddefe65af961a808b515a9b48da381b31da4f0d04bf
+Size (tools-92d8274bd7b8a4c65f24bafe401a029e58392704.tar.gz) = 2741721 bytes



Home | Main Index | Thread Index | Old Index