Hello,

On 2023/11/13 14:52:43 +0800, lux <l...@shellcodes.org> wrote:
> > Hi,
> >   vgrep now has OpenBSD support[1], I'm repost the port file.
> > 
> >   Thanks.
> > 
> > [1]: https://github.com/vrothberg/vgrep/releases

Thanks for adding support for "our" grep upstream :-)

Some comments on the port that, beside one question, is ok op@ to import.

Out of the box it doesn't build, it seems that it tries to fetch the
dependencies during the build, which is a big no for the OpenBSD port
infrastructure.  Maybe you're not using PORT_PRIVSEP (see
bsd.port.mk(5)).

Upstream seems to vendor all the dependencies, and I suspect there is
some incantation that we can use to please go.port.mk, but I haven't
found it so I've switched the port to a more "classical" setup where the
port infrastructure fetches the dependencies.  There, I failed again
since I haven't found the right way to specify the version, hence the
"ugly" MODGO_VERSION...

Other than that, I think we can append to MODGO_LDFLAGS istead of
overwriting, drop the leading article from COMMENT and install the
"""manpage""".  I've also updated the license marker since I went in the
rabbit hole of checking the license of the dependencies.  (I haven't went
thru the transitive dependencies, hope there's no GPLv2 in there since it
would be incompatibe with apache :-)

So, except the doubt regarding MODGO_VERSION format and why specifiying
v2.7.0 doesn't work (I tried also to append /v2 to MODGO_MODNAME), it's
okay for me to import.

I'm attaching a diff with your Makefile and an updated tarball.

--- Makefile.orig       Mon Nov 13 10:02:06 2023
+++ Makefile    Mon Nov 13 10:48:10 2023
@@ -1,21 +1,28 @@
-COMMENT =              a user-friendly pager for grep
+COMMENT =              user-friendly pager for grep
 
-VERSION =              2.7.0
+MODGO_MODNAME =                github.com/vrothberg/vgrep
+MODGO_VERSION =                v0.0.0-20231113051520-e0f509f71321
+DISTNAME =             vgrep-2.7.0
 
-GH_ACCOUNT =           vrothberg
-GH_PROJECT =           vgrep
-GH_TAGNAME =           v${VERSION}
-
 CATEGORIES =           textproc
 
 MAINTAINER =           Xi Lu <l...@shellcodes.org>
 
-# GPL-3.0
+# GPL-3.0 + Apache 2 + MIT + BSD ...
 PERMIT_PACKAGE =       Yes
 
 WANTLIB =              c pthread
 MODULES =              lang/go
-MODGO_TYPE =           bin
-MODGO_LDFLAGS =                -s -w -X main.version=${VERSION}
+MODGO_LDFLAGS +=       -X main.version=${VERSION}
 
+# confuses modgo' build target
+pre-build:
+       rm -rf "${WRKSRC}/vendor"
+
+# would require go-md2man to convert...
+post-install:
+       ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/vgrep
+       ${INSTALL_DATA} ${WRKSRC}/docs/vgrep.1.md ${PREFIX}/share/doc/vgrep
+
+.include "modules.inc"
 .include <bsd.port.mk>


Attachment: vgrep.tar.gz
Description: GNU Zip compressed data

Reply via email to