mirror of
git://soft.sys114.com/WiringPi2-Python
synced 2026-02-04 16:00:35 +09:00
Fix for building new WiringPi from source dist; build simplifications.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
graft WiringPi/wiringPi
|
recursive-include WiringPi *.h
|
||||||
graft WiringPi/devLib
|
|
||||||
include README.md
|
include README.md
|
||||||
include LICENSE.txt
|
include LICENSE.txt
|
||||||
include setup.cfg
|
include bindings.i
|
||||||
include wiringpi.py
|
include constants.py
|
||||||
include wiringpi_wrap.c
|
include wiringpi-class.py
|
||||||
|
|||||||
78
README.md
78
README.md
@@ -11,59 +11,11 @@ WiringPi: An implementation of most of the Arduino Wiring
|
|||||||
|
|
||||||
WiringPi implements new functions for managing IO expanders.
|
WiringPi implements new functions for managing IO expanders.
|
||||||
|
|
||||||
# Quick Build
|
# Quick Install
|
||||||
|
|
||||||
A quick and dirty build script is supplied to install WiringPi-Python for Python 2 and 3. Just:
|
`pip install wiringpi`
|
||||||
|
|
||||||
```
|
# Usage
|
||||||
sudo apt-get install wiringpi
|
|
||||||
git clone --recursive https://github.com/WiringPi/WiringPi-Python.git
|
|
||||||
cd WiringPi-Python
|
|
||||||
./build.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
# Manual Build
|
|
||||||
|
|
||||||
## Get/setup repo
|
|
||||||
```bash
|
|
||||||
git clone --recursive https://github.com/WiringPi/WiringPi-Python.git
|
|
||||||
cd WiringPi-Python
|
|
||||||
git submodule update --init
|
|
||||||
```
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
To rebuild the bindings
|
|
||||||
you **must** first have python-dev, python-setuptools and swig installed. Wiring Pi should also be installed system-wide
|
|
||||||
for access to the `gpio` tool.
|
|
||||||
```bash
|
|
||||||
sudo apt-get install python-dev python-setuptools swig wiringpi
|
|
||||||
```
|
|
||||||
|
|
||||||
## Build WiringPi
|
|
||||||
```bash
|
|
||||||
cd WiringPi
|
|
||||||
sudo ./build
|
|
||||||
```
|
|
||||||
|
|
||||||
## Generate Bindings
|
|
||||||
|
|
||||||
Return to the root directory of the repository and:
|
|
||||||
|
|
||||||
`swig2.0 -python wiringpi.i`
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
`swig3.0 -thread -python wiringpi.i`
|
|
||||||
|
|
||||||
## Build & install with
|
|
||||||
|
|
||||||
`sudo python setup.py install`
|
|
||||||
|
|
||||||
Or Python 3:
|
|
||||||
|
|
||||||
`sudo python3 setup.py install`
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
import wiringpi
|
import wiringpi
|
||||||
|
|
||||||
@@ -112,3 +64,27 @@ Hook a speaker up to your Pi and generate music with softTone. Also useful for g
|
|||||||
|
|
||||||
**Full details at:**
|
**Full details at:**
|
||||||
http://www.wiringpi.com
|
http://www.wiringpi.com
|
||||||
|
|
||||||
|
# Manual Build
|
||||||
|
|
||||||
|
## Get/setup repo
|
||||||
|
```bash
|
||||||
|
git clone --recursive https://github.com/WiringPi/WiringPi-Python.git
|
||||||
|
cd WiringPi-Python
|
||||||
|
```
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
To rebuild the bindings
|
||||||
|
you **must** first have python-dev, python-setuptools and swig installed. Wiring Pi should also be installed system-wide
|
||||||
|
for access to the `gpio` tool.
|
||||||
|
```bash
|
||||||
|
sudo apt-get install python-dev python-setuptools swig wiringpi
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build & install with
|
||||||
|
|
||||||
|
`sudo python setup.py install`
|
||||||
|
|
||||||
|
Or Python 3:
|
||||||
|
|
||||||
|
`sudo python3 setup.py install`
|
||||||
|
|||||||
3
build.sh
3
build.sh
@@ -1,3 +0,0 @@
|
|||||||
swig2.0 -python -threads wiringpi.i
|
|
||||||
sudo python setup.py build install
|
|
||||||
sudo python test.py
|
|
||||||
@@ -1,2 +1,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
description-file = README.md
|
author = Philip Howard
|
||||||
|
author_email = phil@gadgetoid.com
|
||||||
|
url = https://github.com/WiringPi/WiringPi-Python/
|
||||||
|
description = A python interface to WiringPi 2.0 library which allows for easily interfacing with the GPIO pins of the Raspberry Pi. Also supports i2c and SPI.
|
||||||
|
long_description = file:README.md
|
||||||
|
license = LGPL
|
||||||
|
|||||||
20
setup.py
20
setup.py
@@ -1,13 +1,17 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from setuptools import setup, find_packages, Extension
|
from setuptools import setup, Extension
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
|
||||||
sources = glob('WiringPi/devLib/*.c')
|
sources = glob('WiringPi/devLib/*.c')
|
||||||
sources += glob('WiringPi/wiringPi/*.c')
|
sources += glob('WiringPi/wiringPi/*.c')
|
||||||
sources += ['wiringpi_wrap.c']
|
sources += ['wiringpi.i']
|
||||||
|
|
||||||
sources.remove('WiringPi/devLib/piFaceOld.c')
|
try:
|
||||||
|
sources.remove('WiringPi/devLib/piFaceOld.c')
|
||||||
|
except ValueError:
|
||||||
|
# the file is already excluded in the source distribution
|
||||||
|
pass
|
||||||
|
|
||||||
_wiringpi = Extension(
|
_wiringpi = Extension(
|
||||||
'_wiringpi',
|
'_wiringpi',
|
||||||
@@ -18,16 +22,8 @@ _wiringpi = Extension(
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'wiringpi',
|
name = 'wiringpi',
|
||||||
version = '2.44',
|
version = '2.44.2',
|
||||||
author = "Philip Howard",
|
|
||||||
author_email = "phil@gadgetoid.com",
|
|
||||||
url = 'https://github.com/WiringPi/WiringPi-Python/',
|
|
||||||
description = """A python interface to WiringPi 2.0 library which allows for
|
|
||||||
easily interfacing with the GPIO pins of the Raspberry Pi. Also supports
|
|
||||||
i2c and SPI""",
|
|
||||||
long_description=open('README.md').read(),
|
|
||||||
ext_modules = [ _wiringpi ],
|
ext_modules = [ _wiringpi ],
|
||||||
py_modules = ["wiringpi"],
|
py_modules = ["wiringpi"],
|
||||||
install_requires=[],
|
install_requires=[],
|
||||||
headers=glob('WiringPi/wiringPi/*.h')+glob('WiringPi/devLib/*.h')
|
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user