app-pda/libimobiledevice: Sync with portage
[shuber-gentoo-overlay.git] / app-pda / libimobiledevice / libimobiledevice-9999.ebuild
index faad857a78554772b8b0c8b85523db43fc41f1e7..1bfc0d522373033ed8432edccbb4a770a99511a6 100644 (file)
@@ -1,45 +1,56 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
-PYTHON_COMPAT=( python{2_7,3_4,3_5} )
-inherit eutils autotools python-r1
+EAPI=7
+
+COMMIT="master"
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+inherit autotools python-r1
 
 DESCRIPTION="Support library to communicate with Apple iPhone/iPod Touch devices"
-HOMEPAGE="http://www.libimobiledevice.org/"
-SRC_URI="https://github.com/${PN}/${PN}/archive/master.zip -> ${PN}.zip"
+HOMEPAGE="https://www.libimobiledevice.org/"
+SRC_URI="https://cgit.libimobiledevice.org/libimobiledevice.git/snapshot/libimobiledevice-${COMMIT}.tar.bz2 -> ${P}.tar.bz2"
 
 # While COPYING* doesn't mention 'or any later version', all the headers do, hence use +
 LICENSE="GPL-2+ LGPL-2.1+"
+
 SLOT="0/6" # based on SONAME of libimobiledevice.so
+
 KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86"
-IUSE="gnutls python static-libs"
+IUSE="doc gnutls libressl python static-libs"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
-RDEPEND=">=app-pda/libplist-1.11:=
-       >=app-pda/libusbmuxd-1.0.9:=
+RDEPEND="
+       >=app-pda/libplist-1.11:=
+       >=app-pda/libusbmuxd-1.1.0:=
        gnutls? (
                dev-libs/libgcrypt:0
                >=dev-libs/libtasn1-1.1
-               >=net-libs/gnutls-2.2.0
-               )
-       !gnutls? ( dev-libs/openssl:0 )
+               >=net-libs/gnutls-2.2.0 )
+       !gnutls? (
+               !libressl? ( dev-libs/openssl:0= )
+               libressl? ( dev-libs/libressl:0= ) )
        python? (
                ${PYTHON_DEPS}
-               app-pda/libplist[python(-),${PYTHON_USEDEP}]
-               )"
-DEPEND="${RDEPEND}
-       virtual/pkgconfig
-       python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )"
+               app-pda/libplist[python(-),${PYTHON_USEDEP}] )
+"
 
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+DEPEND="
+       ${RDEPEND}
+"
 
-DOCS=( AUTHORS NEWS README )
+BDEPEND="
+       virtual/pkgconfig
+       doc? ( app-doc/doxygen )
+       python? ( >=dev-python/cython-0.17[${PYTHON_USEDEP}] )
+"
 
+S="${WORKDIR}/${PN}-${COMMIT}"
 BUILD_DIR="${S}_build"
-S="${WORKDIR}/${PN}-master"
 
 src_prepare() {
-       #epatch "${FILESDIR}/gnutls-3.4.patch"
+       default
        eautoreconf
 }
 
@@ -58,7 +69,8 @@ src_configure() {
 
        do_configure_python() {
                # Bug 567916
-               PYTHON_LDFLAGS="$(python_get_LIBS)" do_configure "$@"
+               local -x PYTHON_LDFLAGS="$(python_get_LIBS)"
+               do_configure "$@"
        }
 
        do_configure --without-cython
@@ -67,35 +79,34 @@ src_configure() {
 
 src_compile() {
        python_compile() {
-               emake -C "${BUILD_DIR}"/cython -j1 \
-                       VPATH="${S}/cython:${native_builddir}/cython" \
-                       imobiledevice_la_LIBADD="${native_builddir}/src/libimobiledevice.la"
+               emake -C "${BUILD_DIR}"/cython \
+                       VPATH="${S}/cython:$1/cython" \
+                       imobiledevice_la_LIBADD="$1/src/libimobiledevice.la"
        }
 
-       local native_builddir=${BUILD_DIR}
-       pushd "${BUILD_DIR}" >/dev/null || die
-       emake -j1
-       use python && python_foreach_impl python_compile
-       popd >/dev/null || die
+       emake -C "${BUILD_DIR}"
+       use python && python_foreach_impl python_compile "${BUILD_DIR}"
+
+       if use doc; then
+               doxygen "${BUILD_DIR}"/doxygen.cfg || die
+       fi
 }
 
 src_install() {
        python_install() {
-               emake -C "${BUILD_DIR}/cython" -j1 \
-                       VPATH="${S}/cython:${native_builddir}/cython" \
-                       DESTDIR="${D}" install
+               emake -C "${BUILD_DIR}/cython" install \
+                       DESTDIR="${D}" \
+                       VPATH="${S}/cython:$1/cython"
        }
 
-       local native_builddir=${BUILD_DIR}
-       pushd "${BUILD_DIR}" >/dev/null || die
-       emake -j1 DESTDIR="${D}" install
-       use python && python_foreach_impl python_install
-       popd >/dev/null || die
+       emake -C "${BUILD_DIR}" install DESTDIR="${D}"
+       use python && python_foreach_impl python_install "${BUILD_DIR}"
+       use doc && dodoc docs/html/*
 
-       #dodoc docs/html/*
        if use python; then
                insinto /usr/include/${PN}/cython
                doins cython/imobiledevice.pxd
        fi
-       prune_libtool_files --all
+
+       find "${D}" -name '*.la' -delete || die
 }