Skip to content

Commit

Permalink
integrate plugin changes to blake2 build
Browse files Browse the repository at this point in the history
  • Loading branch information
jberthold committed Mar 24, 2024
1 parent 0240236 commit 9ee95e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions kevm-pyk/src/kevm_pyk/kdist/plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import shutil
import sys
from distutils.dir_util import copy_tree
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -65,13 +64,13 @@ def build(self, output_dir: Path, deps: dict[str, Any], args: dict[str, Any], ve

copy_tree(str(config.PLUGIN_DIR), '.')
run_process(
['make', 'libcryptopp', 'libff', 'plugin-c/blake2.a', '-j8'],
['make', 'libcryptopp', 'libff', 'blake2', '-j8'],
pipe_stdout=not verbose,
)

copy_tree('./build/libcryptopp', str(output_dir / 'libcryptopp'))
copy_tree('./build/libff', str(output_dir / 'libff'))
shutil.copy2('./plugin-c/blake2.a', output_dir / 'plugin-c' / 'blake2.a')
copy_tree('./build/blake2', str(output_dir / 'blake2'))

def source(self) -> tuple[Path]:
return (config.PLUGIN_DIR,)
Expand Down
4 changes: 3 additions & 1 deletion kevm-pyk/src/kevm_pyk/kompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,13 @@ def lib_ccopts(plugin_dir: Path, debug_build: bool = False) -> list[str]:
libcryptopp_dir = plugin_dir / 'libcryptopp'
ccopts += [f'{libcryptopp_dir}/lib/libcryptopp.a', f'-I{libcryptopp_dir}/include']

blake2_dir = plugin_dir / 'blake2'
ccopts += [f'{blake2_dir}/lib/blake2.a']

plugin_include = plugin_dir / 'plugin-c'
ccopts += [
f'{plugin_include}/plugin_util.cpp',
f'{plugin_include}/crypto.cpp',
f'{plugin_include}/blake2.a',
]

if kernel == 'darwin':
Expand Down

0 comments on commit 9ee95e5

Please sign in to comment.