Squashed 'import-layers/meta-raspberrypi/' content from commit 2745399

Change-Id: I8a89d81813dea98209d089ef500a403ea4da5d9d
git-subtree-dir: import-layers/meta-raspberrypi
git-subtree-split: 2745399f75d7564fcc586d0365ff73be47849d0e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.46.bb b/import-layers/meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.46.bb
new file mode 100644
index 0000000..dd37b8f
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.46.bb
@@ -0,0 +1,40 @@
+DESCRIPTION = "Package that provides access to GPIO and other IO\
+functions on the Broadcom BCM 2835 chip, allowing access to the\
+GPIO pins on the 26 pin IDE plug on the RPi board"
+SECTION = "base"
+HOMEPAGE = "http://www.open.com.au/mikem/bcm2835"
+AUTHOR = "Mike McCauley (mikem@open.com.au)"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+COMPATIBLE_MACHINE = "raspberrypi"
+
+SRC_URI = "http://www.airspayce.com/mikem/bcm2835/bcm2835-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "3a40c01ee7d81fbff80c54fbe1a351b5"
+SRC_URI[sha256sum] = "fc6b0412525e6b7e85aeffec67e2d01a99fb906346620041e6684d59ea5517a7"
+
+inherit autotools
+
+do_compile_append() {
+    # Now compiling the examples provided by the package
+    mkdir -p ${B}/examples
+    for file in `ls ${S}/examples`; do
+        ${CC} ${S}/examples/${file}/${file}.c -o ${B}/examples/${file} -Bstatic -L${B}/src -lbcm2835 -I${S}/src
+    done
+}
+
+do_install_append() {
+    install -d ${D}/${libdir}/${BPN}
+    for file in ${B}/examples/*
+    do
+        install -m 0755 ${file} ${D}/${libdir}/${BPN}
+    done
+}
+
+PACKAGES += "${PN}-tests"
+
+FILES_${PN} = ""
+FILES_${PN}-tests = "${libdir}/${BPN}"
+FILES_${PN}-dbg += "${libdir}/${BPN}/.debug"
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch
new file mode 100644
index 0000000..7ea9a3b
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch
@@ -0,0 +1,77 @@
+Remove dependencies on LSB functions
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Alex Lennon <ajlennon@dynamicdevices.co.uk>
+
+diff -ur git.org/pi-blaster.boot.sh git/pi-blaster.boot.sh
+--- git.org/pi-blaster.boot.sh	2014-05-20 14:49:44.378582168 +0100
++++ git/pi-blaster.boot.sh	2014-05-20 14:51:08.330582386 +0100
+@@ -28,12 +28,12 @@
+ [ -r /etc/default/$NAME ] && . /etc/default/$NAME
+ 
+ # Load the VERBOSE setting and other rcS variables
+-. /lib/init/vars.sh
++#. /lib/init/vars.sh
+ 
+ # Define LSB log_* functions.
+ # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+ # and status_of_proc is working.
+-. /lib/lsb/init-functions
++#. /lib/lsb/init-functions
+ 
+ #
+ # Function that starts the daemon/service
+@@ -77,48 +77,23 @@
+ 
+ case "$1" in
+   start)
+-	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
++	[ "$VERBOSE" != no ] && echo "Starting $DESC" "$NAME"
+ 	do_start
+-	case "$?" in
+-		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+-		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+-	esac
+ 	;;
+   stop)
+-	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
++	[ "$VERBOSE" != no ] && echo "Stopping $DESC" "$NAME"
+ 	do_stop
+-	case "$?" in
+-		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+-		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+-	esac
+-	;;
+-  status)
+-	status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+ 	;;
+   restart|force-reload)
+ 	#
+ 	# If the "reload" option is implemented then remove the
+ 	# 'force-reload' alias
+ 	#
+-	log_daemon_msg "Restarting $DESC" "$NAME"
+ 	do_stop
+-	case "$?" in
+-	  0|1)
+-		do_start
+-		case "$?" in
+-			0) log_end_msg 0 ;;
+-			1) log_end_msg 1 ;; # Old process is still running
+-			*) log_end_msg 1 ;; # Failed to start
+-		esac
+-		;;
+-	  *)
+-		# Failed to stop
+-		log_end_msg 1
+-		;;
+-	esac
++	do_start
+ 	;;
+   *)
+-	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
++	echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
+ 	exit 3
+ 	;;
+ esac
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster.inc b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster.inc
new file mode 100644
index 0000000..a3beccc
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster.inc
@@ -0,0 +1,21 @@
+DESCRIPTION = "This project enables PWM on the GPIO pins you request of a Raspberry Pi."
+HOMEPAGE = "https://github.com/sarfata/pi-blaster/"
+SECTION = "devel/libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README.md;beginline=157;endline=170;md5=f20832f31126609af5a7bf2340014540"
+
+SRC_URI = "git://github.com/sarfata/pi-blaster \
+           file://remove-initscript-lsb-dependency.patch \
+"
+
+S = "${WORKDIR}/git"
+
+inherit update-rc.d autotools
+
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME_${PN} = "${PN}.boot.sh"
+INITSCRIPT_PARAMS_${PN} = "defaults 15 85"
+
+COMPATIBLE_MACHINE = "raspberrypi"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb
new file mode 100644
index 0000000..263852b
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb
@@ -0,0 +1,3 @@
+require pi-blaster.inc
+
+SRCREV = "ec5e1b4c6191d8f9a538497dbbb86f9cf0de7016"
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/python-rtimu/0001-include-asm-ioctl.h-for-ioctl-define.patch b/import-layers/meta-raspberrypi/recipes-devtools/python/python-rtimu/0001-include-asm-ioctl.h-for-ioctl-define.patch
new file mode 100644
index 0000000..4a93a1c
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/python/python-rtimu/0001-include-asm-ioctl.h-for-ioctl-define.patch
@@ -0,0 +1,33 @@
+From c3aa4af56652b403e304ea5f321acfe289e42922 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Jan 2016 16:07:14 -0800
+Subject: [PATCH] include asm/ioctl.h for ioctl() define
+
+also fixes errors e.g.
+
+../../RTIMULib/RTIMUHal.cpp:208:29: error: '_IOC_SIZEBITS' was not
+declared in this scope
+         return ioctl(m_SPI, SPI_IOC_MESSAGE(1), &wrIOC);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ RTIMULib/RTIMUHal.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/RTIMULib/RTIMUHal.cpp b/RTIMULib/RTIMUHal.cpp
+index f9c3d15..d968326 100644
+--- a/RTIMULib/RTIMUHal.cpp
++++ b/RTIMULib/RTIMUHal.cpp
+@@ -29,6 +29,7 @@
+ #if !defined(WIN32) && !defined(__APPLE__)
+ 
+ #include <linux/spi/spidev.h>
++#include <asm/ioctl.h>
+ 
+ RTIMUHal::RTIMUHal()
+ {
+-- 
+2.7.0
+
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/python-rtimu_git.bb b/import-layers/meta-raspberrypi/recipes-devtools/python/python-rtimu_git.bb
new file mode 100644
index 0000000..63c92b3
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/python/python-rtimu_git.bb
@@ -0,0 +1,15 @@
+DESCRIPTION = "RTIMULib is a C++ and Python library that makes it easy to use 9-dof and \
+10-dof IMUs with embedded Linux systems"
+HOMEPAGE = "https://github.com/RPi-Distro/RTIMULib/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://../../LICENSE;md5=96cdecb41125f498958e09b72faf318e"
+
+SRC_URI = "git://github.com/RPi-Distro/RTIMULib.git;protocol=http;branch=master \
+           file://0001-include-asm-ioctl.h-for-ioctl-define.patch;patchdir=../.. \
+          "
+SRCREV = "b949681af69b45f0f7f4bb53b6770037b5b02178"
+
+S = "${WORKDIR}/git/Linux/python/"
+
+inherit setuptools
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/python-sense-hat_2.1.0.bb b/import-layers/meta-raspberrypi/recipes-devtools/python/python-sense-hat_2.1.0.bb
new file mode 100644
index 0000000..e990a28
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/python/python-sense-hat_2.1.0.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Python module to control the Raspberry Pi Sense HAT used in the Astro Pi mission"
+HOMEPAGE = "https://github.com/RPi-Distro/python-sense-hat"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=d80fe312e1ff5fbd97369b093bf21cda"
+
+SRCNAME = "sense-hat"
+
+SRC_URI = "https://pypi.python.org/packages/source/s/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "71217f15ea963040f06e2f50722186ca"
+SRC_URI[sha256sum] = "c6c76707c0ea514e4b0f1f96f1b5b79755875891aae037df7434b6aad7b9dbca"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+DEPENDS += " \
+    jpeg \
+    zlib \
+    freetype \
+    "
+
+RDEPENDS_${PN} += " \
+    python-numpy \
+    python-rtimu \
+    python-imaging \
+    "
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch b/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch
new file mode 100644
index 0000000..bd97179
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch
@@ -0,0 +1,294 @@
+From 23d7ab77865f8b17042f5cd4c6720cca475e0eb5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 14:27:10 -0800
+Subject: [PATCH] Remove nested functions
+
+nested functions are not supported on llvm/clang compiler, replacing
+them helps make code portable and be compilable with non-gcc compilers
+additionally fix the diagnostic messages clang reported
+
+source/c_gpio.c:130:18: warning: comparison of distinct pointer types
+('volatile uint32_t *' (aka 'volatile unsigned int *') an
+d 'void *') [-Wcompare-distinct-pointer-types]
+    if (gpio_map < MAP_FAILED)
+        ~~~~~~~~ ^ ~~~~~~~~~~
+
+        source/c_gpio.c:89:13: warning: variable 'peri_base' is used
+uninitialized whenever 'if' condition is false [-Wsometimes-uninit
+ialized]
+        if (fread(buf, 1, sizeof buf, fp) == sizeof buf) {
+            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+source/c_gpio.c:116:17: note: uninitialized use occurs here
+    gpio_base = peri_base + GPIO_BASE_OFFSET;
+                ^~~~~~~~~
+source/c_gpio.c:89:9: note: remove the 'if' if its condition is always
+true
+        if (fread(buf, 1, sizeof buf, fp) == sizeof buf) {
+        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+source/c_gpio.c:64:23: note: initialize the variable 'peri_base' to
+silence this warning
+    uint32_t peri_base;
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ source/c_gpio.c  |   6 +--
+ source/py_gpio.c | 135 ++++++++++++++++++++++++++++---------------------------
+ 2 files changed, 71 insertions(+), 70 deletions(-)
+
+diff --git a/source/c_gpio.c b/source/c_gpio.c
+index c96a2b0..b69880f 100644
+--- a/source/c_gpio.c
++++ b/source/c_gpio.c
+@@ -61,7 +61,7 @@ int setup(void)
+ {
+     int mem_fd;
+     uint8_t *gpio_mem;
+-    uint32_t peri_base;
++    uint32_t peri_base = 0;
+     uint32_t gpio_base;
+     unsigned char buf[4];
+     FILE *fp;
+@@ -73,7 +73,7 @@ int setup(void)
+     if ((mem_fd = open("/dev/gpiomem", O_RDWR|O_SYNC)) > 0)
+     {
+         gpio_map = (uint32_t *)mmap(NULL, BLOCK_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, 0);
+-        if ((uint32_t)gpio_map < 0) {
++        if (gpio_map == MAP_FAILED) {
+             return SETUP_MMAP_FAIL;
+         } else {
+             return SETUP_OK;
+@@ -127,7 +127,7 @@ int setup(void)
+ 
+     gpio_map = (uint32_t *)mmap( (void *)gpio_mem, BLOCK_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, mem_fd, gpio_base);
+ 
+-    if ((uint32_t)gpio_map < 0)
++    if (gpio_map == MAP_FAILED)
+         return SETUP_MMAP_FAIL;
+ 
+     return SETUP_OK;
+diff --git a/source/py_gpio.c b/source/py_gpio.c
+index d54cc7f..007bad5 100644
+--- a/source/py_gpio.c
++++ b/source/py_gpio.c
+@@ -69,6 +69,20 @@ static int mmap_gpio_mem(void)
+       return 0;
+    }
+ }
++static inline int cleanup_one(unsigned int gpio)
++{
++   // clean up any /sys/class exports
++   event_cleanup(gpio);
++
++   // set everything back to input
++   if (gpio_direction[gpio] != -1) {
++      setup_gpio(gpio, INPUT, PUD_OFF);
++      gpio_direction[gpio] = -1;
++      return 1;
++   }
++   return 0;
++}
++
+ 
+ // python function cleanup(channel=None)
+ static PyObject *py_cleanup(PyObject *self, PyObject *args, PyObject *kwargs)
+@@ -83,19 +97,6 @@ static PyObject *py_cleanup(PyObject *self, PyObject *args, PyObject *kwargs)
+    PyObject *tempobj;
+    static char *kwlist[] = {"channel", NULL};
+ 
+-   void cleanup_one(void)
+-   {
+-      // clean up any /sys/class exports
+-      event_cleanup(gpio);
+-
+-      // set everything back to input
+-      if (gpio_direction[gpio] != -1) {
+-         setup_gpio(gpio, INPUT, PUD_OFF);
+-         gpio_direction[gpio] = -1;
+-         found = 1;
+-      }
+-   }
+-
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", kwlist, &chanlist))
+       return NULL;
+ 
+@@ -140,7 +141,7 @@ static PyObject *py_cleanup(PyObject *self, PyObject *args, PyObject *kwargs)
+       } else if (channel != -666) {    // channel was an int indicating single channel
+          if (get_gpio_number(channel, &gpio))
+             return NULL;
+-         cleanup_one();
++         found = cleanup_one(gpio);
+       } else {  // channel was a list/tuple
+          for (i=0; i<chancount; i++) {
+             if (chanlist) {
+@@ -169,7 +170,7 @@ static PyObject *py_cleanup(PyObject *self, PyObject *args, PyObject *kwargs)
+ 
+             if (get_gpio_number(channel, &gpio))
+                return NULL;
+-            cleanup_one();
++            found = cleanup_one(gpio);
+          }
+       }
+    }
+@@ -182,6 +183,37 @@ static PyObject *py_cleanup(PyObject *self, PyObject *args, PyObject *kwargs)
+    Py_RETURN_NONE;
+ }
+ 
++static inline int setup_one(unsigned int *gpio, int channel, int pud, int direction, int initial) {
++   if (get_gpio_number(channel, gpio))
++      return 0;
++
++   int func = gpio_function(*gpio);
++   if (gpio_warnings &&                             // warnings enabled and
++       ((func != 0 && func != 1) ||                 // (already one of the alt functions or
++       (gpio_direction[*gpio] == -1 && func == 1)))  // already an output not set from this program)
++   {
++      PyErr_WarnEx(NULL, "This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.", 1);
++   }
++
++   // warn about pull/up down on i2c channels
++   if (gpio_warnings) {
++      if (rpiinfo.p1_revision == 0) { // compute module - do nothing
++      } else if ((rpiinfo.p1_revision == 1 && (*gpio == 0 || *gpio == 1)) ||
++                 (*gpio == 2 || *gpio == 3)) {
++         if (pud == PUD_UP || pud == PUD_DOWN)
++            PyErr_WarnEx(NULL, "A physical pull up resistor is fitted on this channel!", 1);
++      }
++   }
++
++   if (direction == OUTPUT && (initial == LOW || initial == HIGH)) {
++      output_gpio(*gpio, initial);
++   }
++   setup_gpio(*gpio, direction, pud);
++   gpio_direction[*gpio] = direction;
++   return 1;
++}
++
++
+ // python function setup(channel(s), direction, pull_up_down=PUD_OFF, initial=None)
+ static PyObject *py_setup_channel(PyObject *self, PyObject *args, PyObject *kwargs)
+ {
+@@ -195,37 +227,6 @@ static PyObject *py_setup_channel(PyObject *self, PyObject *args, PyObject *kwar
+    int pud = PUD_OFF + PY_PUD_CONST_OFFSET;
+    int initial = -1;
+    static char *kwlist[] = {"channel", "direction", "pull_up_down", "initial", NULL};
+-   int func;
+-
+-   int setup_one(void) {
+-      if (get_gpio_number(channel, &gpio))
+-         return 0;
+-
+-      func = gpio_function(gpio);
+-      if (gpio_warnings &&                             // warnings enabled and
+-          ((func != 0 && func != 1) ||                 // (already one of the alt functions or
+-          (gpio_direction[gpio] == -1 && func == 1)))  // already an output not set from this program)
+-      {
+-         PyErr_WarnEx(NULL, "This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.", 1);
+-      }
+-
+-      // warn about pull/up down on i2c channels
+-      if (gpio_warnings) {
+-         if (rpiinfo.p1_revision == 0) { // compute module - do nothing
+-         } else if ((rpiinfo.p1_revision == 1 && (gpio == 0 || gpio == 1)) ||
+-                    (gpio == 2 || gpio == 3)) {
+-            if (pud == PUD_UP || pud == PUD_DOWN)
+-               PyErr_WarnEx(NULL, "A physical pull up resistor is fitted on this channel!", 1);
+-         }
+-      }
+-
+-      if (direction == OUTPUT && (initial == LOW || initial == HIGH)) {
+-         output_gpio(gpio, initial);
+-      }
+-      setup_gpio(gpio, direction, pud);
+-      gpio_direction[gpio] = direction;
+-      return 1;
+-   }
+ 
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oi|ii", kwlist, &chanlist, &direction, &pud, &initial))
+       return NULL;
+@@ -290,7 +291,7 @@ static PyObject *py_setup_channel(PyObject *self, PyObject *args, PyObject *kwar
+    } else if (chantuple) {
+        chancount = PyTuple_Size(chantuple);
+    } else {
+-       if (!setup_one())
++       if (!setup_one(&gpio, channel, pud, direction, initial))
+           return NULL;
+        Py_RETURN_NONE;
+    }
+@@ -320,12 +321,29 @@ static PyObject *py_setup_channel(PyObject *self, PyObject *args, PyObject *kwar
+           return NULL;
+       }
+ 
+-      if (!setup_one())
++      if (!setup_one(&gpio, channel, pud, direction, initial))
+          return NULL;
+    }
+ 
+    Py_RETURN_NONE;
+ }
++static inline int output_val(unsigned int *gpio, int channel, int value) {
++   if (get_gpio_number(channel, gpio))
++       return 0;
++
++   if (gpio_direction[*gpio] != OUTPUT)
++   {
++      PyErr_SetString(PyExc_RuntimeError, "The GPIO channel has not been set up as an OUTPUT");
++      return 0;
++   }
++
++   if (check_gpio_priv())
++      return 0;
++
++   output_gpio(*gpio, value);
++   return 1;
++}
++
+ 
+ // python function output(channel(s), value(s))
+ static PyObject *py_output_gpio(PyObject *self, PyObject *args)
+@@ -342,23 +360,6 @@ static PyObject *py_output_gpio(PyObject *self, PyObject *args)
+    int chancount = -1;
+    int valuecount = -1;
+ 
+-   int output(void) {
+-      if (get_gpio_number(channel, &gpio))
+-          return 0;
+-
+-      if (gpio_direction[gpio] != OUTPUT)
+-      {
+-         PyErr_SetString(PyExc_RuntimeError, "The GPIO channel has not been set up as an OUTPUT");
+-         return 0;
+-      }
+-
+-      if (check_gpio_priv())
+-         return 0;
+-
+-      output_gpio(gpio, value);
+-      return 1;
+-   }
+-
+    if (!PyArg_ParseTuple(args, "OO", &chanlist, &valuelist))
+        return NULL;
+ 
+@@ -416,7 +417,7 @@ static PyObject *py_output_gpio(PyObject *self, PyObject *args)
+    }
+ 
+    if (chancount == -1) {
+-      if (!output())
++      if (!output_val(&gpio, channel, value))
+          return NULL;
+       Py_RETURN_NONE;
+    }
+@@ -472,7 +473,7 @@ static PyObject *py_output_gpio(PyObject *self, PyObject *args)
+               return NULL;
+           }
+       }
+-      if (!output())
++      if (!output_val(&gpio, channel, value))
+          return NULL;
+    }
+ 
+-- 
+2.7.0
+
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.1.bb b/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.1.bb
new file mode 100644
index 0000000..89f601b
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.1.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "A module to control Raspberry Pi GPIO channels"
+HOMEPAGE = "http://code.google.com/p/raspberry-gpio-python/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=9b95630a648966b142f1a0dcea001cb7"
+
+SRCNAME = "RPi.GPIO"
+
+SRC_URI = "\
+          http://pypi.python.org/packages/source/R/RPi.GPIO/${SRCNAME}-${PV}.tar.gz \
+          file://0001-Remove-nested-functions.patch \
+          "
+SRC_URI[md5sum] = "254d0443a436eb241367c487274e7197"
+SRC_URI[sha256sum] = "54e5fb06d9ea1a1389a497fb5a06dfa950c86303b0f4ba89b68c55999d1df064"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+COMPATIBLE_MACHINE = "raspberrypi"
+
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/rpio/0001-include-sys-types.h-explicitly-for-getting-caddr_t-d.patch b/import-layers/meta-raspberrypi/recipes-devtools/python/rpio/0001-include-sys-types.h-explicitly-for-getting-caddr_t-d.patch
new file mode 100644
index 0000000..bed9749
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/python/rpio/0001-include-sys-types.h-explicitly-for-getting-caddr_t-d.patch
@@ -0,0 +1,30 @@
+From c86bfacc98d58244f532626954ed00d84ecfa82d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Jan 2016 17:12:37 -0800
+Subject: [PATCH] include sys/types.h explicitly for getting caddr_t definition
+
+Helps fixing build on musl where sys/types.h is not included indirectly
+as happening on glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ source/c_gpio/c_gpio.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/source/c_gpio/c_gpio.c b/source/c_gpio/c_gpio.c
+index 25a04ca..70df632 100644
+--- a/source/c_gpio/c_gpio.c
++++ b/source/c_gpio/c_gpio.c
+@@ -29,6 +29,7 @@
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
++#include <sys/types.h>
+ #include <sys/mman.h>
+ #include "c_gpio.h"
+ 
+-- 
+2.7.0
+
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb b/import-layers/meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb
new file mode 100644
index 0000000..69ecb6f
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "Advanced GPIO for the Raspberry Pi. Extends RPi.GPIO with PWM, \
+GPIO interrups, TCP socket interrupts, command line tools and more"
+HOMEPAGE = "https://github.com/metachris/RPIO"
+SECTION = "devel/python"
+LICENSE = "LGPLv3+"
+LIC_FILES_CHKSUM = "file://README.rst;beginline=41;endline=53;md5=d5d95d7486a4d98c999675c23196b25a"
+
+SRCNAME = "RPIO"
+
+SRC_URI = "http://pypi.python.org/packages/source/R/RPIO/${SRCNAME}-${PV}.tar.gz \
+           file://0001-include-sys-types.h-explicitly-for-getting-caddr_t-d.patch \
+           "
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+COMPATIBLE_MACHINE = "raspberrypi"
+
+SRC_URI[md5sum] = "cefc45422833dcafcd59b78dffc540f4"
+SRC_URI[sha256sum] = "b89f75dec9de354681209ebfaedfe22b7c178aacd91a604a7bd6d92024e4cf7e"
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch
new file mode 100644
index 0000000..ed47fab
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch
@@ -0,0 +1,410 @@
+From 6d85e6cc3ab97c3f060e5e0a8e3f1945a14c86ba Mon Sep 17 00:00:00 2001
+From: Gianfranco Costamagna <gianfranco.costamagna@abinsula.com>
+Date: Mon, 12 Oct 2015 12:15:51 +0200
+Subject: [PATCH] Add initial cross compile support (rebase from Petter Mabäcker <petter@technux.se> version)
+
+---
+ devLib/Makefile             |   54 ++++++++++++++++++++++++-------------------
+ examples/Gertboard/Makefile |   22 +++++++++++-------
+ examples/Makefile           |   22 +++++++++++-------
+ examples/PiFace/Makefile    |   22 +++++++++++-------
+ examples/PiGlow/Makefile    |    4 ++--
+ examples/q2w/Makefile       |    4 ++--
+ gpio/Makefile               |   29 ++++++++++++-----------
+ wiringPi/Makefile           |   50 +++++++++++++++++++++------------------
+ 8 files changed, 119 insertions(+), 88 deletions(-)
+
+diff --git a/devLib/Makefile b/devLib/Makefile
+index 0fb0033..cbea759 100644
+--- a/devLib/Makefile
++++ b/devLib/Makefile
+@@ -31,15 +31,19 @@ ifneq ($V,1)
+ Q ?= @
+ endif
+ 
+-STATIC=libwiringPiDev.a
+-DYNAMIC=libwiringPiDev.so.$(VERSION)
++INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include
++LIB_DIR?=$(DESTDIR)$(PREFIX)/lib
+ 
+-#DEBUG	= -g -O0
+-DEBUG	= -O2
+-CC	= gcc
+-INCLUDE	= -I.
+-DEFS	= -D_GNU_SOURCE
+-CFLAGS	= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
++BASE_NAME=libwiringPiDev
++STATIC=$(BASE_NAME).a
++DYNAMIC=$(BASE_NAME).so.$(VERSION)
++
++#DEBUG ?= -g -O0
++DEBUG	?= -O2
++CC	?= gcc
++INCLUDE	?= -I.
++DEFS	?= -D_GNU_SOURCE
++CFLAGS	?= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
+ 
+ LIBS    =
+ 
+@@ -66,16 +70,16 @@ $(STATIC):	$(OBJ)
+ 
+ $(DYNAMIC):	$(OBJ)
+ 	$Q echo "[Link (Dynamic)]"
+-	$Q $(CC) -shared -Wl,-soname,libwiringPiDev.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
++	$Q $(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ)
+ 
+ .c.o:
+ 	$Q echo [Compile] $<
+-	$Q $(CC) -c $(CFLAGS) $< -o $@
++	$Q $(CC) -c $(CFLAGS) -fPIC $< -o $@
+ 
+ .PHONY:	clean
+ clean:
+ 	$Q echo "[Clean]"
+-	$Q rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
++	$Q rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak $(BASE_NAME).so* $(BASE_NAME).a
+ 
+ .PHONY:	tags
+ tags:	$(SRC)
+@@ -86,22 +90,22 @@ tags:	$(SRC)
+ .PHONY:	install
+ install:	$(DYNAMIC)
+ 	$Q echo "[Install Headers]"
+-	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/include
+-	$Q install -m 0644 $(HEADERS)					$(DESTDIR)$(PREFIX)/include
++	$Q install -m 0755 -d						$(INCLUDE_DIR)
++	$Q install -m 0644 $(HEADERS)					$(INCLUDE_DIR)
+ 	$Q echo "[Install Dynamic Lib]"
+-	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/lib
+-	$Q install -m 0755 libwiringPiDev.so.$(VERSION)			$(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
+-	$Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)	$(DESTDIR)/lib/libwiringPiDev.so
+-	$Q $(LDCONFIG)
++	$Q install -m 0755 -d						$(LIB_DIR)
++	$Q install -m 0755 $(BASE_NAME).so				$(LIB_DIR)/$(DYNAMIC)
++	$Q ln -sf $(DYNAMIC)						$(LIB_DIR)/$(BASE_NAME).so
++	$Q ln -sf $(DYNAMIC)						$(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ)
+ 
+ .PHONY:	install-static
+ install-static:	$(STATIC)
+ 	$Q echo "[Install Headers]"
+-	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/include
+-	$Q install -m 0644 $(HEADERS)					$(DESTDIR)$(PREFIX)/include
++	$Q install -m 0755 -d						$(INCLUDE_DIR)
++	$Q install -m 0644 $(HEADERS)					$(INCLUDE_DIR)
+ 	$Q echo "[Install Static Lib]"
+-	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/lib
+-	$Q install -m 0755 libwiringPiDev.a				$(DESTDIR)$(PREFIX)/lib
++	$Q install -m 0755 -d						$(LIB_DIR)
++	$Q install -m 0755 $(STATIC)					$(LIB_DIR)
+ 
+ .PHONY:	install-deb
+ install-deb:	$(DYNAMIC)
+@@ -116,9 +120,11 @@ install-deb:	$(DYNAMIC)
+ .PHONY:	uninstall
+ uninstall:
+ 	$Q echo "[UnInstall]"
+-	$Q cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
+-	$Q cd $(DESTDIR)$(PREFIX)/lib/     && rm -f libwiringPiDev.*
+-	$Q $(LDCONFIG)
++	$Q cd $(INCLUDE_DIR) && rm -f $(HEADERS)
++	$Q rm -f $(LIB_DIR)/$(STATIC)
++	$Q rm -f $(LIB_DIR)/$(DYNAMIC)
++	$Q rm -f $(LIB_DIR)/$(BASE_NAME).so
++	$Q rm -f $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ)
+ 
+ 
+ .PHONY:	depend
+diff --git a/examples/Gertboard/Makefile b/examples/Gertboard/Makefile
+index 1939ad6..98d1415 100644
+--- a/examples/Gertboard/Makefile
++++ b/examples/Gertboard/Makefile
+@@ -9,14 +9,20 @@ ifneq ($V,1)
+ Q ?= @
+ endif
+ 
+-#DEBUG	= -g -O0
+-DEBUG	= -O3
+-CC	= gcc
+-INCLUDE	= -I/usr/local/include
+-CFLAGS	= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
+-
+-LDFLAGS	= -L/usr/local/lib
+-LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
++DESTDIR?=/usr
++PREFIX?=/local
++
++INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include
++LIB_DIR?=$(DESTDIR)$(PREFIX)/lib
++
++#DEBUG	?= -g -O0
++DEBUG	?= -O3
++CC	?= gcc
++INCLUDE	?= -I$(INCLUDE_DIR)
++CFLAGS	?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
++
++LDFLAGS	?= -L$(LIB_DIR)
++LDLIBS    ?= -lwiringPi -lwiringPiDev -lpthread -lm
+ 
+ # Should not alter anything below this line
+ ###############################################################################
+diff --git a/examples/Makefile b/examples/Makefile
+index e6b9b71..931b167 100644
+--- a/examples/Makefile
++++ b/examples/Makefile
+@@ -26,14 +26,20 @@ ifneq ($V,1)
+ Q ?= @
+ endif
+ 
+-#DEBUG	= -g -O0
+-DEBUG	= -O3
+-CC	= gcc
+-INCLUDE	= -I/usr/local/include
+-CFLAGS	= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
+-
+-LDFLAGS	= -L/usr/local/lib
+-LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
++DESTDIR?=/usr
++PREFIX?=/local
++
++INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include
++LIB_DIR?=$(DESTDIR)$(PREFIX)/lib
++
++#DEBUG	?= -g -O0
++DEBUG	?= -O3
++CC	?= gcc
++INCLUDE	?= -I$(INCLUDE_DIR)
++CFLAGS	?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
++
++LDFLAGS	?= -L$(LIB_DIR)
++LDLIBS    ?= -lwiringPi -lwiringPiDev -lpthread -lm
+ 
+ # Should not alter anything below this line
+ ###############################################################################
+diff --git a/examples/PiFace/Makefile b/examples/PiFace/Makefile
+index 4685adc..cfaf902 100644
+--- a/examples/PiFace/Makefile
++++ b/examples/PiFace/Makefile
+@@ -26,14 +26,20 @@ ifneq ($V,1)
+ Q ?= @
+ endif
+ 
+-#DEBUG	= -g -O0
+-DEBUG	= -O3
+-CC	= gcc
+-INCLUDE	= -I/usr/local/include
+-CFLAGS	= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
+-
+-LDFLAGS	= -L/usr/local/lib
+-LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
++DESTDIR?=/usr
++PREFIX?=/local
++
++INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include
++LIB_DIR?=$(DESTDIR)$(PREFIX)/lib
++
++#DEBUG	?= -g -O0
++DEBUG	?= -O3
++CC	?= gcc
++INCLUDE	?= -I$(INCLUDE_DIR)
++CFLAGS	?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
++
++LDFLAGS	?= -L$(LIB_DIR)
++LDLIBS    ?= -lwiringPi -lwiringPiDev -lpthread -lm
+ 
+ # Should not alter anything below this line
+ ###############################################################################
+diff --git a/examples/PiGlow/Makefile b/examples/PiGlow/Makefile
+index acd4818..dabd64e 100644
+--- a/examples/PiGlow/Makefile
++++ b/examples/PiGlow/Makefile
+@@ -29,10 +29,10 @@ endif
+ #DEBUG	= -g -O0
+ DEBUG	= -O3
+ CC	= gcc
+-INCLUDE	= -I/usr/local/include
++INCLUDE	= -I../wiringPi -I../wiringPiDev
+ CFLAGS	= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
+ 
+-LDFLAGS	= -L/usr/local/lib
++LDFLAGS	= -L../wiringPi -L../wiringPiDev
+ LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
+ 
+ # Should not alter anything below this line
+diff --git a/examples/q2w/Makefile b/examples/q2w/Makefile
+index 6f50fa0..c5e9f6e 100644
+--- a/examples/q2w/Makefile
++++ b/examples/q2w/Makefile
+@@ -29,10 +29,10 @@ endif
+ #DEBUG	= -g -O0
+ DEBUG	= -O3
+ CC	= gcc
+-INCLUDE	= -I/usr/local/include
++INCLUDE	= -I../wiringPi -I../devLib
+ CFLAGS	= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
+ 
+-LDFLAGS	= -L/usr/local/lib
++LDFLAGS	= -L../wiringPi -L../devLib
+ LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
+ 
+ ###############################################################################
+diff --git a/gpio/Makefile b/gpio/Makefile
+index 7dcd090..83ec454 100644
+--- a/gpio/Makefile
++++ b/gpio/Makefile
+@@ -30,13 +30,17 @@ ifneq ($V,1)
+ Q ?= @
+ endif
+ 
+-#DEBUG	= -g -O0
+-DEBUG	= -O2
+-CC	= gcc
+-INCLUDE	= -I$(DESTDIR)$(PREFIX)/include
+-CFLAGS	= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
++INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include
++LIB_DIR?=$(DESTDIR)$(PREFIX)/lib
++BIN_DIR?=$(DESTDIR)$(PREFIX)/bin
+ 
+-LDFLAGS	= -L$(DESTDIR)$(PREFIX)/lib
++#DEBUG	?= -g -O0
++DEBUG	?= -O2
++CC	?= gcc
++INCLUDE	?= -I$(INCLUDE_DIR)
++CFLAGS	?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
++
++LDFLAGS	?= -L$(LIB_DIR)
+ LIBS    = -lwiringPi -lwiringPiDev -lpthread
+ 
+ # May not need to  alter anything below this line
+@@ -72,13 +76,10 @@ tags:	$(SRC)
+ .PHONY:	install
+ install: gpio
+ 	$Q echo "[Install]"
+-	$Q cp gpio		$(DESTDIR)$(PREFIX)/bin
+-ifneq ($(WIRINGPI_SUID),0)
+-	$Q chown root.root	$(DESTDIR)$(PREFIX)/bin/gpio
+-	$Q chmod 4755		$(DESTDIR)$(PREFIX)/bin/gpio
+-endif
+-	$Q mkdir -p		$(DESTDIR)$(PREFIX)/man/man1
+-	$Q cp gpio.1		$(DESTDIR)$(PREFIX)/man/man1
++	$Q install -d $(BIN_DIR)
++	$Q install -m 4755 -o root -g root gpio $(BIN_DIR)
++	$Q install -d $(DESTDIR)$(PREFIX)/share/man/man1
++	$Q install -m 644 -o root -g root gpio.1 $(DESTDIR)$(PREFIX)/share/man/man1
+ 
+ .PHONY:	install-deb
+ install-deb:	gpio
+@@ -89,7 +90,7 @@ install-deb:	gpio
+ .PHONY:	uninstall
+ uninstall:
+ 	$Q echo "[UnInstall]"
+-	$Q rm -f $(DESTDIR)$(PREFIX)/bin/gpio
++	$Q rm -f $(BIN_DIR)/gpio
+ 	$Q rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1
+ 
+ .PHONY:	depend
+diff --git a/wiringPi/Makefile b/wiringPi/Makefile
+index 6bbcc5d..5355b74 100644
+--- a/wiringPi/Makefile
++++ b/wiringPi/Makefile
+@@ -25,19 +25,23 @@ VERSION=$(shell cat ../VERSION)
+ DESTDIR?=/usr
+ PREFIX?=/local
+ 
++INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include
++LIB_DIR?=$(DESTDIR)$(PREFIX)/lib
++
+ LDCONFIG?=ldconfig
+ 
+ ifneq ($V,1)
+ Q ?= @
+ endif
+ 
+-STATIC=libwiringPi.a
+-DYNAMIC=libwiringPi.so.$(VERSION)
++BASE_NAME=libwiringPi
++STATIC=$(BASE_NAME).a
++DYNAMIC=$(BASE_NAME).so.$(VERSION)
+ 
+-#DEBUG	= -g -O0
+-DEBUG	= -O2
+-CC	= gcc
+-INCLUDE	= -I.
++#DEBUG	?= -g -O0
++DEBUG	?= -O2
++CC	?= gcc
++INCLUDE	?= -I.
+ DEFS	= -D_GNU_SOURCE
+ CFLAGS	= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
+ 
+@@ -89,17 +93,17 @@ $(STATIC):	$(OBJ)
+ 
+ $(DYNAMIC):	$(OBJ)
+ 	$Q echo "[Link (Dynamic)]"
+-	$Q $(CC) -shared -Wl,-soname,libwiringPi.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPi.so.$(VERSION) -lpthread $(OBJ)
++	$Q $(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ)
+ 
+ .c.o:
+ 	$Q echo [Compile] $<
+-	$Q $(CC) -c $(CFLAGS) $< -o $@
++	$Q $(CC) -c $(CFLAGS) -fPIC $< -o $@
+ 
+ 
+ .PHONY:	clean
+ clean:
+ 	$Q echo "[Clean]"
+-	$Q rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPi.*
++	$Q rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak $(BASE_NAME).so* $(BASE_NAME).a
+ 
+ .PHONY:	tags
+ tags:	$(SRC)
+@@ -110,22 +114,22 @@ tags:	$(SRC)
+ .PHONY:	install
+ install:	$(DYNAMIC)
+ 	$Q echo "[Install Headers]"
+-	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/include
+-	$Q install -m 0644 $(HEADERS)					$(DESTDIR)$(PREFIX)/include
++	$Q install -m 0755 -d						$(INCLUDE_DIR)
++	$Q install -m 0644 $(HEADERS)					$(INCLUDE_DIR)
+ 	$Q echo "[Install Dynamic Lib]"
+-	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/lib
+-	$Q install -m 0755 libwiringPi.so.$(VERSION)			$(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)
+-	$Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)	$(DESTDIR)/lib/libwiringPi.so
+-	$Q $(LDCONFIG)
++	$Q install -m 0755 -d						$(LIB_DIR)
++	$Q install -m 0755 $(BASE_NAME).so				$(LIB_DIR)/$(DYNAMIC)
++	$Q ln -sf $(DYNAMIC)						$(LIB_DIR)/$(BASE_NAME).so
++	$Q ln -sf $(DYNAMIC)						$(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ)
+ 
+ .PHONY:	install-static
+ install-static:	$(STATIC)
+ 	$Q echo "[Install Headers]"
+-	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/include
+-	$Q install -m 0644 $(HEADERS)					$(DESTDIR)$(PREFIX)/include
++	$Q install -m 0755 -d						$(INCLUDE_DIR)
++	$Q install -m 0644 $(HEADERS)					$(INCLUDE_DIR)
+ 	$Q echo "[Install Static Lib]"
+-	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/lib
+-	$Q install -m 0755 libwiringPi.a					$(DESTDIR)$(PREFIX)/lib
++	$Q install -m 0755 -d						$(LIB_DIR)
++	$Q install -m 0755 $(STATIC)					$(LIB_DIR)
+ 
+ .PHONY:	install-deb
+ install-deb:	$(DYNAMIC)
+@@ -140,9 +144,11 @@ install-deb:	$(DYNAMIC)
+ .PHONY:	uninstall
+ uninstall:
+ 	$Q echo "[UnInstall]"
+-	$Q cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
+-	$Q cd $(DESTDIR)$(PREFIX)/lib/     && rm -f libwiringPi.*
+-	$Q $(LDCONFIG)
++	$Q cd $(INCLUDE_DIR) && rm -f $(HEADERS)
++	$Q rm -f $(LIB_DIR)/$(STATIC)
++	$Q rm -f $(LIB_DIR)/$(DYNAMIC)
++	$Q rm -f $(LIB_DIR)/$(BASE_NAME).so
++	$Q rm -f $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ)
+ 
+ 
+ .PHONY:	depend
+-- 
+2.1.4
+
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi/0001-include-asm-ioctl.h-directly-for-_IOC_SIZEBITS.patch b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi/0001-include-asm-ioctl.h-directly-for-_IOC_SIZEBITS.patch
new file mode 100644
index 0000000..5de5853
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi/0001-include-asm-ioctl.h-directly-for-_IOC_SIZEBITS.patch
@@ -0,0 +1,58 @@
+From 7f65eb37a82a6d9b095d9c8f262ad9dd205acd03 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Jan 2016 16:57:38 -0800
+Subject: [PATCH] include <asm/ioctl.h> directly for _IOC_SIZEBITS
+
+Fixes errors like
+| wiringPiSPI.c: In function 'wiringPiSPIDataRW':
+| wiringPiSPI.c:89:35: error: '_IOC_SIZEBITS' undeclared (first use in
+this function)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ wiringPi/wiringPi.c    | 1 +
+ wiringPi/wiringPiI2C.c | 1 +
+ wiringPi/wiringPiSPI.c | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c
+index 32e5100..cb5db9d 100644
+--- a/wiringPi/wiringPi.c
++++ b/wiringPi/wiringPi.c
+@@ -64,6 +64,7 @@
+ #include <time.h>
+ #include <fcntl.h>
+ #include <pthread.h>
++#include <asm/ioctl.h>
+ #include <sys/time.h>
+ #include <sys/mman.h>
+ #include <sys/stat.h>
+diff --git a/wiringPi/wiringPiI2C.c b/wiringPi/wiringPiI2C.c
+index c787bce..efdf53c 100644
+--- a/wiringPi/wiringPiI2C.c
++++ b/wiringPi/wiringPiI2C.c
+@@ -52,6 +52,7 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
++#include <asm/ioctl.h>
+ 
+ #include "wiringPi.h"
+ #include "wiringPiI2C.h"
+diff --git a/wiringPi/wiringPiSPI.c b/wiringPi/wiringPiSPI.c
+index 453df31..ae3c7d9 100644
+--- a/wiringPi/wiringPiSPI.c
++++ b/wiringPi/wiringPiSPI.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <string.h>
++#include <asm/ioctl.h>
+ #include <sys/ioctl.h>
+ #include <linux/spi/spidev.h>
+ 
+-- 
+2.7.0
+
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb
new file mode 100644
index 0000000..9d2206b
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb
@@ -0,0 +1,34 @@
+DESCRIPTION = "A library to control Raspberry Pi GPIO channels"
+HOMEPAGE = "https://projects.drogon.net/raspberry-pi/wiringpi/"
+SECTION = "devel/libs"
+LICENSE = "LGPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+# tag 2.29
+SRCREV = "d79506694d7ba1c3da865d095238289d6175057d"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.drogon.net/wiringPi \
+           file://0001-Add-initial-cross-compile-support.patch \
+           file://0001-include-asm-ioctl.h-directly-for-_IOC_SIZEBITS.patch \
+           "
+
+COMPATIBLE_MACHINE = "raspberrypi"
+
+CFLAGS_prepend = "-I${S}/wiringPi -I${S}/devLib"
+
+EXTRA_OEMAKE += "'INCLUDE_DIR=${D}${includedir}' 'LIB_DIR=${D}${libdir}'"
+EXTRA_OEMAKE += "'DESTDIR=${D}/usr' 'PREFIX=""'"
+
+do_compile() {
+    oe_runmake -C devLib
+    oe_runmake -C wiringPi
+    oe_runmake -C gpio 'LDFLAGS=${LDFLAGS} -L${S}/wiringPi -L${S}/devLib'
+}
+
+do_install() {
+    oe_runmake -C devLib install
+    oe_runmake -C wiringPi install
+    oe_runmake -C gpio install
+}