git: 0c2c029ec6e0 - main - misc/py-xgboost: update 3.1.3 → 3.4.1
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 19 Sep 2026 22:43:12 UTC
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=0c2c029ec6e0f64ef197b5a60ef11d25696d8fd9
commit 0c2c029ec6e0f64ef197b5a60ef11d25696d8fd9
Author: Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-09-19 22:34:34 +0000
Commit: Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-09-19 22:42:25 +0000
misc/py-xgboost: update 3.1.3 → 3.4.1
---
misc/py-xgboost/Makefile | 38 +++++++++----
misc/py-xgboost/distinfo | 6 +--
misc/py-xgboost/files/patch-CMakeLists.txt | 85 ++++++++----------------------
3 files changed, 53 insertions(+), 76 deletions(-)
diff --git a/misc/py-xgboost/Makefile b/misc/py-xgboost/Makefile
index 316a2adfd0d7..74675c2807b9 100644
--- a/misc/py-xgboost/Makefile
+++ b/misc/py-xgboost/Makefile
@@ -1,7 +1,6 @@
PORTNAME= xgboost
DISTVERSIONPREFIX= v
-DISTVERSION= 3.1.3
-PORTREVISION= 2
+DISTVERSION= 3.4.1
CATEGORIES= misc # machine-learning
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -16,15 +15,25 @@ BROKEN_armv7= compilation fails due to type conversion issues, like on i386, but
BROKEN_i386= compilation fails, see https://github.com/dmlc/xgboost/issues/10002
BUILD_DEPENDS= cmake:devel/cmake-core \
- ${PYTHON_PKGNAMEPREFIX}hatchling>=1.12.1:devel/py-hatchling@${PY_FLAVOR}
+ ${PYTHON_PKGNAMEPREFIX}scikit-build-core>=0.11.0:devel/py-scikit-build-core@${PY_FLAVOR}
LIB_DEPENDS= libdmlc.so:devel/dmlc-core
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}numpy>=1.16:math/py-numpy@${PY_FLAVOR} \
- ${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR}
-RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}pandas>=1.2:math/py-pandas@${PY_FLAVOR} \
- ${PYTHON_PKGNAMEPREFIX}pyarrow>0:databases/py-pyarrow@${PY_FLAVOR} \
- ${PYTHON_PKGNAMEPREFIX}scikit-learn>0:science/py-scikit-learn@${PY_FLAVOR}
+ ${PYTHON_PKGNAMEPREFIX}scikit-learn>=0:science/py-scikit-learn@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}scipy>=0:science/py-scipy@${PY_FLAVOR}
+RUN_DEPENDS_dask= \
+ ${PYTHON_PKGNAMEPREFIX}dask>0:devel/py-dask@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}distributed>0:devel/py-distributed@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pandas>0:math/py-pandas@${PY_FLAVOR}
+RUN_DEPENDS_plotting= \
+ ${PYTHON_PKGNAMEPREFIX}graphviz>0:graphics/py-graphviz@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}matplotlib>=2.1.0:math/py-matplotlib@${PY_FLAVOR}
+RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}pandas>=1.2:math/py-pandas@${PY_FLAVOR}
+RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}scikit-learn>0:science/py-scikit-learn@${PY_FLAVOR}
+RUN_DEPENDS+= ${RUN_DEPENDS_dask}
+RUN_DEPENDS+= ${RUN_DEPENDS_plotting}
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}loky>0:devel/py-loky@${PY_FLAVOR}
-USES= compiler:c11 python localbase:ldflags
+USES= compiler:c++17-lang python:3.12+ localbase:ldflags
USE_PYTHON= pep517 autoplist pytest
USE_LDCONFIG= yes
@@ -32,15 +41,24 @@ USE_GITHUB= yes
GH_ACCOUNT= dmlc
WRKSRC_SUBDIR= python-package
-
LDFLAGS+= -lexecinfo \
-ldmlc
PYDISTUTILS_INSTALLARGS= --use-system-libxgboost # this is ignored so that setup.py has to be patched, see https://github.com/dmlc/xgboost/issues/6879
-TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+TEST_ENV= ${MAKE_ENV} \
+ LD_LIBRARY_PATH=/lib \
+ PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+TEST_ARGS= --disable-plugin-autoload \
+ --deselect=python/test_tracker.py::test_rank_assignment \
+ --deselect=python/test_updaters.py::TestTreeMethod::test_approx
TEST_WRKSRC= ${WRKSRC}/../tests/python
+do-test:
+ @${MKDIR} ${WRKDIR}/.bin
+ @${LN} -sf ${PYTHON_CMD} ${WRKDIR}/.bin/python
+ cd ${WRKSRC}/.. && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -c 'import ctypes, pytest, sys; raise SystemExit(pytest.main(sys.argv[1:] + ["--ignore=tests/python/test_with_arrow.py", "tests/python"]))' ${TEST_ARGS}
+
post-install:
@${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/xgboost/lib/libxgboost.so
diff --git a/misc/py-xgboost/distinfo b/misc/py-xgboost/distinfo
index d44192f5a83a..efa72d38afe2 100644
--- a/misc/py-xgboost/distinfo
+++ b/misc/py-xgboost/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1768210996
-SHA256 (dmlc-xgboost-v3.1.3_GH0.tar.gz) = 17c545f43ca543979dcafdfeb4921240ba3673d1464ec4c2f592733af12ad578
-SIZE (dmlc-xgboost-v3.1.3_GH0.tar.gz) = 2388327
+TIMESTAMP = 1789676928
+SHA256 (dmlc-xgboost-v3.4.1_GH0.tar.gz) = cb3a0c786144025acf5b1ff48c81198aa2124813e677cbdda9f2f6271a5dbc1a
+SIZE (dmlc-xgboost-v3.4.1_GH0.tar.gz) = 2449877
diff --git a/misc/py-xgboost/files/patch-CMakeLists.txt b/misc/py-xgboost/files/patch-CMakeLists.txt
index 10ec5aecd063..106656a01f35 100644
--- a/misc/py-xgboost/files/patch-CMakeLists.txt
+++ b/misc/py-xgboost/files/patch-CMakeLists.txt
@@ -1,67 +1,26 @@
---- ../CMakeLists.txt.orig 2026-01-08 13:54:31 UTC
+-- Build against the system dmlc-core package instead of the bundled
+-- submodule. XGBoost 3.4.1 gained an option for this, but the default still
+-- expects the missing submodule and one upstream typo links against a
+-- non-existent variable instead of the imported dmlc::dmlc CMake target.
+--- ../CMakeLists.txt.orig
+++ ../CMakeLists.txt
-@@ -162,11 +162,11 @@ endif()
- if(PLUGIN_RMM AND NOT (CMAKE_SYSTEM_NAME STREQUAL "Linux"))
- message(SEND_ERROR "`PLUGIN_RMM` must be used with Linux.")
- endif()
--if(ENABLE_ALL_WARNINGS)
-- if((NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
-- message(SEND_ERROR "ENABLE_ALL_WARNINGS is only available for Clang and GCC.")
-- endif()
--endif()
-+#if(ENABLE_ALL_WARNINGS)
-+# if((NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
-+# message(SEND_ERROR "ENABLE_ALL_WARNINGS is only available for Clang and GCC.")
-+# endif()
-+#endif()
- if(BUILD_STATIC_LIB AND (R_LIB OR JVM_BINDINGS))
- message(SEND_ERROR "Cannot build a static library libxgboost.a when R or JVM packages are enabled.")
- endif()
-@@ -289,7 +289,7 @@ set(DMLC_FORCE_SHARED_CRT ${FORCE_SHARED_CRT})
-
- # dmlc-core
- set(DMLC_FORCE_SHARED_CRT ${FORCE_SHARED_CRT})
--add_subdirectory(${xgboost_SOURCE_DIR}/dmlc-core)
-+#add_subdirectory(${xgboost_SOURCE_DIR}/dmlc-core)
-
- if(MSVC)
- if(TARGET dmlc_unit_tests)
-@@ -302,7 +302,7 @@ add_subdirectory(${xgboost_SOURCE_DIR}/src)
-
+@@ -54,7 +54,7 @@
+ option(BUILD_DEPRECATED_CLI "Build the deprecated command line interface" OFF)
+ option(FORCE_SHARED_CRT "Build with dynamic CRT on Windows (/MD)" OFF)
+ option(BUILD_WITH_GIT_HASH "Add a short git hash to the build info." OFF)
+-option(BUILD_WITH_SYSTEM_DMLC "Use system package for dmlc." OFF)
++option(BUILD_WITH_SYSTEM_DMLC "Use system package for dmlc." ON)
+ ## Bindings
+ option(JVM_BINDINGS "Build JVM bindings" OFF)
+ option(R_LIB "Build shared library for R package" OFF)
+@@ -323,8 +323,8 @@
# core xgboost
add_subdirectory(${xgboost_SOURCE_DIR}/src)
--target_link_libraries(objxgboost PUBLIC dmlc)
-+#target_link_libraries(objxgboost PUBLIC dmlc)
-
- # Link -lstdc++fs for GCC 8.x
- if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
-@@ -391,7 +391,7 @@ if(BUILD_DEPRECATED_CLI)
- target_include_directories(runxgboost
- PRIVATE
- ${xgboost_SOURCE_DIR}/include
-- ${xgboost_SOURCE_DIR}/dmlc-core/include
-+ #${xgboost_SOURCE_DIR}/dmlc-core/include
- )
- set_target_properties(runxgboost PROPERTIES OUTPUT_NAME xgboost)
- xgboost_target_properties(runxgboost)
-@@ -407,7 +407,7 @@ endif()
- #-- End CLI for xgboost
-
- # Common setup for all targets
--foreach(target xgboost objxgboost dmlc)
-+foreach(target xgboost objxgboost)
- xgboost_target_properties(${target})
- xgboost_target_link_libraries(${target})
- xgboost_target_defs(${target})
-@@ -469,9 +469,9 @@ if(BUILD_STATIC_LIB)
- # https://github.com/dmlc/xgboost/issues/6085
- if(BUILD_STATIC_LIB)
- if(BUILD_DEPRECATED_CLI)
-- set(INSTALL_TARGETS xgboost runxgboost objxgboost dmlc)
-+ set(INSTALL_TARGETS xgboost runxgboost objxgboost)
- else()
-- set(INSTALL_TARGETS xgboost objxgboost dmlc)
-+ set(INSTALL_TARGETS xgboost objxgboost)
- endif()
+ # dmlc-core
+-if(BUILD_WTIH_SYSTEM_DMLC)
+- target_link_libraries(objxgboost PUBLIC ${dmlc-LIBRARIES})
++if(BUILD_WITH_SYSTEM_DMLC)
++ target_link_libraries(objxgboost PUBLIC dmlc::dmlc)
else()
- if(BUILD_DEPRECATED_CLI)
+ target_link_libraries(objxgboost PUBLIC dmlc)
+ endif()