pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkglint



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sat Nov 10 11:41:40 UTC 2018

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.555 -r1.556 pkgsrc/pkgtools/pkglint/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pkglint/Makefile
diff -u pkgsrc/pkgtools/pkglint/Makefile:1.555 pkgsrc/pkgtools/pkglint/Makefile:1.556
--- pkgsrc/pkgtools/pkglint/Makefile:1.555      Thu Nov  8 19:41:32 2018
+++ pkgsrc/pkgtools/pkglint/Makefile    Sat Nov 10 11:41:40 2018
@@ -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 @@ COMMENT=    Verifier for NetBSD packages
 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])



Home | Main Index | Thread Index | Old Index