From 50cdc4d93ab4924911732461dc003442d7b5c29f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 21 Jun 2014 14:52:03 +0300 Subject: [PATCH] fcntl: Depend on _libc. --- fcntl/fcntl.py | 3 ++- fcntl/metadata.txt | 5 +++++ fcntl/setup.py | 17 +++++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 fcntl/metadata.txt diff --git a/fcntl/fcntl.py b/fcntl/fcntl.py index 06a26422..d76d181e 100644 --- a/fcntl/fcntl.py +++ b/fcntl/fcntl.py @@ -1,7 +1,8 @@ import ffi +import _libc -libc = ffi.open("libc.so.6") +libc = _libc.get() fcntl_l = libc.func("i", "fcntl", "iil") fcntl_s = libc.func("i", "fcntl", "iip") diff --git a/fcntl/metadata.txt b/fcntl/metadata.txt new file mode 100644 index 00000000..d005fad3 --- /dev/null +++ b/fcntl/metadata.txt @@ -0,0 +1,5 @@ +srctype = micropython-lib +type = module +version = 0.0.2 +author = Paul Sokolovsky +depends = libc diff --git a/fcntl/setup.py b/fcntl/setup.py index d7cced4b..2bb10df0 100644 --- a/fcntl/setup.py +++ b/fcntl/setup.py @@ -1,10 +1,19 @@ -from distutils.core import setup +import sys +# Remove current dir from sys.path, otherwise setuptools will peek up our +# module instead of system. +sys.path.pop(0) +from setuptools import setup + setup(name='micropython-fcntl', - version='0.0.1', + version='0.0.2', description='fcntl module for MicroPython', + long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.", url='https://github.com/micropython/micropython/issues/405', - author='MicroPython Developers', + author='Paul Sokolovsky', author_email='micro-python@googlegroups.com', + maintainer='MicroPython Developers', + maintainer_email='micro-python@googlegroups.com', license='MIT', - py_modules=['fcntl']) + py_modules=['fcntl'], + install_requires=['micropython-libc'])