Skip to content

Commit

Permalink
Added instructions for setting up APT repository
Browse files Browse the repository at this point in the history
  • Loading branch information
marius-meissner committed Jan 20, 2018
1 parent 316eedb commit 76262b1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ LINKER = g++
# Compiler and linker flags
#

COMPILER_FLAGS = -Wall -I/usr/local/src/php-7.0 -I/usr/local/src/php-7.0/main -I/usr/local/src/php-7.0/Zend -I/usr/local/src/php-7.0/TSRM -c -O2 -std=c++11 -fpic -o
COMPILER_FLAGS = -Wall -I/usr/local/src/php -I/usr/local/src/php/main -I/usr/local/src/php/Zend -I/usr/local/src/php/TSRM -c -O2 -std=c++11 -fpic -o
LINKER_FLAGS = -shared
LINKER_DEPENDENCIES = -lpigpio -lphpcpp

Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@ Extension is still in alpha state. Please don't hesitate to report bugs, make su
The extension uses the great [pigpio library](http://abyz.me.uk/rpi/pigpio/index.html) and is build on top of [PHP-CPP](http://www.php-cpp.com/).

# Installation
For the moment only PHP 7.0 is tested. As soon we reach BETA status, backports will be created.
Deployment via official DEB repository is planned.

## Precompiled release
Download the latest shared object and include it into php.ini:
## DEB repository
The easies way for keeping the extension up2date on the latest stable release.
```bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BB761EA8
echo "deb https://deb.berry.volantus.org/ stretch main" | sudo tee -a /etc/apt/sources.list.d/volantus-berry.list
sudo apt-get update
# Choose your PHP version:
sudo apt-get install php7.0-berry-spi
sudo apt-get install php7.1-berry-spi
```
## Precompiled release (shared object)
Download the latest shared object (Replace the x chars by release and PHP version) and include it into php.ini:
```bash
cd /usr/lib/php/$(php -v | grep -i 'PHP [57]' | cut -c1-8 | sed s/'PHP '//g | cut -c1-3)
wget https://github.com/Volantus/berry-spi/releases/download/0.2.0/berry-spi.so
wget -O berry-spi.so https://github.com/Volantus/berry-spi/releases/download/x.x.x/php-x.x-berry-spi.so
sudo echo "extension=berry-spi.so" >> /etc/php/7.0/cli/php.ini
```
## Compile from source
Expand Down
1 change: 1 addition & 0 deletions berry-spi.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension=berry-spi.so
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
*/
PHPCPP_EXPORT void *get_module()
{
static Php::Extension extension("berry-spi", "0.2.0");
static Php::Extension extension("berry-spi", "0.4.1");

Php::Interface spiInterfaceInterface("Volantus\\BerrySpi\\SpiInterface");

Expand Down

0 comments on commit 76262b1

Please sign in to comment.