-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
34 lines (30 loc) · 1011 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from setuptools import setup, find_packages
def build_native(spec):
# Step 1: build the rust library
build = spec.add_external_build(
cmd=['cargo', 'build', '--release'],
path='.'
)
# Step 2: add a cffi module based on the dylib we built
#
# We use lambdas here for dylib and header_filename so that those are
# only called after the external build finished.
spec.add_cffi_module(
module_path='minecraft_nether_gen_rs._native',
dylib=lambda: build.find_dylib('minecraft_nether_gen_rs', in_path='target/release'),
header_filename=lambda: build.find_header('minecraft_nether_gen_rs.h', in_path='target'),
rtld_flags=['NOW', 'NODELETE']
)
setup(
name='minecraft_nether_gen_rs',
version='1.1.1',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
platforms='any',
setup_requires=['milksnake'],
install_requires=['milksnake'],
milksnake_tasks=[
build_native,
]
)