On 2023/04/21 10:10:33 +0200, Theo Buehler <t...@theobuehler.org> wrote:
> On Fri, Apr 21, 2023 at 10:09:41AM +0200, Theo Buehler wrote:
> > A small utility without dependencies except go. It is therfore trivial
> > to install this by hand but job thought it would be useful to have it as
> > a port, so here we go.
> > 
> > The Makefile has more handrolled things than I would like. go.port.mk is
> > an incomprehensible mess and it made me waste more than enough time for
> > this trivial thing. If there's a better way for anything, please let me
> > know.
> > 
> > It is unlikely that this will ever see official releases, so I refrained
> > from prepending 0.0. to the date because I find this very ugly and hacky.
> > If this leaf port needs to bump EPOCH, so be it.
> > 
> > [...]

can be greatly semplified using MODGO_MODNAME and MODGO_VERSION, then
go.port.mk will take care of fetching, building and installing the
correct things (ok, sometimes it builds/installs more than
necessary, not the case however.)

I've got the version number by running 'go get $url' in a dummy go
project and looking at the output.  There's a way to do that easily
with 'go list' but I always forgot ^^"

Here's a diff against your makefile and a tarball re-attached.
Haven't run-tested but it looks fine to me and if it works for you
it's ok op@ to import :)

--- Makefile.orig       Fri Apr 21 10:42:10 2023
+++ Makefile    Fri Apr 21 10:40:28 2023
@@ -1,12 +1,9 @@
 COMMENT =              convert between ASN.1 encodings and text
 
-# Follows HEAD
-VERSION =              20230412
-DISTNAME =             der-ascii-${VERSION}
+MODGO_MODNAME =                github.com/google/der-ascii
+MODGO_VERSION =                v0.0.0-20230412183205-c8bb0d34a6e5
 
-GH_ACCOUNT =           google
-GH_PROJECT =           der-ascii
-GH_COMMIT =            c8bb0d34a6e5137706f4e5924073f3a1066b902f
+DISTNAME =             der-ascii-20230412
 
 CATEGORIES =           textproc sysutils
 
@@ -17,22 +14,10 @@
 
 MODULES =              lang/go
 
-DERASCII_BIN = ascii2der der2ascii
-
-do-build:
-.for dir in ${DERASCII_BIN}
-       cd ${WRKSRC}/cmd/${dir} && ${MODGO_BUILD_CMD}
-.endfor
-
 DERASCII_DOCDIR = ${PREFIX}/share/doc/${PKGSTEM}
 
 post-install:
        ${INSTALL_DATA_DIR} ${DERASCII_DOCDIR}
        ${INSTALL_DATA} ${WRKSRC}/language.txt ${DERASCII_DOCDIR}
-
-do-test:
-.for dir in ${DERASCII_BIN}
-       cd ${WRKSRC}/cmd/${dir} && ${MODGO_TEST_CMD}
-.endfor
 
 .include <bsd.port.mk>


Attachment: der-ascii.tar.gz
Description: GNU Zip compressed data

Reply via email to