Skip to content

Commit e066cc6

Browse files
committed
tools/depends: Add Filecoin and dependencies
This add Filecoin and the following dependencies: * Boost (date_time, filesystem, random, system) * cppcodec * LevelDB * TinyCBOR TODO: This causes '-Werror' to end up in Xcode compiler flags.
1 parent 37e4e1a commit e066cc6

File tree

8 files changed

+410
-1
lines changed

8 files changed

+410
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ set(required_deps ASS
120120
CrossGUID
121121
Curl
122122
FFMPEG
123+
Filecoin
123124
FlatBuffers
124125
Fmt
125126
FreeType

cmake/modules/FindFilecoin.cmake

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# FindFilecoin
2+
# --------
3+
# Finds the Filecoin libraries and dependencies
4+
#
5+
# This will define the following variables::
6+
#
7+
# FILECOIN_FOUND - system has Filecoin
8+
# FILECOIN_LIBRARIES - the Filecoin libraries
9+
#
10+
11+
find_package(filecoin REQUIRED CONFIG)
12+
13+
# Filecoin dependencies
14+
find_package(Boost REQUIRED date_time filesystem random system)
15+
find_package(Protobuf REQUIRED)
16+
find_package(spdlog REQUIRED)
17+
find_package(tsl_hat_trie REQUIRED)
18+
find_package(leveldb REQUIRED)
19+
20+
set(FILECOIN_FOUND 1)
21+
22+
# TODO: This comes from generated filecoinConfig.cmake
23+
set(FILECOIN_LIBRARIES
24+
filecoin::filecoin_array
25+
filecoin::filecoin_balance_table_hamt
26+
filecoin::filecoin_multimap
27+
filecoin::filecoin_message_pool
28+
filecoin::filecoin_block_producer
29+
filecoin::filecoin_block_validator
30+
filecoin::filecoin_weight_calculator
31+
filecoin::filecoin_clock
32+
filecoin::filecoin_cbor
33+
filecoin::filecoin_rle_plus_codec
34+
filecoin::filecoin_hexutil
35+
filecoin::filecoin_blob
36+
filecoin::filecoin_outcome
37+
filecoin::filecoin_buffer
38+
filecoin::filecoin_logger
39+
filecoin::filecoin_blake2
40+
filecoin::filecoin_bls_provider
41+
filecoin::filecoin_murmur
42+
filecoin::filecoin_randomness_provider
43+
filecoin::filecoin_vrf_provider
44+
filecoin::filecoin_signature
45+
filecoin::filecoin_address
46+
filecoin::filecoin_block
47+
filecoin::filecoin_chain
48+
filecoin::filecoin_chain_epoch_codec
49+
filecoin::filecoin_cid
50+
filecoin::filecoin_comm_cid
51+
filecoin::filecoin_piece
52+
filecoin::filecoin_rle_bitset
53+
filecoin::filecoin_tickets
54+
filecoin::filecoin_tipset
55+
filecoin::filecoin_amt
56+
filecoin::filecoin_chain_store
57+
filecoin::filecoin_datastore_key
58+
filecoin::filecoin_chain_data_store
59+
filecoin::filecoin_config
60+
filecoin::filecoin_filestore
61+
filecoin::filecoin_hamt
62+
filecoin::filecoin_in_memory_storage
63+
filecoin::filecoin_ipfs_datastore_in_memory
64+
filecoin::filecoin_ipfs_datastore_leveldb
65+
filecoin::filecoin_ipfs_blockservice
66+
filecoin::filecoin_ipfs_merkledag_service
67+
filecoin::filecoin_keystore
68+
filecoin::filecoin_leveldb
69+
filecoin::filecoin_repository
70+
filecoin::filecoin_filesystem_repository
71+
filecoin::filecoin_in_memory_repository
72+
filecoin::filecoin_fslock
73+
filecoin::filecoin_power_table
74+
filecoin::filecoin_power_table_hamt
75+
filecoin::filecoin_account_actor
76+
filecoin::filecoin_cron_actor
77+
filecoin::filecoin_init_actor
78+
filecoin::filecoin_miner_actor
79+
filecoin::filecoin_multisig_actor
80+
filecoin::filecoin_payment_channel_actor
81+
filecoin::filecoin_reward_actor
82+
filecoin::filecoin_builtin_shared
83+
filecoin::filecoin_storage_power_actor
84+
filecoin::filecoin_actor
85+
filecoin::filecoin_exit_code
86+
filecoin::filecoin_indices
87+
filecoin::filecoin_interpreter
88+
filecoin::filecoin_runtime
89+
filecoin::filecoin_state_tree
90+
filecoin::filecoin_message
91+
)

tools/depends/target/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ DEPENDS += \
2727
protobuf \
2828
spdlog \
2929

30+
# Filecoin dependencies
31+
DEPENDS += \
32+
cppcodec \
33+
filecoin \
34+
leveldb \
35+
tinycbor \
36+
3037
FFMPEG_DEPENDS = gnutls
3138

3239
ifeq ($(ENABLE_GPLV3),yes)
@@ -131,6 +138,7 @@ taglib: $(ZLIB)
131138
spdlog: libfmt
132139
protobuf: $(ZLIB)
133140
libp2p: boost boost-di gsl hat-trie openssl protobuf spdlog
141+
filecoin: boost boost-di cppcodec gsl hat-trie leveldb libp2p openssl protobuf spdlog tinycbor
134142

135143
.installed-$(PLATFORM): $(DEPENDS)
136144
touch $@

tools/depends/target/boost/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ ARCHIVE=$(SOURCE).tar.gz
2727
# * program_options
2828
# * random
2929
#
30-
BOOST_LIBRARIES=filesystem,program_options,random
30+
# filecoin:
31+
# * date_time
32+
# * filesystem
33+
# * random
34+
# * system
35+
#
36+
BOOST_LIBRARIES=date_time,filesystem,program_options,random,system
3137

3238
# The generated library
3339
LIBDYLIB=$(PLATFORM)/stage/lib/libboost_system.a
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
################################################################################
2+
# Header-only C++11 base32/base64 library
3+
#
4+
# https://github.com/tplgy/cppcodec
5+
# SPDX-License-Identifier: MIT
6+
#
7+
# cppcodec is a header-only C++11 library to encode/decode base64, base64url,
8+
# base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus
9+
# Crockford's base32.
10+
#
11+
################################################################################
12+
13+
-include ../../Makefile.include
14+
DEPS = Makefile
15+
16+
# lib name, version
17+
LIBNAME=cppcodec
18+
VERSION=0.2
19+
SOURCE=v$(VERSION)
20+
ARCHIVE=$(SOURCE).tar.gz
21+
22+
# The build directory
23+
BUILDDIR=$(PLATFORM)/build
24+
25+
# The generated library
26+
LIBDYLIB=$(BUILDDIR)/lib$(LIBNAME).a
27+
28+
CMAKE_OPTIONS := \
29+
-DCMAKE_INSTALL_PREFIX=$(PREFIX) \
30+
-DBUILD_TESTING=OFF \
31+
$(CMAKE_OPTIONS)
32+
33+
ifeq ($(CROSS_COMPILING), yes)
34+
DEPS += ../../Makefile.include
35+
else
36+
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
37+
38+
ifeq ($(PLATFORM),)
39+
PLATFORM = native
40+
TARBALLS_LOCATION = $(ROOT_DIR)
41+
BASE_URL := http://mirrors.kodi.tv/build-deps/sources
42+
RETRIEVE_TOOL := curl -Ls --create-dirs -f -O
43+
ARCHIVE_TOOL := tar --strip-components=1 -xf
44+
endif
45+
endif
46+
47+
# TODO
48+
BASE_URL := https://github.com/tplgy/cppcodec/archive
49+
50+
all: .installed-$(PLATFORM)
51+
52+
$(TARBALLS_LOCATION)/$(ARCHIVE):
53+
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
54+
55+
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
56+
ifeq ($(PREFIX),)
57+
@echo
58+
@echo "ERROR: please set PREFIX to the kodi install path e.g. make PREFIX=/usr/local"
59+
@exit 1
60+
endif
61+
rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
62+
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
63+
64+
$(LIBDYLIB): $(PLATFORM)
65+
mkdir -p $(BUILDDIR)
66+
cd $(BUILDDIR); $(CMAKE) $(CMAKE_OPTIONS) ..
67+
$(MAKE) -C $(BUILDDIR)
68+
69+
.installed-$(PLATFORM): $(LIBDYLIB)
70+
$(MAKE) -C $(BUILDDIR) install
71+
touch $@
72+
73+
clean:
74+
rm -rf .installed-$(PLATFORM)
75+
76+
distclean::
77+
rm -rf $(PLATFORM) .installed-$(PLATFORM)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
################################################################################
2+
# Fuhon - C++17 implementation of Filecoin
3+
#
4+
# https://filecoin.io
5+
# SPDX-License-Identifier: GPL-3.0-or-later
6+
#
7+
# Fuhon is an implementation of the Filecoin protocol being developed in C++.
8+
#
9+
################################################################################
10+
11+
-include ../../Makefile.include
12+
DEPS = Makefile
13+
14+
# lib name, version
15+
LIBNAME=filecoin
16+
VERSION=bd51e139a00e2c458ccc72758a4695165ca918ff
17+
SOURCE=$(VERSION)
18+
ARCHIVE=$(SOURCE).tar.gz
19+
20+
# The build directory
21+
BUILDDIR=$(PLATFORM)/build
22+
23+
# The generated library
24+
# TODO
25+
LIBDYLIB=$(BUILDDIR)/core/storage/ipfs/libipfs_blockservice.a
26+
27+
CMAKE_OPTIONS := \
28+
-DCMAKE_INSTALL_PREFIX=$(PREFIX) \
29+
-DHUNTER_ENABLED=OFF \
30+
-DBUILD_INTERNAL_DEPS=OFF \
31+
-DTESTING=OFF \
32+
-DCMAKE_CXX_STANDARD=17 \
33+
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
34+
-DCMAKE_CXX_EXTENSIONS=OFF \
35+
$(CMAKE_OPTIONS)
36+
37+
ifeq ($(CROSS_COMPILING), yes)
38+
DEPS += ../../Makefile.include
39+
else
40+
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
41+
42+
ifeq ($(PLATFORM),)
43+
PLATFORM = native
44+
TARBALLS_LOCATION = $(ROOT_DIR)
45+
BASE_URL := http://mirrors.kodi.tv/build-deps/sources
46+
RETRIEVE_TOOL := curl -Ls --create-dirs -f -O
47+
ARCHIVE_TOOL := tar --strip-components=1 -xf
48+
endif
49+
endif
50+
51+
# TODO
52+
BASE_URL := https://github.com/eigendude/cpp-filecoin/archive
53+
54+
all: .installed-$(PLATFORM)
55+
56+
$(TARBALLS_LOCATION)/$(ARCHIVE):
57+
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
58+
59+
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
60+
ifeq ($(PREFIX),)
61+
@echo
62+
@echo "ERROR: please set PREFIX to the kodi install path e.g. make PREFIX=/usr/local"
63+
@exit 1
64+
endif
65+
rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
66+
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
67+
68+
$(LIBDYLIB): $(PLATFORM)
69+
mkdir -p $(BUILDDIR)
70+
cd $(BUILDDIR); $(CMAKE) $(CMAKE_OPTIONS) ..
71+
$(MAKE) -C $(BUILDDIR)
72+
73+
.installed-$(PLATFORM): $(LIBDYLIB)
74+
$(MAKE) -C $(BUILDDIR) install
75+
touch $@
76+
77+
clean:
78+
rm -rf .installed-$(PLATFORM)
79+
80+
distclean::
81+
rm -rf $(PLATFORM) .installed-$(PLATFORM)

tools/depends/target/leveldb/Makefile

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
################################################################################
2+
# GSL: Guidelines Support Library
3+
#
4+
# https://github.com/microsoft/GSL
5+
# SPDX-License-Identifier: MIT
6+
#
7+
# The Guidelines Support Library (GSL) contains functions and types that are
8+
# suggested for use by the C++ Core Guidelines maintained by the Standard C++
9+
# Foundation.
10+
#
11+
################################################################################
12+
13+
-include ../../Makefile.include
14+
DEPS = Makefile
15+
16+
# lib name, version
17+
LIBNAME=leveldb
18+
VERSION=1.22
19+
SOURCE=$(VERSION)
20+
ARCHIVE=$(SOURCE).tar.gz
21+
22+
# The build directory
23+
BUILDDIR=$(PLATFORM)/build
24+
25+
# The generated library
26+
LIBDYLIB=$(BUILDDIR)/lib$(LIBNAME).a
27+
28+
CMAKE_OPTIONS := \
29+
-DCMAKE_INSTALL_PREFIX=$(PREFIX) \
30+
-DLEVELDB_BUILD_TESTS=OFF \
31+
-DLEVELDB_BUILD_BENCHMARKS=OFF \
32+
$(CMAKE_OPTIONS)
33+
34+
ifeq ($(CROSS_COMPILING), yes)
35+
DEPS += ../../Makefile.include
36+
else
37+
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
38+
39+
ifeq ($(PLATFORM),)
40+
PLATFORM = native
41+
TARBALLS_LOCATION = $(ROOT_DIR)
42+
BASE_URL := http://mirrors.kodi.tv/build-deps/sources
43+
RETRIEVE_TOOL := curl -Ls --create-dirs -f -O
44+
ARCHIVE_TOOL := tar --strip-components=1 -xf
45+
endif
46+
endif
47+
48+
# TODO
49+
BASE_URL := https://github.com/google/leveldb/archive
50+
51+
all: .installed-$(PLATFORM)
52+
53+
$(TARBALLS_LOCATION)/$(ARCHIVE):
54+
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
55+
56+
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
57+
ifeq ($(PREFIX),)
58+
@echo
59+
@echo "ERROR: please set PREFIX to the kodi install path e.g. make PREFIX=/usr/local"
60+
@exit 1
61+
endif
62+
rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
63+
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
64+
65+
$(LIBDYLIB): $(PLATFORM)
66+
mkdir -p $(BUILDDIR)
67+
cd $(BUILDDIR); $(CMAKE) $(CMAKE_OPTIONS) ..
68+
$(MAKE) -C $(BUILDDIR)
69+
70+
.installed-$(PLATFORM): $(LIBDYLIB)
71+
$(MAKE) -C $(BUILDDIR) install
72+
touch $@
73+
74+
clean:
75+
rm -rf .installed-$(PLATFORM)
76+
77+
distclean::
78+
rm -rf $(PLATFORM) .installed-$(PLATFORM)

0 commit comments

Comments
 (0)