dev-embedded/libftdi: python-single-r1, EAPI=6
authorMichał Górny <mgorny@gentoo.org>
Sat, 18 Feb 2017 10:31:38 +0000 (11:31 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sat, 18 Feb 2017 10:32:51 +0000 (11:32 +0100)
dev-embedded/libftdi/libftdi-0.20-r1.ebuild [moved from dev-embedded/libftdi/libftdi-0.20.ebuild with 61% similarity]
dev-embedded/libftdi/libftdi-1.2-r1.ebuild [new file with mode: 0644]
dev-embedded/libftdi/libftdi-9999.ebuild

similarity index 61%
rename from dev-embedded/libftdi/libftdi-0.20.ebuild
rename to dev-embedded/libftdi/libftdi-0.20-r1.ebuild
index 0abb3b32f37845ce911f15d9dbd9232803fef4c8..26f83972b5defc0c895a6ed4d2ef9211b6e367cf 100644 (file)
@@ -1,10 +1,11 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI="2"
+EAPI=6
 
-inherit cmake-utils python eutils
+PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 )
+inherit cmake-utils python-single-r1
 
 if [[ ${PV} == 9999* ]] ; then
        EGIT_REPO_URI="git://developer.intra2net.com/${PN}"
@@ -23,28 +24,37 @@ IUSE="cxx doc examples python"
 
 RDEPEND="virtual/libusb:0
        cxx? ( dev-libs/boost )
-       python? ( dev-lang/python )"
+       python? ( ${PYTHON_DEPS} )"
 DEPEND="${RDEPEND}
        python? ( dev-lang/swig )
        doc? ( app-doc/doxygen )"
 
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_setup() {
+       use python && python-single-r1_pkg_setup
+}
+
 src_prepare() {
-       sed -i \
-               -e "s:[$]{PYTHON_LIB_INSTALL}/../site-packages:$(python_get_sitedir):" \
-               bindings/CMakeLists.txt || die
+       if use python; then
+               sed -i \
+                       -e "s:[$]{PYTHON_LIB_INSTALL}/../site-packages:$(python_get_sitedir):" \
+                       bindings/CMakeLists.txt || die
+       fi
        sed -i \
                -e '/SET(LIB_SUFFIX /d' \
                CMakeLists.txt || die
 
-       epatch "${FILESDIR}"/${P}-cmake-{include,version}.patch
+       eapply "${FILESDIR}"/${P}-cmake-{include,version}.patch
+       eapply_user
 }
 
 src_configure() {
        mycmakeargs=(
-               $(cmake-utils_use cxx FTDIPP)
-               $(cmake-utils_use doc DOCUMENTATION)
-               $(cmake-utils_use examples EXAMPLES)
-               $(cmake-utils_use python PYTHON_BINDINGS)
+               -DFTDIPP=$(usex cxx)
+               -DDOCUMENTATION=$(usex doc)
+               -DEXAMPLES=$(usex examples)
+               -DPYTHON_BINDINGS=$(usex python)
                -DCMAKE_SKIP_BUILD_RPATH=ON
        )
        cmake-utils_src_configure
@@ -52,6 +62,7 @@ src_configure() {
 
 src_install() {
        cmake-utils_src_install
+       use python && python_optimize
        dodoc ChangeLog README
 
        if use doc ; then
@@ -59,7 +70,7 @@ src_install() {
                rm -vf "${CMAKE_BUILD_DIR}"/doc/man/man3/{_,usb_,deprecated}*
 
                doman "${CMAKE_BUILD_DIR}"/doc/man/man3/*
-               dohtml "${CMAKE_BUILD_DIR}"/doc/html/*
+               dodoc -r "${CMAKE_BUILD_DIR}"/doc/html
        fi
        if use examples ; then
                docinto examples
diff --git a/dev-embedded/libftdi/libftdi-1.2-r1.ebuild b/dev-embedded/libftdi/libftdi-1.2-r1.ebuild
new file mode 100644 (file)
index 0000000..24fdd6e
--- /dev/null
@@ -0,0 +1,75 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 )
+inherit cmake-utils python-single-r1
+
+MY_P="${PN}1-${PV}"
+if [[ ${PV} == 9999* ]] ; then
+       EGIT_REPO_URI="git://developer.intra2net.com/${PN}"
+       inherit git-2
+else
+       SRC_URI="http://www.intra2net.com/en/developer/${PN}/download/${MY_P}.tar.bz2"
+       KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+DESCRIPTION="Userspace access to FTDI USB interface chips"
+HOMEPAGE="http://www.intra2net.com/en/developer/libftdi/"
+
+LICENSE="LGPL-2"
+SLOT="1"
+IUSE="cxx doc examples python static-libs test tools"
+
+RDEPEND="virtual/libusb:1
+       cxx? ( dev-libs/boost )
+       python? ( ${PYTHON_DEPS} )
+       tools? (
+               !<dev-embedded/ftdi_eeprom-1.0
+               dev-libs/confuse
+       )"
+DEPEND="${RDEPEND}
+       python? ( dev-lang/swig )
+       doc? ( app-doc/doxygen )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_setup() {
+       use python && python-single-r1_pkg_setup
+}
+
+S=${WORKDIR}/${MY_P}
+
+src_configure() {
+       mycmakeargs=(
+               -DFTDIPP=$(usex cxx)
+               -DDOCUMENTATION=$(usex doc)
+               -DEXAMPLES=$(usex examples)
+               -DPYTHON_BINDINGS=$(usex python)
+               -DSTATICLIBS=$(usex static-libs)
+               -DBUILD_TESTS=$(usex test)
+               -DFTDI_EEPROM=$(usex tools)
+               -DCMAKE_SKIP_BUILD_RPATH=ON
+       )
+       cmake-utils_src_configure
+}
+
+src_install() {
+       cmake-utils_src_install
+       use python && python_optimize
+       dodoc AUTHORS ChangeLog README TODO
+
+       if use doc ; then
+               # Clean up crap man pages. #356369
+               rm -vf "${CMAKE_BUILD_DIR}"/doc/man/man3/_* || die
+
+               doman "${CMAKE_BUILD_DIR}"/doc/man/man3/*
+               dodoc -r "${CMAKE_BUILD_DIR}"/doc/html
+       fi
+       if use examples ; then
+               docinto examples
+               dodoc examples/*.c
+       fi
+}
index 38eb00e0832dab475ddc17c5110709a6ca65bb08..04136fcafa51bfd73f9d1f1d030c90866f0656e4 100644 (file)
@@ -1,15 +1,16 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI="4"
+EAPI=6
 
-inherit cmake-utils
+PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 )
+inherit cmake-utils python-single-r1
 
 MY_P="${PN}1-${PV}"
 if [[ ${PV} == 9999* ]] ; then
        EGIT_REPO_URI="git://developer.intra2net.com/${PN}"
-       inherit git-2
+       inherit git-r3
 else
        SRC_URI="http://www.intra2net.com/en/developer/${PN}/download/${MY_P}.tar.bz2"
        KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86"
@@ -24,7 +25,7 @@ IUSE="cxx doc examples python static-libs test tools"
 
 RDEPEND="virtual/libusb:1
        cxx? ( dev-libs/boost )
-       python? ( dev-lang/python )
+       python? ( ${PYTHON_DEPS} )
        tools? (
                !<dev-embedded/ftdi_eeprom-1.0
                dev-libs/confuse
@@ -33,17 +34,23 @@ DEPEND="${RDEPEND}
        python? ( dev-lang/swig )
        doc? ( app-doc/doxygen )"
 
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_setup() {
+       use python && python-single-r1_pkg_setup
+}
+
 S=${WORKDIR}/${MY_P}
 
 src_configure() {
        mycmakeargs=(
-               $(cmake-utils_use cxx FTDIPP)
-               $(cmake-utils_use doc DOCUMENTATION)
-               $(cmake-utils_use examples EXAMPLES)
-               $(cmake-utils_use python PYTHON_BINDINGS)
-               $(cmake-utils_use static-libs STATICLIBS)
-               $(cmake-utils_use test BUILD_TESTS)
-               $(cmake-utils_use tools FTDI_EEPROM)
+               -DFTDIPP=$(usex cxx)
+               -DDOCUMENTATION=$(usex doc)
+               -DEXAMPLES=$(usex examples)
+               -DPYTHON_BINDINGS=$(usex python)
+               -DSTATICLIBS=$(usex static-libs)
+               -DBUILD_TESTS=$(usex test)
+               -DFTDI_EEPROM=$(usex tools)
                -DCMAKE_SKIP_BUILD_RPATH=ON
        )
        cmake-utils_src_configure
@@ -51,6 +58,7 @@ src_configure() {
 
 src_install() {
        cmake-utils_src_install
+       use python && python_optimize
        dodoc AUTHORS ChangeLog README TODO
 
        if use doc ; then
@@ -58,7 +66,7 @@ src_install() {
                rm -vf "${CMAKE_BUILD_DIR}"/doc/man/man3/_* || die
 
                doman "${CMAKE_BUILD_DIR}"/doc/man/man3/*
-               dohtml "${CMAKE_BUILD_DIR}"/doc/html/*
+               dodoc -r "${CMAKE_BUILD_DIR}"/doc/html
        fi
        if use examples ; then
                docinto examples