# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 # XXX: list of supported Python interpreters not tested. –nico PYTHON_COMPAT=( python3_{6,7,8} ) inherit cmake eutils flag-o-matic python-any-r1 DESCRIPTION="Lightweight library for extracting data from files archived in a single zip file" HOMEPAGE="http://zziplib.sourceforge.net/" SRC_URI="https://github.com/gdraheim/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" LICENSE="|| ( LGPL-2.1 MPL-1.1 )" SLOT="0" KEYWORDS="~amd64 ~amd64-linux" IUSE="doc sdl static-libs test" RESTRICT="!test? ( test )" BDEPEND=" doc? ( ${PYTHON_DEPS} ) test? ( ${PYTHON_DEPS} app-arch/zip ) " DEPEND=" sys-libs/zlib sdl? ( >=media-libs/libsdl-1.2.6 ) " RDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}"/${PN}-0.13.69-009-perror.patch "${FILESDIR}"/${P}-find-bash.patch ) # It seems that zziplib-0.13.69-008-div-by-zero.patch has not been entirely # included in the upstream sources. But I do not fully understand it. –nico pkg_setup() { use test && python-any-r1_pkg_setup } src_prepare() { cmake_src_prepare (use test || use doc) && python_fix_shebang . } src_configure() { append-flags -fno-strict-aliasing # bug reported upstream append-cppflags -D_ZZIP_LARGEFILE local mycmakeargs=( -DZZIPCOMPAT=OFF -DZZIPSDL="$(usex sdl ON OFF)" -DBUILD_STATIC_LIBS="$(usex static-libs ON OFF)" -DBUILD_TESTS="$(usex test ON OFF)" -DZZIPTEST="$(usex test ON OFF)" -DZZIPDOCS="$(usex doc ON OFF)" -DZZIPWRAP=OFF ) cmake_src_configure } src_test() { # Not tested. Do not know whether the following is still true. –nico # need this because `make test` will always return true # tests fail with -j > 1 (bug #241186) emake -j1 check }