pkgsrc-WIP-changes archive

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

I HAVE A WORKING GO MODULE BUILD!



Module Name:	pkgsrc-wip
Committed By:	Benny Siegert <bsiegert%gmail.com@localhost>
Pushed By:	bsiegert
Date:		Sun Mar 1 13:27:02 2020 +0100
Changeset:	be70ee194801d0fa7438a8af8787aa413f6c5e81

Modified Files:
	go/go-package.mk
	lf/Makefile
	lf/TODO
	lf/distinfo

Log Message:
I HAVE A WORKING GO MODULE BUILD!

I am sure that someone with more bmake-fu can improve on the make
invocations. Also, all files are now downloaded into a flat subdirectory.
I would like them to retain their original path but don't know how to do that.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=be70ee194801d0fa7438a8af8787aa413f6c5e81

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

diffstat:
 go/go-package.mk | 19 ++++++++++++++++---
 lf/Makefile      |  9 +++++++++
 lf/TODO          |  8 ++++++--
 lf/distinfo      | 24 ++++++++++++++++++++----
 4 files changed, 51 insertions(+), 9 deletions(-)

diffs:
diff --git a/go/go-package.mk b/go/go-package.mk
index db122e8406..bf5ddabdac 100644
--- a/go/go-package.mk
+++ b/go/go-package.mk
@@ -75,8 +75,7 @@ PRINT_PLIST_AWK+=	/^@pkgdir bin$$/ { next; }
 PRINT_PLIST_AWK+=	/^@pkgdir gopkg$$/ { next; }
 
 .if !empty(GO_MODULE:M[Yy][Ee][Ss])
-MAKE_ENV+=	GO111MODULE=on GOPATH=${WRKDIR}/.gopath
-# GOPROXY=file://${WRKDIR}/.gopath/pkg/mod/cache/download
+MAKE_ENV+=	GO111MODULE=on GOPATH=${WRKDIR}/.gopath GOPROXY=file://${WRKDIR}/.goproxy
 .else
 MAKE_ENV+=	GO111MODULE=off GOPATH=${WRKDIR}:${BUILDLINK_DIR}/gopkg 
 .endif
@@ -110,11 +109,25 @@ do-install:
 .endif
 
 .if !empty(GO_MODULE:M[Yy][Ee][Ss])
+# FIXME This needs to depend on extract
 .PHONY: show-go-modules
 show-go-modules:
 	# cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${GO} env
 	${RUN} cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${GO} get -d
-	${RUN} cd ${WRKDIR}/.gopath/pkg/mod/cache/download && ${FIND} . -type f | ${SED} -e 's/\.\//GO_MODULE_FILES+=	/'
+	${RUN} cd ${WRKDIR}/.gopath/pkg/mod/cache/download && ${FIND} . -type f -name "*.mod" | ${SED} -e 's/\.\//GO_MODULE_FILES+=	/'
+	${RUN} cd ${WRKDIR}/.gopath/pkg/mod/cache/download && ${FIND} . -type f -name "*.zip" | ${SED} -e 's/\.\//GO_MODULE_FILES+=	/'
+
+.for i in ${GO_MODULE_FILES}
+DISTFILES+= ${i:!basename $i!}
+SITES.${i:!basename $i!}= https://proxy.golang.org/${i:!dirname $i!}/
+.endfor
+
+post-extract:
+.for i in ${GO_MODULE_FILES}
+	${MKDIR} ${WRKDIR}/.goproxy/${i:!dirname $i!}
+	cp ${DISTDIR}/${DIST_SUBDIR}/${i:!basename $i!} ${WRKDIR}/.goproxy/$i
+.endfor
+
 .endif
 
 _VARGROUPS+=		go
diff --git a/lf/Makefile b/lf/Makefile
index 17887e4a50..98f04a16bd 100644
--- a/lf/Makefile
+++ b/lf/Makefile
@@ -15,6 +15,15 @@ LICENSE=		2-clause-bsd
 
 GO_MODULE=		yes
 
+DIST_SUBDIR=		${PKGNAME_NOREV}
+DISTFILES?=		${DEFAULT_DISTFILES}
+
+GO_MODULE_FILES+=       github.com/mattn/go-runewidth/@v/v0.0.4.mod
+GO_MODULE_FILES+=       github.com/mattn/go-runewidth/@v/v0.0.4.zip
+GO_MODULE_FILES+=       github.com/nsf/termbox-go/@v/v0.0.0-20190325093121-288510b9734e.zip
+GO_MODULE_FILES+=       github.com/nsf/termbox-go/@v/v0.0.0-20190325093121-288510b9734e.mod
+
+
 .include "../../devel/go-termbox/buildlink3.mk"
 .include "../../wip/go/go-package.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/lf/TODO b/lf/TODO
index efee3e243b..92472ecff1 100644
--- a/lf/TODO
+++ b/lf/TODO
@@ -1,2 +1,6 @@
-Installing this package does not work yet, since it uses a module-based
-build. It is a testbed for making module-based builds work.
+This package is a testbed for making module-based builds work.
+
+Building and installing works, but all module files are downloaded into a flat
+directory named after the package. Ideally, we would want a dynamic
+subdirectory based on the path in GO_MODULE_FILES. Otherwise, there will be
+clashes when multiple packages have the same version.
diff --git a/lf/distinfo b/lf/distinfo
index 22fe3f8633..40f0f6bbe8 100644
--- a/lf/distinfo
+++ b/lf/distinfo
@@ -1,6 +1,22 @@
 $NetBSD: distinfo,v 1.2 2018/03/14 08:46:23 bsiegert Exp $
 
-SHA1 (lf-13.tar.gz) = 0ac58823fbaef505c98f32d478a64100e5191cd1
-RMD160 (lf-13.tar.gz) = d542305b5a26090262304d5f330145b4926ba319
-SHA512 (lf-13.tar.gz) = 67c0fdbf7dc86a3856a0dce9fb8ed38f1a4c8a66a8ae051887b4aa6ddcbd086a748124cae804f4a051e20efcffb1cd847611b400c54143a79587ce4561a938c0
-Size (lf-13.tar.gz) = 67064 bytes
+SHA1 (lf-13/lf-13.tar.gz) = 0ac58823fbaef505c98f32d478a64100e5191cd1
+RMD160 (lf-13/lf-13.tar.gz) = d542305b5a26090262304d5f330145b4926ba319
+SHA512 (lf-13/lf-13.tar.gz) = 67c0fdbf7dc86a3856a0dce9fb8ed38f1a4c8a66a8ae051887b4aa6ddcbd086a748124cae804f4a051e20efcffb1cd847611b400c54143a79587ce4561a938c0
+Size (lf-13/lf-13.tar.gz) = 67064 bytes
+SHA1 (lf-13/v0.0.0-20190325093121-288510b9734e.mod) = d48d2f3ba9f25e16d2896c365a2a546c13f0645b
+RMD160 (lf-13/v0.0.0-20190325093121-288510b9734e.mod) = 91a64464b5c3108f10e1f9a74996b464c40d6cfa
+SHA512 (lf-13/v0.0.0-20190325093121-288510b9734e.mod) = d96b326f421417a67e9db79350043b29f2b2c9b7ca00f696955303f0ba090c8fd82f018f312ebef4d443ef87732af99d807dcb6f6e16187d00ba0c0502d78876
+Size (lf-13/v0.0.0-20190325093121-288510b9734e.mod) = 33 bytes
+SHA1 (lf-13/v0.0.0-20190325093121-288510b9734e.zip) = d5c8e5954e888c17df553d43ab77cd3d002c9660
+RMD160 (lf-13/v0.0.0-20190325093121-288510b9734e.zip) = 67589548e73ca56daab2c52adc8ea214139bd3e2
+SHA512 (lf-13/v0.0.0-20190325093121-288510b9734e.zip) = 1fdba1fd9660dac4b61534346127703c3a7fc49bc8ea5f2a9348aed2a32182dbbfbb196105d247d0ddbae44116be1effed29546ce0bea41969f179badf68cdce
+Size (lf-13/v0.0.0-20190325093121-288510b9734e.zip) = 46179 bytes
+SHA1 (lf-13/v0.0.4.mod) = 4ea1d8179b52949e0536e3744d69410414540dd7
+RMD160 (lf-13/v0.0.4.mod) = 7b055d0690c748e3832a9ecb6db2a8d49f9aeb8c
+SHA512 (lf-13/v0.0.4.mod) = b891712f639a850e41582c15bcb384a985fad4f8aa86ce2d3f4d2554354aa1a9619667f60837a8280f869fc07dd58dc676c222bac23aaa5b2b00c06284b2f475
+Size (lf-13/v0.0.4.mod) = 37 bytes
+SHA1 (lf-13/v0.0.4.zip) = 9a8a2430a3c128189b5b97a737a4d155cd2a36e2
+RMD160 (lf-13/v0.0.4.zip) = b86ebf1499cb4f234839e3061dda815e9d1a011e
+SHA512 (lf-13/v0.0.4.zip) = fb2bd143a0eb1be1faacc0069ec8c2d53b16b6969e6c4dd7ae4802f16606a80ff1c362712f0836b97f1453df468e7e12bb5dfabf9161436fbe9b87231f593068
+Size (lf-13/v0.0.4.zip) = 22344 bytes


Home | Main Index | Thread Index | Old Index