2017-05-19 09:53:18 +02:00
|
|
|
# Copyright 1999-2016 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# $Id$
|
|
|
|
|
2017-10-12 20:29:16 +02:00
|
|
|
EAPI=6
|
2017-05-19 09:53:18 +02:00
|
|
|
|
2018-09-19 13:16:37 +02:00
|
|
|
PYTHON_COMPAT=( python2_7 python3_{3,4,5,6} )
|
2017-05-19 09:53:18 +02:00
|
|
|
DISTUTILS_OPTIONAL=1
|
|
|
|
inherit eutils git-r3 toolchain-funcs distutils-r1
|
|
|
|
|
|
|
|
DESCRIPTION="C library for the Raspberry allowing control of general purpose input outputs"
|
|
|
|
HOMEPAGE="http://abyz.co.uk/rpi/pigpio"
|
|
|
|
EGIT_REPO_URI="https://github.com/joan2937/${PN}"
|
|
|
|
|
|
|
|
LICENSE="public-domain"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS=""
|
|
|
|
IUSE="examples python remote"
|
|
|
|
|
|
|
|
RDEPEND="python? ( ${PYTHON_DEPS} )"
|
|
|
|
DEPEND="${RDEPEND}"
|
|
|
|
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
|
|
|
|
|
|
|
src_prepare() {
|
2017-10-12 20:29:16 +02:00
|
|
|
default
|
2018-06-05 15:49:36 +02:00
|
|
|
epatch \
|
2017-05-19 09:53:18 +02:00
|
|
|
"${FILESDIR}"/${P}-Makefile.patch \
|
|
|
|
"${FILESDIR}"/${PN}-44-MakeRemote.patch
|
2018-06-05 15:49:36 +02:00
|
|
|
# "${FILESDIR}"/${PN}-44-format-security.patch \
|
2017-05-19 09:53:18 +02:00
|
|
|
|
|
|
|
tc-export CC AR RANLIB
|
|
|
|
export SIZE="$(tc-getAR)"
|
|
|
|
export SIZE="${SIZE/-ar/-size}"
|
|
|
|
export SHLIB="$(tc-getCC) -shared"
|
|
|
|
export STRIPLIB="true"
|
|
|
|
|
|
|
|
use python && distutils-r1_src_prepare
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
use python && distutils-r1_src_configure
|
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
if use remote ; then
|
|
|
|
emake -f MakeRemote libpigpiod_if.so
|
|
|
|
emake -f MakeRemote libpigpiod_if2.so
|
|
|
|
emake -f MakeRemote
|
|
|
|
else
|
|
|
|
emake
|
|
|
|
fi
|
|
|
|
|
|
|
|
use python && distutils-r1_src_compile
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
if use remote ; then
|
2017-10-12 20:29:16 +02:00
|
|
|
emake -f MakeRemote install prefix="${EROOT}"usr libdir="$(get_libdir)" DESTDIR="${D}"
|
2017-05-19 09:53:18 +02:00
|
|
|
else
|
2017-10-12 20:29:16 +02:00
|
|
|
emake install prefix="${EROOT}"usr libdir="$(get_libdir)" DESTDIR="${D}"
|
2017-05-19 09:53:18 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
use python && distutils-r1_src_install
|
|
|
|
|
|
|
|
if use examples ; then
|
|
|
|
dodoc -r EXAMPLES
|
|
|
|
fi
|
|
|
|
}
|