Skip to content

Commit

Permalink
dev-libs/imath: some tweaks to the new ebuild
Browse files Browse the repository at this point in the history
1. Compute MY_PN from PN instead of hardcoding it;
2. Make PYTHON_REQUIRED_USE conditional on USE=python (other Pythonic
   bits have already been conditional on this flag);
3. s/PYTHON_MULTI_USEDEP/PYTHON_USEDEP/ ;
4. In src_configure, change the name of a local variable from MY_PV to
   majorver to avoid confusing it for a global one;
5. In src_install() set HTML_DOCS before calling cmake_src_install so
   that einstalldocs isn't called twice.

Closes: gentoo#20930
Signed-off-by: Marek Szuba <[email protected]>
  • Loading branch information
Marek Szuba committed Jul 21, 2021
1 parent d258320 commit 7ed444c
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions dev-libs/imath/imath-3.0.5.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,59 @@ PYTHON_COMPAT=( python3_{8..10} )

inherit cmake python-single-r1

MY_PN=Imath
MY_PN="${PN^}"

DESCRIPTION="Imath basic math package"
HOMEPAGE="https://imath.readthedocs.io"
SRC_URI="https://github.com/AcademySoftwareFoundation/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
# re-keywording needed for (according to ilmbase keywords):
# ~arm ~arm64 ~mips ~x64-macos ~x86-solaris
KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
S="${WORKDIR}/${MY_PN}-${PV}"

LICENSE="BSD"
SLOT="3/28"
IUSE="doc large-stack python static-libs test"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RESTRICT="!test? ( test )"

RDEPEND="
sys-libs/zlib
python? (
${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-libs/boost:=[python?,${PYTHON_MULTI_USEDEP}]
dev-python/numpy[${PYTHON_MULTI_USEDEP}]
dev-libs/boost:=[python,${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}]
')
)
"
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
doc? ( $(python_gen_cond_dep 'dev-python/breathe[${PYTHON_MULTI_USEDEP}]') )
doc? ( $(python_gen_cond_dep 'dev-python/breathe[${PYTHON_USEDEP}]') )
python? ( ${PYTHON_DEPS} )
"

PATCHES=( "${FILESDIR}"/${P}-0001-changes-needed-for-proper-slotting.patch )
PATCHES=(
"${FILESDIR}"/${P}-0001-changes-needed-for-proper-slotting.patch
)
DOCS=( CHANGES.md CONTRIBUTORS.md README.md SECURITY.md docs/PortingGuide2-3.md )

S="${WORKDIR}/${MY_PN}-${PV}"

pkg_setup() {
use python && python-single-r1_pkg_setup
}

src_configure() {
local MY_PV=$(ver_cut 1)
local majorver=$(ver_cut 1)

local mycmakeargs=(
-DBUILD_SHARED_LIBS=$(usex !static-libs)
-DIMATH_ENABLE_LARGE_STACK=$(usex large-stack)
-DIMATH_INSTALL_PKG_CONFIG=ON
-DIMATH_OUTPUT_SUBDIR="${MY_PN}-${MY_PV}"
-DIMATH_OUTPUT_SUBDIR="${MY_PN}-${majorver}"
-DIMATH_USE_CLANG_TIDY=OFF
)

if use python; then
mycmakeargs+=(
# temp. disable for finding libboost_python310, #803032
Expand All @@ -83,13 +86,9 @@ src_compile() {
}

src_install() {
use doc && HTML_DOCS=( "${S}/docs/_build/html/." )
cmake_src_install

if use doc; then
HTML_DOCS=( "${S}/docs/_build/html/." )
einstalldocs
fi

# if use python; then
# rm "${ED}"/usr/$(get_libdir)/cmake/${MY_PN}/${MY_PN}Config-gentoo.cmake || die
# fi
Expand Down

0 comments on commit 7ed444c

Please sign in to comment.