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

Collapse All | Expand All

(-)b/finance/chiapos/Makefile (+33 lines)
Added Link Here
1
# $FreeBSD$
2
3
PORTNAME=	chiapos
4
DISTVERSION=	1.0.3
5
CATEGORIES=	finance python
6
MASTER_SITES=	CHEESESHOP
7
DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
8
9
MAINTAINER=	risner@stdio.com
10
COMMENT=	Chia proof of space plotting, proving, and verifying (cmake part)
11
12
LICENSE=	APACHE20
13
LICENSE_FILE=	${WRKSRC}/LICENSE
14
15
USES=		cmake:noninja
16
USE_GITHUB=	nodefault
17
GH_TUPLE=	jarro2783:cxxopts:302302b30839505703d37fb82f536c53cf9172fa:c/src-ext/cxxopts \
18
		gulrak:filesystem:4e21ab305794f5309a1454b4ae82ab9a0f5e0d25:g/src-ext/gulrak
19
CMAKE_ARGS+=	-DCOMPILER_CXXFLAGS="${CXXFLAGS}" \
20
		-DCOMPILER_FLAGS="${CFLAGS}"
21
22
post-extract:
23
# This example is experimental, currently broken (upstream) and unnecessary.
24
# The placeholder Makefile is for when/if they release a future fixed version.
25
	@${CP} ${FILESDIR}/Hellman-Makefile ${WRKSRC}/hellman_example/Makefile
26
# Remove extraneous unused files to prevent confusion
27
	@${RM} ${WRKSRC}/lib/FiniteStateEntropy/fetch-content-CMakeLists.txt
28
	@${RM} ${WRKSRC}/pyproject.toml
29
30
do-test: stage
31
	${WRKDIR}/.build/RunTests
32
33
.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 (+34 lines)
Added Link Here
1
--- setup.py.orig	2021-05-28 02:40:44 UTC
2
+++ setup.py
3
@@ -9,13 +9,6 @@ from setuptools import setup, setuptools, Extension
4
 from setuptools.command.build_ext import build_ext
5
 from distutils.version import LooseVersion
6
 
7
-
8
-class CMakeExtension(Extension):
9
-    def __init__(self, name, sourcedir=""):
10
-        Extension.__init__(self, name, sources=["./"])
11
-        self.sourcedir = os.path.abspath(sourcedir)
12
-
13
-
14
 class CMakeBuild(build_ext):
15
     def run(self):
16
         try:
17
@@ -202,6 +195,7 @@ if platform.system() == "Windows":
18
 else:
19
     setup(
20
         name="chiapos",
21
+        version="1.0.3",
22
         author="Mariano Sorgente",
23
         author_email="mariano@chia.net",
24
         description="Chia proof of space plotting, proving, and verifying (wraps C++)",
25
@@ -209,8 +203,7 @@ else:
26
         python_requires=">=3.7",
27
         long_description=open("README.md").read(),
28
         long_description_content_type="text/markdown",
29
-        url="https://github.com/Chia-Network/chiavdf",
30
-        ext_modules=[CMakeExtension("chiapos", ".")],
31
+        url="https://github.com/Chia-Network/chiapos",
32
         cmdclass=dict(build_ext=CMakeBuild),
33
         zip_safe=False,
34
     )
(-)b/finance/chiapos/pkg-descr (+11 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
Any ghc references are not Haskell related, rather a developer initials.
7
The HellmanAttacks example is experimental and incomplete upstream.
8
9
This port is for the cmake build (binaries).
10
11
WWW: https://github.com/Chia-Network/chiapos
(-)b/finance/chiapos/pkg-plist (+2 lines)
Added Link Here
1
bin/ProofOfSpace
2
bin/RunTests

Return to bug 256509