Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Dec 2019 16:36:34 +0000 (UTC)
From:      Vasil Dimov <vd@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r521643 - in head: . net-p2p net-p2p/c-lightning net-p2p/c-lightning/files
Message-ID:  <201912311636.xBVGaYlG064685@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vd
Date: Tue Dec 31 16:36:33 2019
New Revision: 521643
URL: https://svnweb.freebsd.org/changeset/ports/521643

Log:
  net-p2p/c-lightning: Add a new port - Lightning Network implementation in C
  
  A lighweight, highly customizable and standard compliant
  implementation of the Lightning Network protocol.
  
  https://github.com/ElementsProject/lightning

Added:
  head/net-p2p/c-lightning/
  head/net-p2p/c-lightning/Makefile   (contents, props changed)
  head/net-p2p/c-lightning/distinfo   (contents, props changed)
  head/net-p2p/c-lightning/files/
  head/net-p2p/c-lightning/files/lightningd-bitcoin.conf.sample.in   (contents, props changed)
  head/net-p2p/c-lightning/files/lightningd.in   (contents, props changed)
  head/net-p2p/c-lightning/files/patch-Makefile   (contents, props changed)
  head/net-p2p/c-lightning/files/patch-tools_mockup.sh   (contents, props changed)
  head/net-p2p/c-lightning/files/patch-tools_update-mocks.sh   (contents, props changed)
  head/net-p2p/c-lightning/files/pkg-message.in   (contents, props changed)
  head/net-p2p/c-lightning/pkg-descr   (contents, props changed)
  head/net-p2p/c-lightning/pkg-plist   (contents, props changed)
Modified:
  head/GIDs
  head/UIDs
  head/net-p2p/Makefile

Modified: head/GIDs
==============================================================================
--- head/GIDs	Tue Dec 31 16:21:45 2019	(r521642)
+++ head/GIDs	Tue Dec 31 16:36:33 2019	(r521643)
@@ -675,7 +675,7 @@ bopm:*:717:
 # free: 732
 # free: 733
 # free: 734
-# free: 735
+c-lightning:*:735:
 # free: 736
 # free: 737
 # free: 738

Modified: head/UIDs
==============================================================================
--- head/UIDs	Tue Dec 31 16:21:45 2019	(r521642)
+++ head/UIDs	Tue Dec 31 16:36:33 2019	(r521643)
@@ -680,7 +680,7 @@ _dnscrypt-wrapper:*:718:65534::0:0:dnscrypt-wrapper us
 # free: 732
 # free: 733
 # free: 734
-# free: 735
+c-lightning:*:735:735::0:0:c-lightning Daemon:/var/db/c-lightning:/usr/sbin/nologin
 # free: 736
 # free: 737
 # free: 738

Modified: head/net-p2p/Makefile
==============================================================================
--- head/net-p2p/Makefile	Tue Dec 31 16:21:45 2019	(r521642)
+++ head/net-p2p/Makefile	Tue Dec 31 16:36:33 2019	(r521643)
@@ -10,6 +10,7 @@
     SUBDIR += bitcoin-daemon
     SUBDIR += bitcoin-utils
     SUBDIR += bitflu
+    SUBDIR += c-lightning
     SUBDIR += couchpotato
     SUBDIR += cpuminer
     SUBDIR += createtorrent

Added: head/net-p2p/c-lightning/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/Makefile	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,76 @@
+# Created by: Vasil Dimov <vd@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME=	c-lightning
+# To build from an arbitrary git commit comment PORTVERSION and PORTREVISION (if present)
+PORTVERSION=	0.8.0
+DISTVERSIONPREFIX=	v
+# and uncomment the following two lines (use for example -git-HEAD or -git-f8d8348c)
+#PORTVERSION=	0
+#PKGNAMESUFFIX=	-git-f8d8348c
+CATEGORIES=	net-p2p finance
+
+MAINTAINER=	vd@FreeBSD.org
+COMMENT=	Lightning Network implementation in C
+
+LICENSE=	MIT
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}mako>=1.0.14:textproc/py-mako@${PY_FLAVOR}
+LIB_DEPENDS=	libgmp.so:math/gmp \
+		libsodium.so:security/libsodium \
+		libsqlite3.so:databases/sqlite3
+RUN_DEPENDS=	bitcoin-cli:net-p2p/bitcoin-utils
+
+USES=		autoreconf:build gettext gmake libtool python:3.5+,build
+BINARY_ALIAS=	python=${PYTHON_CMD} python3=${PYTHON_CMD}
+ALL_TARGET=	default
+
+OPTIONS_DEFINE=		COMPATIBILITY DEVELOPER EXPERIMENTAL
+OPTIONS_RADIO=		TESTING
+OPTIONS_RADIO_TESTING=	ASAN VALGRIND
+
+COMPATIBILITY_CONFIGURE_ENABLE=	compat
+COMPATIBILITY_DESC=		Compatibility mode, good to disable to see if your software breaks
+DEVELOPER_CONFIGURE_ENABLE=	developer
+DEVELOPER_DESC=			Developer mode, good for testing
+EXPERIMENTAL_CONFIGURE_ENABLE=	experimental-features
+EXPERIMENTAL_DESC=		Enable experimental features
+ASAN_CONFIGURE_ENABLE=		address-sanitizer
+ASAN_DESC=			Compile with address-sanitizer
+VALGRIND_CONFIGURE_ENABLE=	valgrind
+VALGRIND_DESC=			Run tests with Valgrind
+
+OPTIONS_DEFAULT=COMPATIBILITY
+
+HAS_CONFIGURE=	yes
+
+USE_GITHUB=	yes
+.if defined(PKGNAMESUFFIX)
+GIT_COMMIT=	${PKGNAMESUFFIX:C/-git-//}
+.else
+GIT_COMMIT=	${DISTVERSIONPREFIX}${PORTVERSION}
+.endif
+GH_TUPLE=	ElementsProject:lightning:${GIT_COMMIT} \
+		ElementsProject:libwally-core:release_0.7.4:ext1/external/libwally-core \
+		ianlancetaylor:libbacktrace:5a99ff7fed66b8e:ext2/external/libbacktrace \
+		zserge:jsmn:v1.0.0:ext3/external/jsmn
+
+USERS=		c-lightning
+GROUPS=		c-lightning
+
+USE_RC_SUBR=	lightningd
+
+SUB_FILES=	lightningd-bitcoin.conf.sample pkg-message
+SUB_LIST=	U="${USERS}" G="${GROUPS}" LIGHTNINGD_BASE_DIR="${DESTDIR}/var/db/c-lightning"
+PLIST_SUB=	U="${USERS}" G="${GROUPS}"
+
+post-patch:
+	${REINPLACE_CMD} -e 's|cd external|unset CFLAGS \&\& cd external|' \
+		${WRKSRC}/external/Makefile
+
+post-install:
+	${INSTALL_DATA} \
+		${WRKDIR}/lightningd-bitcoin.conf.sample \
+		${STAGEDIR}${PREFIX}/etc/lightningd-bitcoin.conf.sample
+
+.include <bsd.port.mk>

Added: head/net-p2p/c-lightning/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/distinfo	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,9 @@
+TIMESTAMP = 1577715475
+SHA256 (ElementsProject-lightning-v0.8.0_GH0.tar.gz) = 6abe19465748cfbe59a1d3943d8f390bf0f810d1ba1eda07fcc02144ab939173
+SIZE (ElementsProject-lightning-v0.8.0_GH0.tar.gz) = 2622314
+SHA256 (ElementsProject-libwally-core-release_0.7.4_GH0.tar.gz) = d1ec3085d8b12ec5e4f604f747850ef77eb734c61c23e79d6c8a3b6c69c6c699
+SIZE (ElementsProject-libwally-core-release_0.7.4_GH0.tar.gz) = 900716
+SHA256 (ianlancetaylor-libbacktrace-5a99ff7fed66b8e_GH0.tar.gz) = 2aad59f02cb008b5e912821c205ad6a140afcae69844e7ba9f7e590239ec41e2
+SIZE (ianlancetaylor-libbacktrace-5a99ff7fed66b8e_GH0.tar.gz) = 509368
+SHA256 (zserge-jsmn-v1.0.0_GH0.tar.gz) = 5b1f46312cf205e6a0923a0656893bde9e022c76d06d980958fa8dbf79f0ea06
+SIZE (zserge-jsmn-v1.0.0_GH0.tar.gz) = 11035

Added: head/net-p2p/c-lightning/files/lightningd-bitcoin.conf.sample.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/files/lightningd-bitcoin.conf.sample.in	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,22 @@
+# An example lightningd config using Tor hidden service.
+#
+# Before starting lightningd configure Tor by adding the following 3 lines
+# to %%LOCALBASE%%/etc/tor/torrc:
+# HiddenServiceDir /var/db/tor/lightningd-bitcoin/
+# HiddenServiceVersion 3
+# HiddenServicePort 1234 127.0.0.1:5678
+# and restart the tor daemon. Then see the hidden service name from
+# /var/db/tor/lightningd-bitcoin/hostname and put it in announce-addr below.
+#
+# See "lightningd --help" for all possible options.
+#
+always-use-proxy=true
+announce-addr=my-tor-hidden-service.onion:1234
+bind-addr=127.0.0.1:5678
+bitcoin-rpcconnect=127.0.0.1
+bitcoin-rpcpassword=...
+bitcoin-rpcport=...
+bitcoin-rpcuser=...
+log-file=lightningd.log
+network=bitcoin
+proxy=127.0.0.1:9050

Added: head/net-p2p/c-lightning/files/lightningd.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/files/lightningd.in	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,44 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: lightningd
+# REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
+
+# Add the following to %%LOCALBASE%%/etc/rc.conf.d/lightningd to influence
+# the behavior of this script (default values are listed):
+#
+# lightningd_enable="NO"  # change to "YES" to enable
+# lightningd_user="%%U%%"
+# lightningd_group="%%G%%"
+# lightningd_base_dir="%%LIGHTNINGD_BASE_DIR%%"
+# lightningd_network="bitcoin"
+# lightningd_conf="%%PREFIX%%/etc/lightningd-${lightningd_network}.conf"
+# lightningd_extra_args=""  # See lightningd --help
+
+. /etc/rc.subr
+
+name="lightningd"
+rcvar=lightningd_enable
+
+load_rc_config ${name}
+
+: ${lightningd_enable:="NO"}
+: ${lightningd_user:="%%U%%"}
+: ${lightningd_group:="%%G%%"}
+: ${lightningd_base_dir:="%%LIGHTNINGD_BASE_DIR%%"}
+: ${lightningd_network:="bitcoin"}
+: ${lightningd_conf:="%%PREFIX%%/etc/${name}-${lightningd_network}.conf"}
+
+pidfile="${lightningd_base_dir}/lightningd-${lightningd_network}.pid"
+command="%%PREFIX%%/bin/lightningd"
+command_args=""
+command_args="${command_args} --lightning-dir=${lightningd_base_dir}"
+command_args="${command_args} --network=${lightningd_network}"
+command_args="${command_args} --daemon"
+
+if [ -e "${lightningd_conf}" ] ; then
+	command_args="${command_args} --conf=${lightningd_conf}"
+fi
+
+run_rc_command "$1"

Added: head/net-p2p/c-lightning/files/patch-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/files/patch-Makefile	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,32 @@
+--- Makefile.orig	2019-12-08 14:26:28 UTC
++++ Makefile
+@@ -1,7 +1,7 @@
+ #! /usr/bin/make
+ 
+ # Extract version from git, or if we're from a zipfile, use dirname
+-VERSION=$(shell git describe --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | sed -n 's,.*/clightning-\(v[0-9.rc]*\)$$,\1,p')
++VERSION=$(shell git describe --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | sed -n 's|.*/c\{0,1\}lightning-v\{0,1\}\([0-9a-f.rc]*\)$$|\1|gp')
+ 
+ ifeq ($(VERSION),)
+ $(error "ERROR: git is required for generating version information")
+@@ -453,7 +453,7 @@ pkglibexecdir = $(libexecdir)/$(PKGNAME)
+ plugindir = $(pkglibexecdir)/plugins
+ datadir = $(PREFIX)/share
+ docdir = $(datadir)/doc/$(PKGNAME)
+-mandir = $(datadir)/man
++mandir = $(PREFIX)/man
+ man1dir = $(mandir)/man1
+ man5dir = $(mandir)/man5
+ man7dir = $(mandir)/man7
+@@ -462,7 +462,11 @@ man8dir = $(mandir)/man8
+ # Commands
+ MKDIR_P = mkdir -p
+ INSTALL = install
++ifeq ($(DEVELOPER),1)
+ INSTALL_PROGRAM = $(INSTALL)
++else
++INSTALL_PROGRAM = $(INSTALL) -s
++endif
+ INSTALL_DATA = $(INSTALL) -m 644
+ 
+ # Tags needed by some package systems.

Added: head/net-p2p/c-lightning/files/patch-tools_mockup.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/files/patch-tools_mockup.sh	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,16 @@
+--- tools/mockup.sh.orig	2019-12-13 15:40:41 UTC
++++ tools/mockup.sh
+@@ -6,8 +6,13 @@ if [ $# -eq 0 ]; then
+     set -- $(while read -r LINE; do
+ 	case "$LINE" in
+ 	    *undefined\ reference\ to*)
++		# file.cc:(.text+0x10): undefined reference to `foo()'
+ 		LINE=${LINE#*undefined reference to \`}
+ 		echo "${LINE%\'*}"
++		;;
++	    *undefined\ symbol:*)
++		# ld: error: undefined symbol: foo()
++		echo "${LINE#*undefined symbol: }"
+ 		;;
+ 	    *)
+ 		continue

Added: head/net-p2p/c-lightning/files/patch-tools_update-mocks.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/files/patch-tools_update-mocks.sh	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,36 @@
+--- tools/update-mocks.sh.orig	2019-12-13 20:01:11 UTC
++++ tools/update-mocks.sh
+@@ -12,20 +12,31 @@ trap 'mv $BASE.old $FILE; rm -f $BASE.*' EXIT
+ START=$(grep -F -n '/* AUTOGENERATED MOCKS START */' "$FILE" | cut -d: -f1)
+ END=$(grep -F -n '/* AUTOGENERATED MOCKS END */' "$FILE" | cut -d: -f1)
+ 
++function make_binary() {
++    $MAKE "${FILE/%.c/}" 2> "${BASE}.err" >/dev/null
++}
++
+ if [ -n "$START" ]; then
+     mv "$FILE" "${BASE}.old"
+     echo "${FILE}:"
+     head -n "$START" "${BASE}.old" > "$FILE"
+     tail -n +"$END" "${BASE}.old" >> "$FILE"
+     # Try to make binary.
+-    if ! $MAKE "${FILE/%.c/}" 2> "${BASE}.err" >/dev/null; then
++    if ! make_binary; then
++	# Some linkers (e.g. LLVM's one) don't print all errors. If this is the
++	# case, then re-run, asking them to do so. Search for something like
++	# this in the output:
++	# ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
++	if grep -q 'too many errors emitted.*-error-limit=0' "${BASE}.err"; then
++	    LDFLAGS=-Wl,-error-limit=0 make_binary || :
++	fi
+ 	tools/mockup.sh < "${BASE}.err" >> "${BASE}.stubs"
+ 	# If there are no link errors, maybe compile fail for other reason?
+ 	if ! grep -F -q 'Generated stub for' "${BASE}.stubs"; then
+ 	    cat "${BASE}.err"
+ 	    exit 1
+ 	fi
+-	sed -n 's,.*Generated stub for \(.*\) .*,\t\1,p' < "${BASE}.stubs"
++	sed -n 's,.*Generated stub for \(.*\) .*,	\1,p' < "${BASE}.stubs"
+ 	head -n "$START" "${BASE}.old" > "$FILE"
+ 	cat "${BASE}.stubs" >> "$FILE"
+ 	tail -n +"$END" "${BASE}.old" >> "$FILE"

Added: head/net-p2p/c-lightning/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/files/pkg-message.in	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,14 @@
+[
+{ type: install
+  message: <<EOM
+To configure lightningd system-wide and to start it at boot time:
+
+Copy %%PREFIX%%/etc/lightningd-bitcoin.conf.sample
+to - %%PREFIX%%/etc/lightningd-bitcoin.conf and edit according to your setup.
+See "lightningd --help" for more information.
+
+Add lightningd_enable="YES" to %%LOCALBASE%%/etc/rc.conf.d/lightningd.
+See rc.conf(5) and %%LOCALBASE%%/etc/rc.d/lightningd for more information.
+EOM
+}
+]

Added: head/net-p2p/c-lightning/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/pkg-descr	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,4 @@
+c-lightning is a lighweight, highly customizable and standard compliant
+implementation of the Lightning Network protocol.
+
+WWW: https://github.com/ElementsProject/lightning

Added: head/net-p2p/c-lightning/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/c-lightning/pkg-plist	Tue Dec 31 16:36:33 2019	(r521643)
@@ -0,0 +1,57 @@
+@sample(%%U%%,%%G%%,0400) etc/lightningd-bitcoin.conf.sample
+bin/lightning-cli
+bin/lightningd
+libexec/c-lightning/plugins/fundchannel
+libexec/c-lightning/plugins/autoclean
+libexec/c-lightning/plugins/pay
+libexec/c-lightning/lightning_connectd
+libexec/c-lightning/lightning_channeld
+libexec/c-lightning/lightning_hsmd
+libexec/c-lightning/lightning_closingd
+libexec/c-lightning/lightning_gossipd
+libexec/c-lightning/lightning_openingd
+libexec/c-lightning/lightning_onchaind
+man/man1/lightning-cli.1.gz
+man/man5/lightningd-config.5.gz
+man/man7/lightning-autocleaninvoice.7.gz
+man/man7/lightning-check.7.gz
+man/man7/lightning-checkmessage.7.gz
+man/man7/lightning-close.7.gz
+man/man7/lightning-connect.7.gz
+man/man7/lightning-createonion.7.gz
+man/man7/lightning-decodepay.7.gz
+man/man7/lightning-delexpiredinvoice.7.gz
+man/man7/lightning-delinvoice.7.gz
+man/man7/lightning-disconnect.7.gz
+man/man7/lightning-fundchannel.7.gz
+man/man7/lightning-fundchannel_cancel.7.gz
+man/man7/lightning-fundchannel_complete.7.gz
+man/man7/lightning-fundchannel_start.7.gz
+man/man7/lightning-getroute.7.gz
+man/man7/lightning-invoice.7.gz
+man/man7/lightning-listchannels.7.gz
+man/man7/lightning-listforwards.7.gz
+man/man7/lightning-listfunds.7.gz
+man/man7/lightning-listinvoices.7.gz
+man/man7/lightning-listpays.7.gz
+man/man7/lightning-listpeers.7.gz
+man/man7/lightning-listsendpays.7.gz
+man/man7/lightning-newaddr.7.gz
+man/man7/lightning-pay.7.gz
+man/man7/lightning-plugin.7.gz
+man/man7/lightning-sendonion.7.gz
+man/man7/lightning-sendpay.7.gz
+man/man7/lightning-setchannelfee.7.gz
+man/man7/lightning-signmessage.7.gz
+man/man7/lightning-txdiscard.7.gz
+man/man7/lightning-txprepare.7.gz
+man/man7/lightning-txsend.7.gz
+man/man7/lightning-waitanyinvoice.7.gz
+man/man7/lightning-waitinvoice.7.gz
+man/man7/lightning-waitsendpay.7.gz
+man/man7/lightning-withdraw.7.gz
+man/man8/lightningd.8.gz
+share/doc/c-lightning/HACKING.md
+share/doc/c-lightning/INSTALL.md
+share/doc/c-lightning/LICENSE
+share/doc/c-lightning/README.md



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912311636.xBVGaYlG064685>