View | Details | Raw Unified | Return to bug 256509 | Differences between
and this patch

Collapse All | Expand All

(-)b/finance/chiapos/Makefile (+54 lines)
Added Link Here
1
# $FreeBSD$
2
3
PORTNAME=	chiapos
4
DISTVERSION=	1.0.3
5
CATEGORIES=	finance
6
#CATEGORIES=	finance python
7
MASTER_SITES=	CHEESESHOP
8
DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
9
10
MAINTAINER=	risner@stdio.com
11
COMMENT=	Chia proof of space plotting, proving, and verifying (cmake part)
12
13
LICENSE=	APACHE20 BSD2CLAUSE MIT
14
LICENSE_COMB=	multi
15
LICENSE_FILE_APACHE20=	${WRKSRC}/LICENSE
16
LICENSE_FILE_BSD2CLAUSE=	${WRKSRC}/lib/FiniteStateEntropy/LICENSE
17
LICENSE_FILE_MIT=	${WRKSRC}/MIT-LICENSES
18
LICENSE_DISTFILES_APACHE20=	${DISTNAME}${EXTRACT_SUFX}
19
LICENSE_DISTFILES_BSD2CLAUSE=	${DISTNAME}${EXTRACT_SUFX}
20
LICENSE_DISTFILES_MIT=		${DISTNAME}${EXTRACT_SUFX} ${DISTFILE_c} \
21
				${DISTFILE_g}
22
23
USES=		cmake:noninja
24
USE_GITHUB=	nodefault
25
GH_TUPLE=	jarro2783:cxxopts:302302b30839505703d37fb82f536c53cf9172fa:c/src-ext/cxxopts \
26
		gulrak:filesystem:4e21ab305794f5309a1454b4ae82ab9a0f5e0d25:g/src-ext/gulrak
27
CMAKE_ARGS+=	-DCOMPILER_CXXFLAGS="${CXXFLAGS}" \
28
		-DCOMPILER_FLAGS="${CFLAGS}"
29
PLIST_FILES=	bin/ProofOfSpace \
30
		bin/RunTests
31
#BUILD_DEPENDS=	${LOCALBASE}/include/pybind11/pybind11.h:devel/pybind11
32
33
post-extract:
34
# This example is experimental, currently broken (upstream) and unnecessary.
35
# The placeholder Makefile is for when/if they release a future fixed version.
36
	@${CP} ${FILESDIR}/Hellman-Makefile ${WRKSRC}/hellman_example/Makefile
37
# Remove extraneous unused files to prevent confusion
38
	@${RM} ${WRKSRC}/lib/FiniteStateEntropy/fetch-content-CMakeLists.txt
39
	@${RM} ${WRKSRC}/pyproject.toml
40
# Concatenate the MIT licenses
41
	@( ${ECHO_MSG} "uint128_t license:"; \
42
		${CAT} ${WRKSRC}/uint128_t/LICENSE; \
43
		${ECHO_MSG} ""; ${ECHO_MSG} ""; \
44
		${ECHO_MSG} "cxxopts license:"; \
45
		${CAT} ${WRKSRC}/src-ext/cxxopts/LICENSE; \
46
		${ECHO_MSG} ""; ${ECHO_MSG} ""; \
47
		${ECHO_MSG} "gulrak license:"; \
48
		${CAT} ${WRKSRC}/src-ext/gulrak/LICENSE ) \
49
			> ${WRKSRC}/MIT-LICENSES
50
51
do-test: stage
52
	${WRKDIR}/.build/RunTests
53
54
.include <bsd.port.mk>
(-)b/finance/chiapos/distinfo (+7 lines)
Added Link Here
1
TIMESTAMP = 1623067298
2
SHA256 (chiapos-1.0.3.tar.gz) = d987b481a3acbff1e0d77eb713af8d99ecec2bd11c2c465528a5078a433686bd
3
SIZE (chiapos-1.0.3.tar.gz) = 1291513
4
SHA256 (jarro2783-cxxopts-302302b30839505703d37fb82f536c53cf9172fa_GH0.tar.gz) = 74e21646f3278243c9466665794d45410e63453ab7f3652acdae1d62efc4b21d
5
SIZE (jarro2783-cxxopts-302302b30839505703d37fb82f536c53cf9172fa_GH0.tar.gz) = 89640
6
SHA256 (gulrak-filesystem-4e21ab305794f5309a1454b4ae82ab9a0f5e0d25_GH0.tar.gz) = fef3e809d584b77fd3ec677bd0d40cbe6737bbb3dbb1570fe1b2025262ea82c2
7
SIZE (gulrak-filesystem-4e21ab305794f5309a1454b4ae82ab9a0f5e0d25_GH0.tar.gz) = 175696
(-)b/finance/chiapos/files/Hellman-Makefile (+14 lines)
Added Link Here
1
all: HellmanAttacks
2
3
OBJ = aes.o bits.o calculate_bucket.o cxxopts.o encoding.o hellman.o picosha2.o plotter_disk.o pos_constants.o prover_disk.o sort_on_disk.o util.o verifier.o
4
5
.SUFFIXES:.hpp .o
6
7
.hpp.o:
8
	$(CC) -c $(CXXFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
9
10
HellmanAttacks: ${OBJ}
11
	${CC} -o HellmanAttacks ${OBJ}
12
13
clean:
14
	rm -f HellmanAttacks ${OBJ}
(-)b/finance/chiapos/files/patch-CMakeLists.txt (+89 lines)
Added Link Here
1
--- CMakeLists.txt.orig	2021-05-28 02:40:44 UTC
2
+++ CMakeLists.txt
3
@@ -14,29 +14,7 @@ endif()
4
 project(chiapos C CXX ASM)
5
 
6
 # CMake 3.14+
7
-include(FetchContent)
8
 
9
-FetchContent_Declare(
10
-  pybind11-src
11
-  GIT_REPOSITORY https://github.com/pybind/pybind11.git
12
-  GIT_TAG        v2.6.2
13
-)
14
-FetchContent_MakeAvailable(pybind11-src)
15
-
16
-FetchContent_Declare(
17
-  cxxopts
18
-  GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
19
-  GIT_TAG        v2.2.1
20
-)
21
-FetchContent_MakeAvailable(cxxopts)
22
-
23
-FetchContent_Declare(
24
-  gulrak
25
-  GIT_REPOSITORY https://github.com/gulrak/filesystem.git
26
-  GIT_TAG        v1.5.6
27
-)
28
-FetchContent_MakeAvailable(gulrak)
29
-
30
 set(FSE_LIB ${CMAKE_CURRENT_SOURCE_DIR}/lib/FiniteStateEntropy/lib)
31
 set(FSE_FILES
32
     ${FSE_LIB}/fse_compress.c
33
@@ -48,8 +26,8 @@ set(FSE_FILES
34
 include_directories(
35
   ${INCLUDE_DIRECTORIES}
36
   ${CMAKE_CURRENT_SOURCE_DIR}/../lib/include
37
-  ${cxxopts_SOURCE_DIR}/include
38
-  ${gulrak_SOURCE_DIR}/include/ghc
39
+  ${CMAKE_CURRENT_SOURCE_DIR}/src-ext/cxxopts/include
40
+  ${CMAKE_CURRENT_SOURCE_DIR}/src-ext/gulrak/include/ghc
41
   ${CMAKE_CURRENT_SOURCE_DIR}/../lib/FiniteStateEntropy/lib
42
   ${CMAKE_CURRENT_SOURCE_DIR}/src
43
   ${CMAKE_CURRENT_SOURCE_DIR}/test
44
@@ -130,8 +108,6 @@ set(BLAKE3_SRC
45
 )
46
 ENDIF()
47
 
48
-pybind11_add_module(chiapos ${CMAKE_CURRENT_SOURCE_DIR}/python-bindings/chiapos.cpp src/chacha8.c ${BLAKE3_SRC})
49
-
50
 add_executable(ProofOfSpace
51
     src/cli.cpp
52
     src/chacha8.c
53
@@ -145,33 +121,30 @@ add_executable(RunTests
54
     ${BLAKE3_SRC}
55
 )
56
 
57
+install(TARGETS ProofOfSpace DESTINATION bin)
58
+install(TARGETS RunTests DESTINATION bin)
59
+
60
 find_package(Threads REQUIRED)
61
 
62
 add_library(uint128 STATIC uint128_t/uint128_t.cpp)
63
 target_include_directories(uint128 PUBLIC uint128_t)
64
 
65
 target_compile_features(fse PUBLIC cxx_std_17)
66
-target_compile_features(chiapos PUBLIC cxx_std_17)
67
 target_compile_features(RunTests PUBLIC cxx_std_17)
68
 
69
 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
70
-  target_link_libraries(chiapos PRIVATE fse Threads::Threads)
71
   target_link_libraries(ProofOfSpace fse Threads::Threads)
72
   target_link_libraries(RunTests fse Threads::Threads)
73
 elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
74
-  target_link_libraries(chiapos PRIVATE fse Threads::Threads)
75
   target_link_libraries(ProofOfSpace fse Threads::Threads)
76
   target_link_libraries(RunTests fse Threads::Threads)
77
 elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
78
-  target_link_libraries(chiapos PRIVATE fse Threads::Threads)
79
   target_link_libraries(ProofOfSpace fse Threads::Threads)
80
   target_link_libraries(RunTests fse Threads::Threads)
81
 elseif (MSVC)
82
-  target_link_libraries(chiapos PRIVATE fse Threads::Threads uint128)
83
   target_link_libraries(ProofOfSpace fse Threads::Threads uint128)
84
   target_link_libraries(RunTests fse Threads::Threads uint128)
85
 else()
86
-  target_link_libraries(chiapos PRIVATE fse stdc++fs Threads::Threads)
87
   target_link_libraries(ProofOfSpace fse stdc++fs Threads::Threads)
88
   target_link_libraries(RunTests fse stdc++fs Threads::Threads)
89
 endif()
(-)b/finance/chiapos/files/patch-setup.py (+30 lines)
Added Link Here
1
--- setup.py.orig	2021-05-28 02:40:44 UTC
2
+++ setup.py
3
@@ -107,9 +100,6 @@ ext_modules = [
4
             "src/chacha8.c",
5
         ],
6
         include_dirs=[
7
-            # Path to pybind11 headers
8
-            get_pybind_include(),
9
-            get_pybind_include(user=True),
10
             "src",
11
             "uint128_t",
12
             ".",
13
@@ -202,6 +192,7 @@ if platform.system() == "Windows":
14
 else:
15
     setup(
16
         name="chiapos",
17
+        version="1.0.3",
18
         author="Mariano Sorgente",
19
         author_email="mariano@chia.net",
20
         description="Chia proof of space plotting, proving, and verifying (wraps C++)",
21
@@ -209,8 +200,7 @@ else:
22
         python_requires=">=3.7",
23
         long_description=open("README.md").read(),
24
         long_description_content_type="text/markdown",
25
-        url="https://github.com/Chia-Network/chiavdf",
26
-        ext_modules=[CMakeExtension("chiapos", ".")],
27
+        url="https://github.com/Chia-Network/chiapos",
28
         cmdclass=dict(build_ext=CMakeBuild),
29
         zip_safe=False,
30
     )
(-)b/finance/chiapos/pkg-descr (+10 lines)
Added Link Here
1
Chia's proof of space is written in C++. Includes a plotter, prover, and
2
verifier. It exclusively runs on 64 bit architectures. Read the Proof of
3
Space document to learn about what proof of space is and how it works.
4
5
Notes:
6
i386 is not supported, and would be too slow for practical use if supported.
7
8
This port is for the cmake build (binaries).
9
10
WWW: https://github.com/Chia-Network/chiapos

Return to bug 256509