app-admin/awscli: Bump to 1.37.9
[gentoo/gentoo.git] / media-libs / qhull / qhull-2020.2-r3.ebuild
blob3461992646ddcc3854d6f8b1ab3dd74354e6329f
1 # Copyright 1999-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=7
6 inherit cmake
8 DESCRIPTION="Geometry library"
9 HOMEPAGE="http://www.qhull.org"
10 SRC_URI="https://github.com/qhull/qhull/archive/${PV}.tar.gz -> ${P}.tar.gz"
12 SLOT="0/8"
13 LICENSE="BSD"
14 KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos"
15 IUSE="doc static-libs"
17 DOCS=( Announce.txt File_id.diz README.txt REGISTER.txt )
19 PATCHES=(
20         "${FILESDIR}/${PN}-2020.2-deprecated-pkgconfig.patch"
23 src_prepare() {
24         if ! use doc ; then
25                 sed -i \
26                         -e '/^install(DIRECTORY html/d' \
27                         -e '/^[[:blank:]]*index.htm/d' \
28                         CMakeLists.txt || die
29         fi
31         sed -i \
32                 -e "s@lib/pkgconfig@$(get_libdir)/pkgconfig@" \
33                 -e "s@lib/cmake/Qhull@$(get_libdir)/cmake/Qhull@" \
34                 CMakeLists.txt || die
36         cmake_src_prepare
39 src_configure() {
40         local mycmakeargs=(
41                 -DBUILD_STATIC_LIBS=$(usex static-libs)
42                 -DLINK_APPS_SHARED=ON
43                 -DDOC_INSTALL_DIR="${EPREFIX}/usr/share/doc/${PF}"
44                 -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
45         )
47         cmake_src_configure
50 src_compile() {
51         cmake_src_compile all libqhull
54 src_install() {
55         cmake_src_install
56         dolib.so "${BUILD_DIR}"/libqhull{$(get_libname),$(get_libname "*")}
58         # fix double prefix in pc files
59         sed -i "/^libdir/s@/.*@/$(get_libdir)@" "${ED}/usr/$(get_libdir)/pkgconfig/"*.pc || die
61         if ! use static-libs; then
62                 rm "${ED}/usr/$(get_libdir)/pkgconfig/qhull"{static,static_r,cpp}.pc || die
63                 rm -r "${ED}/usr/include/libqhullcpp" || die
64         fi