tkurbad-overlay/dev-libs/pigpio/pigpio-9999.ebuild

68 lines
1.5 KiB
Bash
Raw Normal View History

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
PYTHON_COMPAT=( python2_7 python3_3 python3_4 python3_5 )
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
2017-05-19 09:53:18 +02:00
epatch "${FILESDIR}"/${PN}-44-format-security.patch \
"${FILESDIR}"/${P}-Makefile.patch \
"${FILESDIR}"/${PN}-44-MakeRemote.patch
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
}