mirror of
git://soft.sys114.com/WiringPi2-Python
synced 2026-02-04 14:10:36 +09:00
Merge pull request #56 from liffiton/master
Fix for building new WiringPi from source dist; build simplifications.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
graft WiringPi/wiringPi
|
||||
graft WiringPi/devLib
|
||||
recursive-include WiringPi *.h
|
||||
include README.md
|
||||
include LICENSE.txt
|
||||
include setup.cfg
|
||||
include wiringpi.py
|
||||
include wiringpi_wrap.c
|
||||
include bindings.i
|
||||
include constants.py
|
||||
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.
|
||||
|
||||
# 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`
|
||||
|
||||
```
|
||||
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
|
||||
# Usage
|
||||
|
||||
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:**
|
||||
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]
|
||||
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
|
||||
|
||||
from setuptools import setup, find_packages, Extension
|
||||
from setuptools import setup, Extension
|
||||
from glob import glob
|
||||
|
||||
sources = glob('WiringPi/devLib/*.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',
|
||||
@@ -18,16 +22,8 @@ _wiringpi = Extension(
|
||||
|
||||
setup(
|
||||
name = 'wiringpi',
|
||||
version = '2.44',
|
||||
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(),
|
||||
version = '2.44.2',
|
||||
ext_modules = [ _wiringpi ],
|
||||
py_modules = ["wiringpi"],
|
||||
install_requires=[],
|
||||
headers=glob('WiringPi/wiringPi/*.h')+glob('WiringPi/devLib/*.h')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user