diff --git a/finance/py-chiapos/Makefile b/finance/py-chiapos/Makefile new file mode 100644 index 0000000..dcfbc0a --- /dev/null +++ b/finance/py-chiapos/Makefile @@ -0,0 +1,39 @@ +# $FreeBSD$ + +PORTNAME= chiapos +DISTVERSION= 1.0.3 +CATEGORIES= finance python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} + +MAINTAINER= risner@stdio.com +COMMENT= Chia proof of space plotting, proving, and verifying (wraps C++) + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools_scm>=3.5.0:devel/py-setuptools_scm@${PY_FLAVOR} \ + cmake:devel/cmake \ + pybind11:devel/pybind11 + +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}flake8:devel/py-flake8@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}mypy:devel/py-mypy@${PY_FLAVOR} + +USES= python:3.7+ +USE_GITHUB= nodefault +GH_TUPLE= jarro2783:cxxopts:302302b30839505703d37fb82f536c53cf9172fa:c/src-ext/cxxopts \ + gulrak:filesystem:4e21ab305794f5309a1454b4ae82ab9a0f5e0d25:g/src-ext/gulrak +USE_PYTHON= autoplist concurrent distutils + +PYDISTUTILS_INSTALLARGS+= --skip-build + +post-extract: +# Remove extraneous unused files to prevent confusion + @${RM} ${WRKSRC}/lib/FiniteStateEntropy/fetch-content-CMakeLists.txt + @${RM} ${WRKSRC}/pyproject.toml + +do-test: stage + @(cd ${WRKSRC}; py.test ./tests -s -v) + +.include diff --git a/finance/py-chiapos/distinfo b/finance/py-chiapos/distinfo new file mode 100644 index 0000000..004b2ba --- /dev/null +++ b/finance/py-chiapos/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1623067298 +SHA256 (chiapos-1.0.3.tar.gz) = d987b481a3acbff1e0d77eb713af8d99ecec2bd11c2c465528a5078a433686bd +SIZE (chiapos-1.0.3.tar.gz) = 1291513 +SHA256 (jarro2783-cxxopts-302302b30839505703d37fb82f536c53cf9172fa_GH0.tar.gz) = 74e21646f3278243c9466665794d45410e63453ab7f3652acdae1d62efc4b21d +SIZE (jarro2783-cxxopts-302302b30839505703d37fb82f536c53cf9172fa_GH0.tar.gz) = 89640 +SHA256 (gulrak-filesystem-4e21ab305794f5309a1454b4ae82ab9a0f5e0d25_GH0.tar.gz) = fef3e809d584b77fd3ec677bd0d40cbe6737bbb3dbb1570fe1b2025262ea82c2 +SIZE (gulrak-filesystem-4e21ab305794f5309a1454b4ae82ab9a0f5e0d25_GH0.tar.gz) = 175696 diff --git a/finance/py-chiapos/files/patch-CMakeLists.txt b/finance/py-chiapos/files/patch-CMakeLists.txt new file mode 100644 index 0000000..98940e9 --- /dev/null +++ b/finance/py-chiapos/files/patch-CMakeLists.txt @@ -0,0 +1,54 @@ +--- CMakeLists.txt.orig 2021-05-28 02:40:44 UTC ++++ CMakeLists.txt +@@ -14,29 +14,8 @@ endif() + project(chiapos C CXX ASM) + + # CMake 3.14+ +-include(FetchContent) ++include(${CMAKE_INSTALL_PREFIX}/share/cmake/pybind11/pybind11Config.cmake) + +-FetchContent_Declare( +- pybind11-src +- GIT_REPOSITORY https://github.com/pybind/pybind11.git +- GIT_TAG v2.6.2 +-) +-FetchContent_MakeAvailable(pybind11-src) +- +-FetchContent_Declare( +- cxxopts +- GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git +- GIT_TAG v2.2.1 +-) +-FetchContent_MakeAvailable(cxxopts) +- +-FetchContent_Declare( +- gulrak +- GIT_REPOSITORY https://github.com/gulrak/filesystem.git +- GIT_TAG v1.5.6 +-) +-FetchContent_MakeAvailable(gulrak) +- + set(FSE_LIB ${CMAKE_CURRENT_SOURCE_DIR}/lib/FiniteStateEntropy/lib) + set(FSE_FILES + ${FSE_LIB}/fse_compress.c +@@ -48,8 +27,8 @@ set(FSE_FILES + include_directories( + ${INCLUDE_DIRECTORIES} + ${CMAKE_CURRENT_SOURCE_DIR}/../lib/include +- ${cxxopts_SOURCE_DIR}/include +- ${gulrak_SOURCE_DIR}/include/ghc ++ ${CMAKE_CURRENT_SOURCE_DIR}/src-ext/cxxopts/include ++ ${CMAKE_CURRENT_SOURCE_DIR}/src-ext/gulrak/include/ghc + ${CMAKE_CURRENT_SOURCE_DIR}/../lib/FiniteStateEntropy/lib + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/test +@@ -144,6 +123,9 @@ add_executable(RunTests + src/chacha8.c + ${BLAKE3_SRC} + ) ++ ++install(TARGETS ProofOfSpace DESTINATION bin) ++install(TARGETS RunTests DESTINATION bin) + + find_package(Threads REQUIRED) + diff --git a/finance/py-chiapos/files/patch-setup.py b/finance/py-chiapos/files/patch-setup.py new file mode 100644 index 0000000..3cfe712 --- /dev/null +++ b/finance/py-chiapos/files/patch-setup.py @@ -0,0 +1,19 @@ +--- setup.py.orig 2021-05-28 02:40:44 UTC ++++ setup.py +@@ -202,6 +202,7 @@ if platform.system() == "Windows": + else: + setup( + name="chiapos", ++ version="1.0.3", + author="Mariano Sorgente", + author_email="mariano@chia.net", + description="Chia proof of space plotting, proving, and verifying (wraps C++)", +@@ -209,7 +210,7 @@ else: + python_requires=">=3.7", + long_description=open("README.md").read(), + long_description_content_type="text/markdown", +- url="https://github.com/Chia-Network/chiavdf", ++ url="https://github.com/Chia-Network/chiapos", + ext_modules=[CMakeExtension("chiapos", ".")], + cmdclass=dict(build_ext=CMakeBuild), + zip_safe=False, diff --git a/finance/py-chiapos/pkg-descr b/finance/py-chiapos/pkg-descr new file mode 100644 index 0000000..71602a9 --- /dev/null +++ b/finance/py-chiapos/pkg-descr @@ -0,0 +1,11 @@ +Chia's proof of space is written in C++. Includes a plotter, prover, and +verifier. It exclusively runs on 64 bit architectures. Read the Proof of +Space document to learn about what proof of space is and how it works. + +Notes: +Any ghc references are not Haskell related, rather a developer initials. +The HellmanAttacks example is experimental and incomplete upstream. + +This port is for the Python module (library). + +WWW: https://github.com/Chia-Network/chiapos