1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00

Adding twister, a fully decentralized P2P microblogging platform

leveraging from the free software implementations of Bitcoin and
BitTorrent protocols.
This commit is contained in:
Thierry Thomas 2014-06-22 13:39:24 +00:00
parent 070ef7d882
commit 1948a46729
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=358801
8 changed files with 189 additions and 0 deletions

View File

@ -97,6 +97,7 @@
SUBDIR += transmission-qt4
SUBDIR += transmission-remote-gui
SUBDIR += tribler
SUBDIR += twister
SUBDIR += uhub
SUBDIR += unworkable
SUBDIR += valknut

68
net-p2p/twister/Makefile Normal file
View File

@ -0,0 +1,68 @@
# Created by: Thierry Thomas <thierry@pompo.net>
# $FreeBSD$
PORTNAME= twister-core
PORTVERSION= 0.140621
CATEGORIES= net-p2p
MAINTAINER= thierry@FreeBSD.org
COMMENT= Experimental peer-to-peer microblogging software
LICENSE= BSD3CLAUSE MIT
LICENSE_COMB= dual
LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libboost_system.so:${PORTSDIR}/devel/boost-libs \
libleveldb.so:${PORTSDIR}/databases/leveldb \
libicui18n.so:${PORTSDIR}/devel/icu
OPTIONS_DEFINE= UPNP
OPTIONS_DEFAULT= UPNP
UPNP_DESC= UPnP port mapping
UPNP_LIB_DEPENDS= libminiupnpc.so:${PORTSDIR}/net/miniupnpc
USE_GITHUB= yes
GH_ACCOUNT= miguelfreitas
GH_PROJECT= ${PORTNAME}
GH_TAGNAME= ${GH_COMMIT}
GH_COMMIT= 2d23677
USE_BDB= yes
WANT_BDB_VER= 48
USE_OPENSSL= yes
USES= gmake iconv
USE_AUTOTOOLS= libtoolize:env aclocal:env autoconf:env autoheader:env automake:env
GNU_CONFIGURE= yes
CONFIGURE_WRKSRC=${WRKSRC}/libtorrent
CONFIGURE_ARGS= --with-libiconv \
--with-boost=${LOCALBASE} \
--with-boost-system=boost_system
CONFIGURE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
PTHREAD_LIBS="${PTHREAD_LIBS}"
MAKEFILE= makefile.unix
BUILD_WRKSRC= ${WRKSRC}/src
MAKE_ENV= BOOST_INCLUDE_PATH=${LOCALBASE}/include \
BOOST_LIB_PATH=${LOCALBASE}/lib \
BDB_INCLUDE_PATH=${BDB_INCLUDE_DIR} \
BDB_LIB_PATH=${BDB_LIB_DIR}
PLIST_FILES= bin/twisterd
PORTDOCS= README.md
.include <bsd.port.options.mk>
pre-configure:
(cd ${CONFIGURE_WRKSRC} && ./autotool.sh)
.if ${PORT_OPTIONS:MUPNP}
${REINPLACE_CMD} -e 's|USE_UPNP:=1|USE_UPNP:=|' ${BUILD_WRKSRC}/${MAKEFILE}
.endif
do-install:
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/twisterd ${STAGEDIR}${PREFIX}/bin
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
.endif
.include <bsd.port.mk>

2
net-p2p/twister/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (twister-core-0.140621.tar.gz) = fc3fc95d32c615e97599ecf22de230a9c31ad5e0faf5d17dbb076002284dca07
SIZE (twister-core-0.140621.tar.gz) = 6268064

View File

@ -0,0 +1,20 @@
--- libtorrent/m4/ax_pthread.m4.orig 2014-06-20 21:38:49.000000000 +0200
+++ libtorrent/m4/ax_pthread.m4 2014-06-21 16:58:22.000000000 +0200
@@ -318,7 +318,7 @@
#
if test x"$done" = xno; then
AC_MSG_CHECKING([whether -lpthread fixes that])
- LIBS="-lpthread $PTHREAD_LIBS $save_LIBS"
+ LIBS="$PTHREAD_LIBS $save_LIBS"
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
@@ -327,7 +327,7 @@
if test "x$done" = xyes; then
AC_MSG_RESULT([yes])
- PTHREAD_LIBS="-lpthread $PTHREAD_LIBS"
+ PTHREAD_LIBS="$PTHREAD_LIBS"
else
AC_MSG_RESULT([no])
fi

View File

@ -0,0 +1,38 @@
--- src/makefile.unix.orig 2014-06-20 21:38:49.000000000 +0200
+++ src/makefile.unix 2014-06-21 16:53:52.000000000 +0200
@@ -63,7 +63,6 @@
LIBS+= \
-Wl,-B$(LMODE2) \
-l z \
- -l dl \
-l pthread
@@ -105,7 +104,7 @@
# CXXFLAGS can be specified on the make command line, so we use xCXXFLAGS that only
# adds some defaults in front. Unfortunately, CXXFLAGS=... $(CXXFLAGS) does not work.
-xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
+xCXXFLAGS= -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
$(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
# LDFLAGS can be specified on the make command line, so we use xLDFLAGS that only
@@ -113,7 +112,6 @@
xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
OBJS= \
- leveldb/libleveldb.a \
../libtorrent/src/.libs/libtorrent-rasterbar.a \
obj/alert.o \
obj/version.o \
@@ -169,9 +167,7 @@
# LevelDB support
#
MAKEOVERRIDES =
-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
-DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
-DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
+LIBS += -l leveldb -l memenv
leveldb/libleveldb.a:
@echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC="$(CC)" CXX="$(CXX)" OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..

View File

@ -0,0 +1,19 @@
--- src/scrypt.cpp.orig 2014-06-03 22:36:01.000000000 +0200
+++ src/scrypt.cpp 2014-06-15 23:01:59.000000000 +0200
@@ -34,6 +34,8 @@
#include <string.h>
#include <openssl/sha.h>
+#ifndef __FreeBSD__
+/* Allready defined in sys/endian.h */
static inline uint32_t be32dec(const void *pp)
{
const uint8_t *p = (uint8_t const *)pp;
@@ -49,6 +51,7 @@
p[1] = (x >> 16) & 0xff;
p[0] = (x >> 24) & 0xff;
}
+#endif
typedef struct HMAC_SHA256Context {
SHA256_CTX ictx;

View File

@ -0,0 +1,17 @@
--- src/scrypt.h.orig 2014-06-03 22:36:01.000000000 +0200
+++ src/scrypt.h 2014-06-15 22:44:40.000000000 +0200
@@ -17,6 +17,8 @@
PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, const uint8_t *salt,
size_t saltlen, uint64_t c, uint8_t *buf, size_t dkLen);
+# ifndef __FreeBSD__
+/* Allready defined in sys/endian.h */
static inline uint32_t le32dec(const void *pp)
{
const uint8_t *p = (uint8_t const *)pp;
@@ -32,4 +34,5 @@
p[2] = (x >> 16) & 0xff;
p[3] = (x >> 24) & 0xff;
}
+# endif
#endif

24
net-p2p/twister/pkg-descr Normal file
View File

@ -0,0 +1,24 @@
twister is an experimental decentralized P2P microblogging platform leveraging
from the free software implementations of Bitcoin and BitTorrent protocols.
User registration and authentication is provided by a bitcoin-like network, so
it is completely distributed (does not depend on any central authority).
Post distribution uses kademlia DHT network and bittorrent-like swarms, both are
provided by libtorrent.
Both Bitcoin and libtorrent versions included here are highly patched and do not
interoperate with existing networks (on purpose).
Warning! This is alpha software! In other words: this software is probably
difficult to compile, it is not feature-complete, it can be unstable, and it may
crash causing data loss. You have been warned.
If you choose to continue you probably must fall into one of the following
categories:
You are a developer.
You are an early adopter (who wants to reserve your nickname).
You are a masochist.
WWW: http://twister.net.co/