summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Waibel <waebbl-gentoo@posteo.net>2021-05-18 20:40:01 +0200
committerAlexey Shvetsov <alexxy@gentoo.org>2021-05-31 22:26:02 +0300
commitb83b3eaf0c8423672624c1cb06cc0ff5bc4aa360 (patch)
tree7977c17433db01be17aec2775159339787ab6d1c /media-gfx/freecad
parentx11-misc/synergy: Bump to 1.14.0.1-rc (diff)
downloadgentoo-b83b3eaf0c8423672624c1cb06cc0ff5bc4aa360.tar.gz
gentoo-b83b3eaf0c8423672624c1cb06cc0ff5bc4aa360.tar.bz2
gentoo-b83b3eaf0c8423672624c1cb06cc0ff5bc4aa360.zip
media-gfx/freecad: fix opencascade issue
Fix an issue with sci-libs/opencascade:7.4.0, where a wrong options has been passed to cmake. Additionally improves testing which version of opencascade has been installed and adds some guards to select correct options. Closes: https://bugs.gentoo.org/789705 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net> Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
Diffstat (limited to 'media-gfx/freecad')
-rw-r--r--media-gfx/freecad/freecad-0.19.2.ebuild27
1 files changed, 19 insertions, 8 deletions
diff --git a/media-gfx/freecad/freecad-0.19.2.ebuild b/media-gfx/freecad/freecad-0.19.2.ebuild
index 7e191a22a02a..4719298feb3b 100644
--- a/media-gfx/freecad/freecad-0.19.2.ebuild
+++ b/media-gfx/freecad/freecad-0.19.2.ebuild
@@ -141,11 +141,20 @@ src_prepare() {
rm "${S}/cMake/FindCoin3D.cmake" || die
# Fix OpenCASCADE lookup
- # TODO: check this for opencascade-7.5.1 locations, which have
- # changed since 7.4.0 after that package has merged
- sed -e 's|/usr/include/opencascade|${CASROOT}/include/opencascade|' \
- -e 's|/usr/lib|${CASROOT}/'$(get_libdir)' NO_DEFAULT_PATH|' \
- -i cMake/FindOpenCasCade.cmake || die
+ local OCC_P=$(best_version sci-libs/opencascade[vtk])
+ OCC_P=${OCC_P#sci-libs/}
+ local OCC_PV=${OCC_P#opencascade-}
+ OCC_PV=$(ver_cut 1-2 ${OCC_PV})
+ # check for CASROOT needed to ensure occ-7.5 is eselected and profile resourced
+ if [[ ${OCC_PV} = 7.5 && ${CASROOT} = "/usr" ]]; then
+ sed -e 's|/usr/include/opencascade|'${CASROOT}'/include/'${OCC_P}'|' \
+ -e 's|/usr/lib|'${CASROOT}'/'$(get_libdir)'/'${OCC_P}' NO_DEFAULT_PATH|' \
+ -i cMake/FindOpenCasCade.cmake || die
+ else
+ sed -e 's|/usr/include/opencascade|${CASROOT}/include/opencascade|' \
+ -e 's|/usr/lib|${CASROOT}/'$(get_libdir)' NO_DEFAULT_PATH|' \
+ -i cMake/FindOpenCasCade.cmake || die
+ fi
# Fix desktop file
sed -e 's/Exec=FreeCAD/Exec=freecad/' -i src/XDGData/org.freecadweb.FreeCAD.desktop || die
@@ -227,14 +236,16 @@ src_configure() {
if has_version ">=sci-libs/opencascade-7.5"; then
# bug https://bugs.gentoo.org/788274
+ local OCC_P=$(best_version sci-libs/opencascade[vtk])
+ OCC_P=${OCC_P#sci-libs/}
mycmakeargs+=(
- -DOCC_INCLUDE_DIR="${CASROOT}"/include/opencascade-7.5.1
- -DOCC_LIBRARY_DIR="${CASROOT}"/$(get_libdir)/opencascade-7.5.1
+ -DOCC_INCLUDE_DIR="${CASROOT}"/include/${OCC_P}
+ -DOCC_LIBRARY_DIR="${CASROOT}"/$(get_libdir)/${OCC_P}
)
else
# <occ-7.5 uses different layout
mycmakeargs+=(
- -DOCC_INCLUDEDIR="${CASROOT}"/include/opencascade
+ -DOCC_INCLUDE_DIR="${CASROOT}"/include/opencascade
-DOCC_LIBRARY_DIR="${CASROOT}"/$(get_libdir)
)
fi