Page MenuHomeFreeBSD

sysutils/go-btfs: add new port
ClosedPublic

Authored by mikael on May 2 2020, 6:23 PM.

Details

Summary

BitTorrent File System (BTFS) is a protocol forked from IPFS that utilizes
the TRON network and the BitTorrent Ecosystem for integration with DApps and
smart contracts.

WWW: https://www.bittorrent.com/btfs/

Test Plan

amd64 ok
aarch64 ok

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mikael requested review of this revision.May 2 2020, 6:23 PM

The posted version didn't build for me, had to make some changes listed below (you'll need latest ports-mgmt/modules2tuple v2.1.0 to generate this GH_TUPLE).

Another thing - the upstream need to add a replace directive in their go.mod to fix launchpad.net/gocheck entry:

launchpad.net/gocheck v0.0.0-20140225173054-000000000087 // indirect

because 000000000087 is not a valid commit ID (doesn't exist). Go probably uses some tricks to handle it, I just manually replaced it with the latest commit ID in github.com/go-check/check.

--- go-btfs-old.diff	2020-05-03 07:01:38.776102000 -0500
+++ go-btfs-new.patch	2020-05-03 08:58:08.583018000 -0500
@@ -57,6 +57,7 @@
 +		census-instrumentation:opencensus-go:v0.21.0:census_instrumentation_opencensus_go/vendor/go.opencensus.io \
 +		cheekybits:genny:v1.0.0:cheekybits_genny/vendor/github.com/cheekybits/genny \
 +		cheggaaa:pb:v1.0.28:cheggaaa_pb/vendor/gopkg.in/cheggaaa/pb.v1 \
++		cmars:basen:fe3947df716e:cmars_basen \
 +		coreos:go-semver:v0.3.0:coreos_go_semver/vendor/github.com/coreos/go-semver \
 +		cpuguy83:go-md2man:f79a8a8ca69d:cpuguy83_go_md2man_v2/vendor/github.com/cpuguy83/go-md2man/v2 \
 +		cskr:pubsub:v1.0.2:cskr_pubsub/vendor/github.com/cskr/pubsub \
@@ -74,6 +75,7 @@
 +		fomichev:secp256k1:00116ff8c62f:fomichev_secp256k1/vendor/github.com/fomichev/secp256k1 \
 +		frankban:quicktest:v1.4.2:frankban_quicktest/vendor/github.com/frankban/quicktest \
 +		fsnotify:fsnotify:v1.4.7:fsnotify_fsnotify/vendor/github.com/fsnotify/fsnotify \
++		go-check:check:8fa46927fb4f:go_check_check/vendor/launchpad.net/gocheck \
 +		go-critic:go-critic:d79a9f0c64db:go_critic_go_critic/vendor/github.com/go-critic/go-critic \
 +		go-lintpack:lintpack:v0.5.2:go_lintpack_lintpack/vendor/github.com/go-lintpack/lintpack \
 +		go-ole:go-ole:v1.2.4:go_ole_go_ole/vendor/github.com/go-ole/go-ole \
@@ -124,6 +126,7 @@
 +		google:uuid:v1.1.1:google_uuid/vendor/github.com/google/uuid \
 +		gorilla:websocket:ae1634f6a989:gorilla_websocket/vendor/github.com/gorilla/websocket \
 +		gostaticanalysis:analysisutil:4088753ea4d3:gostaticanalysis_analysisutil/vendor/github.com/gostaticanalysis/analysisutil \
++		gotestyourself:gotestsum:v0.3.4:gotestyourself_gotestsum/vendor/gotest.tools/gotestsum \
 +		grpc-ecosystem:go-grpc-middleware:v1.1.0:grpc_ecosystem_go_grpc_middleware/vendor/github.com/grpc-ecosystem/go-grpc-middleware \
 +		grpc:grpc-go:v1.25.1:grpc_grpc_go/vendor/google.golang.org/grpc \
 +		gxed:go-shellwords:v1.0.3:gxed_go_shellwords/vendor/github.com/gxed/go-shellwords \
@@ -340,6 +343,10 @@
 +
 +PLIST_FILES=	bin/btfs
 +
++post-extract:
++	@${MKDIR} ${WRKSRC}/vendor/github.com/cmars
++	@${RLN} ${WRKSRC_factomproject_basen} ${WRKSRC}/vendor/github.com/cmars/basen
++
 +post-patch:
 +	${PATCH} -s -d ${WRKSRC} -i patches/go-ipns-v.0.0.1-record.go.patch \
 +		vendor/github.com/ipfs/go-ipns/record.go
In D24670#543244, @dmgk wrote:

The posted version didn't build for me, had to make some changes listed below (you'll need latest ports-mgmt/modules2tuple v2.1.0 to generate this GH_TUPLE).

Do you remember what was the issue (I noticed that make makesum produces 2 entries for natefinch-lumberjack)?
It seems to build / run fine without go-check and cmars.

Do you remember what was the issue (I noticed that make makesum produces 2 entries for natefinch-lumberjack)?

The main issue was that the same basen version was imported from 2 different GH accounts:

FactomProject:basen:fe3947df716e
cmars:basen:fe3947df716e

Due to the way ports framework handles GH distfiles, it gets confused in this case and all entries except the first one will not be extracted correctly.
This is handled by post-extract generated by modules2tuple.

It seems to build / run fine without go-check and cmars.

These packages seem to be used only for testing, so they can probably be left out. But they are in modules.txt so modules2tuple includes them.

Edit: same goes for the second basen cmars:basen:fe3947df716e - the build succeeds w/o it, bit it's listed so it gets included.

This revision was not accepted when it landed; it landed in state Needs Review.May 8 2020, 12:14 PM
This revision was automatically updated to reflect the committed changes.