sci-mathematics/cgal: add 6.2, 9999

Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1857
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Paul Zander
2026-08-13 17:56:14 +02:00
committed by Sam James
parent 6a6a3447dc
commit de284034fc
4 changed files with 430 additions and 0 deletions

View File

@@ -10,3 +10,5 @@ DIST CGAL-6.1-doc_html.tar.xz 65517356 BLAKE2B 19dd8660be8ab84373809559e808e5777
DIST CGAL-6.1.1-doc_html.tar.xz 65520064 BLAKE2B 05de9df026b7643375554a3d2b28e498071559555a3d4f2c74fe55151f89b3c746c7d76401795ac4694593e74e01d38ef1ed40997810423ec5cab46ef0ef4003 SHA512 223701d046ff41b3f4096e1fcb432404a18b49ec92f8a4a4bbc01d35a32318bc17caf45ddec9318feb2be602c5e00c172216dff8dc7d7d7b27321c740043b803
DIST CGAL-6.1.1.tar.xz 26305296 BLAKE2B 4c96527dac7c1fd26d4a4de5df5bec3e2c4fcd0eae64edf5809e600a6623be1b2561354d7be2dfe44589dd37cba34f169d30d65fa78f42a1f296200a47477c2f SHA512 dc6ae82526697df986c755f0a2d4754b04810b8910bec794bed4f822cc2e15d6174e85649241295022acddca3cd10408e7b279b6da93e0506d44e7fc1e03b7c6
DIST CGAL-6.1.tar.xz 26293988 BLAKE2B 21a154e26b54c985edcee10d5401020b272e1ff4a477b4eeaf9cffec0043f4fb4973c30088804a20a5ff9c7d974c65c198d5a8e626fa33910b5ab6175df973be SHA512 8921dad4802bb276348a6fccb5a4e0e191f0f03bd9224eeaa8f5525eab87c4dc949741bb0cb11e4127a080090635ae2f243fa5904376488e5b7dd966e0c312a5
DIST CGAL-6.2-doc_html.tar.xz 74966988 BLAKE2B 667d164b0286cab7dbea9005d5a39d4115556568d3b4d05f2cf6ae38664b10784d72c18edca9b4538c44da6e4996187127e0f67d708fef2df762454923ca135d SHA512 651eb366083aa05877d5e743a501cd07480d1d8ac4dc48343ab991522d1a2c1b475a4183fddb27809d7f8b2d97983d9e2f92ad1068765411c832d675861e282d
DIST CGAL-6.2.tar.xz 26596404 BLAKE2B 783d3adc86a369ec79a2b5acb4e421b1c64590929c4cc2e9de90e3ede6e926ac49723db0694778df66551cec05047aed356f598e436923b9a801b98670f0e56a SHA512 5f0a3e24d56250b1651fe9016d14da9dcc1af0dd1347b4daa0bf6ae8c512ab831ea66ce5655133497f9965071d2e200582b36ba29961ecb5cdc896b47a5d7e17

View File

@@ -0,0 +1,187 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CMAKE_BUILD_TYPE="Debug"
# Modules provided by dev-cpp/eigen
CMAKE_REMOVE_MODULES_LIST=( FindEigen3 )
inherit cmake cuda flag-o-matic multiprocessing
DESCRIPTION="C++ library for geometric algorithms and data structures"
HOMEPAGE="https://www.cgal.org/"
SRC_URI="
https://github.com/CGAL/cgal/releases/download/v${PV}/${P^^}.tar.xz
doc? (
https://github.com/CGAL/cgal/releases/download/v${PV}/${P^^}-doc_html.tar.xz
)
"
S="${WORKDIR}/${P^^}"
LICENSE="LGPL-3 GPL-3 Boost-1.0"
SLOT="0/14"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
IUSE="demos doc examples test"
RESTRICT="!test? ( test )"
# This seems wrong.
RDEPEND="
dev-cpp/eigen:=
dev-libs/boost:=
dev-libs/gmp:=[cxx]
dev-libs/mpfr:=
virtual/zlib:=
x11-libs/libX11:=
virtual/glu:=
virtual/opengl:=
"
DEPEND="${RDEPEND}
test? (
net-libs/libssh[server]
demos? (
dev-qt/qtbase:6[gui,opengl,widgets]
)
examples? (
amd64? (
media-gfx/openmesh
)
dev-qt/qtbase:6[gui,opengl,widgets]
)
)
"
BDEPEND="
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}/${PN}-4.11.1-fix-buildsystem.patch"
)
pkg_pretend() {
if ! use test && { use demos || use examples; }; then
ewarn "The \"demos\" and \"examples\" useflag require USE=\"test\""
fi
}
src_prepare() {
if use doc; then
rm -r "doc_html" || die
mv "${WORKDIR}/doc_html" "${S}/" || die
fi
if use examples; then
rm -Rf \
examples/BGL_polyhedron_3 \
examples/BGL_surface_mesh \
examples/Isosurfacing_3 \
examples/Mesh_3 \
examples/Polygon_mesh_processing \
examples/Surface_mesh_simplification \
|| die
fi
cmake_src_prepare
}
src_compile() {
cmake_src_compile demos
cmake_src_compile examples
cmake_src_compile ALL_CGAL_TARGETS
}
src_configure() {
# Header only
filter-flags -DNDEBUG*
local deps=(
ESBTL
F2C
GLPK
IPE
ITT
LASLIB
LEDA
libpointmatcher
LibSSH
MKL
MPFI
# MPFR
OpenCV
OpenGR
OpenMesh
OSQP
RS
RS3
SCIP
TBB
UMFPACK
VTK
)
local mycmakeargs=(
-DCMAKE_POLICY_DEFAULT_CMP0167="NEW"
# 964750
"$(printf -- "-DCMAKE_DISABLE_FIND_PACKAGE_%s=yes " "${deps[@]}")"
-DCGAL_INSTALL_LIB_DIR="$(get_libdir)"
-DCGAL_INSTALL_CMAKE_DIR="$(get_libdir)/cmake/CGAL"
# https://github.com/CGAL/cgal/wiki/Testing#using-ctest
-DCGAL_ENABLE_TESTING="$(usex test)"
-DCGAL_CTEST_DISPLAY_MEM_AND_TIME="yes"
# exits some tests early
-DCGAL_TEST_SUITE="yes"
-DCGAL_TEST_DRAW_FUNCTIONS="yes"
-DCGAL_WITH_GMPXX="yes"
# -DCGAL_WITH_benchmark="$(usex test "$(usex benchmark)")" # wired up but not present
-DCGAL_WITH_demos="$(usex test "$(usex demos)")"
-DCGAL_WITH_examples="$(usex test "$(usex examples)")"
)
# Optionally depends on sci-lib/vtk, which looks up a cuda compiler iff build with USE=cuda.
# We therefore need to set the correct CUDAHOSTCXX and setup the sandbox.
if use test && { use demos || use examples; }; then
if has_version "sci-libs/vtk[cuda]" ; then
cuda_add_sandbox -w
addpredict "/dev/char/"
fi
fi
cmake_src_configure
}
src_test() {
# tests have split compilation & execution stages that do not depend on each other, but break when run out of order
# We pass CMAKE_BUILD_PARALLEL_LEVEL to run compilation tests in parallel
local -x CMAKE_BUILD_PARALLEL_LEVEL="$(get_makeopts_jobs)"
einfo "using CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}"
# We pass CTEST_PARALLEL_LEVEL to run execution tests in parallel
local -x CTEST_PARALLEL_LEVEL="$(get_makeopts_jobs)"
einfo "using CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL}"
local -x QT_QPA_PLATFORM="offscreen"
cmake_src_test -j1
}
src_install() {
if use doc; then
local HTML_DOCS=(
"doc_html/."
)
fi
cmake_src_install
if use demos; then
dodoc -r demos
fi
if use examples; then
dodoc -r examples
fi
}

View File

@@ -0,0 +1,238 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# Modules provided by dev-cpp/eigen
CMAKE_REMOVE_MODULES_LIST=( FindEigen3 )
inherit cmake cuda flag-o-matic multiprocessing
DESCRIPTION="C++ library for geometric algorithms and data structures"
HOMEPAGE="https://www.cgal.org/"
if [[ ${PV} == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/${PN^^}/${PN}.git"
else
SRC_URI="
https://github.com/CGAL/cgal/releases/download/v${PV}/${P^^}.tar.xz
doc? (
https://github.com/CGAL/cgal/releases/download/v${PV}/${P^^}-doc_html.tar.xz
)
"
S="${WORKDIR}/${P^^}"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
fi
LICENSE="LGPL-3 GPL-3 Boost-1.0"
SLOT="0/14"
IUSE="demos doc examples test"
RESTRICT="!test? ( test )"
REQUIRED_USE="
test? ( || (
demos examples
) )
"
# Referenced in the cmake files.
RDEPEND="
dev-cpp/eigen:=
dev-libs/boost:=
dev-libs/gmp:=[cxx]
dev-libs/mpfr:=
virtual/zlib:=
"
DEPEND="${RDEPEND}
test? (
net-libs/libssh[server]
demos? (
dev-qt/qtbase:6[gui,opengl,widgets]
)
examples? (
amd64? (
media-gfx/openmesh
)
dev-qt/qtbase:6[gui,opengl,widgets]
)
)
"
BDEPEND="
virtual/pkgconfig
"
pkg_pretend() {
if ! use test && { use demos || use examples; }; then
ewarn "The \"demos\" and \"examples\" useflag require USE=\"test\""
fi
}
src_prepare() {
if use doc; then
rm -r "doc_html" || die
mv "${WORKDIR}/doc_html" "${S}/" || die
fi
cmake_src_prepare
}
src_configure() {
# Header only since 5.0
local mycmakeargs=(
-DCMAKE_POLICY_DEFAULT_CMP0167="NEW"
-DCGAL_INSTALL_LIB_DIR="$(get_libdir)"
-DCGAL_INSTALL_CMAKE_DIR="$(get_libdir)/cmake/CGAL"
# https://github.com/CGAL/cgal/wiki/Testing#using-ctest
-DCGAL_ENABLE_TESTING="$(usex test)"
# Forcibly wipe to get rid of NDEBUG. see below
-DCMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE^^}=""
)
if use test; then
# include/CGAL/config.h:53:4: error: #error The test-suite needs no NDEBUG defined
filter-flags -DNDEBUG*
# cmake/modules/display-third-party-libs-versions.cmake
# these need use flags eventually
local deps=(
Ceres
GLPK
# GMP
ITK
ITT
LASLIB
libpointmatcher
METIS
MPFI
# MPFR
OpenCV
OpenGR
OSQP
SCIP
SuiteSparse
TBB
VTK
# ZLIB
)
if use demos || use examples; then
# Optionally depends on sci-lib/vtk, which looks up a cuda compiler iff build with USE=cuda.
# We therefore need to set the correct CUDAHOSTCXX and setup the sandbox.
if has_version "sci-libs/vtk[cuda]" ; then
cuda_add_sandbox
addpredict "/dev/char/"
fi
deps+=(
LEDA
# MKL
# RS
# RS3
SCIP
# UMFPACK
)
fi
if ! use demos; then
deps+=(
# Eigen3
)
fi
if ! use demos && ! use examples; then
deps+=(
# Boost
# Threads
Qt6
)
fi
if use examples; then
deps+=(
ESBTL
)
else
deps+=(
IPE
LibSSH
OpenMesh
)
fi
mycmakeargs+=(
-DCGAL_CTEST_DISPLAY_MEM_AND_TIME="yes"
# exits some tests early
-DCGAL_TEST_SUITE="yes"
-DCGAL_TEST_DRAW_FUNCTIONS="yes"
-DCGAL_DISABLE_GMP="no"
# -DCGAL_WITH_benchmark="$(usex test "$(usex benchmark)")" # wired up but not present
-DCGAL_WITH_demos="$(usex test "$(usex demos)")"
-DCGAL_WITH_examples="$(usex test "$(usex examples)")"
)
if [[ -n "${deps[@]}" ]]; then
mycmakeargs+=(
# 964750
# this does not work as demos and examples are separate cmake calls that ignore mycmakeargs
$(printf -- "-DCMAKE_DISABLE_FIND_PACKAGE_%s=yes " "${deps[@]}")
)
fi
fi
cmake_src_configure
}
src_compile() {
if use test; then
if use demos; then
cmake_src_compile demos
fi
if use examples; then
cmake_src_compile examples
fi
cmake_src_compile ALL_CGAL_TARGETS
fi
}
src_test() {
# tests have split compilation & execution stages that do not depend on each other, but break when run out of order
# We pass CMAKE_BUILD_PARALLEL_LEVEL to run compilation tests in parallel
local -x CMAKE_BUILD_PARALLEL_LEVEL="$(get_makeopts_jobs)"
einfo "using CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}"
# We pass CTEST_PARALLEL_LEVEL to run execution tests in parallel
local -x CTEST_PARALLEL_LEVEL="$(get_makeopts_jobs)"
einfo "using CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL}"
local -x QT_QPA_PLATFORM="offscreen"
local CMAKE_SKIP_TESTS=(
region_growing_planes_on_point_set_3
)
cmake_src_test -j1
}
src_install() {
if use doc; then
local HTML_DOCS=(
"doc_html/."
)
fi
cmake_src_install
if use demos; then
dodoc -r demo
fi
if use examples; then
dodoc -r examples
fi
}

View File

@@ -22,6 +22,9 @@
<remote-id type="github">CGAL/cgal</remote-id>
</upstream>
<use>
<!--<flag name="benchmark">Build benchmarks during test (requires USE=test)</flag>-->
<flag name="demos">Build demos during test (requires USE=test)</flag>
<flag name="examples">Build examples during test (requires USE=test)</flag>
<flag name="test-full">Run demos and examples when testing</flag>
</use>
</pkgmetadata>