Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 2021 20:47:49 GMT
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 97c28a620541 - main - misc/py-xgboost: Update 1.2.1 -> 1.4.1
Message-ID:  <202104202047.13KKln8F031373@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=97c28a6205418913c189cf2c1d28c5f5b4b212da

commit 97c28a6205418913c189cf2c1d28c5f5b4b212da
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2021-04-20 20:47:07 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2021-04-20 20:47:43 +0000

    misc/py-xgboost: Update 1.2.1 -> 1.4.1
    
    Reported by:    portscout
---
 misc/py-xgboost/Makefile                       | 35 ++++++++++++--------------
 misc/py-xgboost/distinfo                       | 10 ++++----
 misc/py-xgboost/files/patch-CMakeLists.txt     | 24 ------------------
 misc/py-xgboost/files/patch-setup.py           | 22 ++++++++++++++--
 misc/py-xgboost/files/patch-xgboost_libpath.py |  8 +++---
 5 files changed, 45 insertions(+), 54 deletions(-)

diff --git a/misc/py-xgboost/Makefile b/misc/py-xgboost/Makefile
index 6bd1c705bf30..ce80339159f1 100644
--- a/misc/py-xgboost/Makefile
+++ b/misc/py-xgboost/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	xgboost
 DISTVERSIONPREFIX=	v
-DISTVERSION=	1.2.1
-PORTREVISION=	1
+DISTVERSION=	1.4.1
 CATEGORIES=	misc # machine-learning
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
@@ -13,34 +12,32 @@ LICENSE_FILE=	${WRKSRC}/../LICENSE
 
 BUILD_DEPENDS=	cmake:devel/cmake
 LIB_DEPENDS=	libdmlc.so:devel/dmlc-core \
-		librabit.so:misc/xgboost
+		libxgboost.so:misc/xgboost
 RUN_DEPENDS=	${PYNUMPY} \
 		${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR}
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \
 
 USES=		compiler:c11 python:3.5+ localbase:ldflags
-USE_GITHUB=	yes
-GH_ACCOUNT=	dmlc
 USE_PYTHON=	distutils autoplist
 USE_LDCONFIG=	yes
-GH_TUPLE=	\
-		dmlc:rabit:4acdd7c6f68debe1c39ae07ca75466d74d194dd1:dmlc_rabit/../rabit
 
-WRKSRC_SUBDIR=	python-package
-
-LDFLAGS+=	-lexecinfo
+USE_GITHUB=	yes
+GH_ACCOUNT=	dmlc
+xGH_TUPLE=	\
+		dmlc:rabit:f307ace:dmlc_rabit/../rabit
 
-POST_PLIST=	fix-plist
+WRKSRC_SUBDIR=	python-package
 
-.include <bsd.port.pre.mk>
+PYDISTUTILS_INSTALLARGS=	--use-system-libxgboost # this is ignored so that setup.py has to be patched, see https://github.com/dmlc/xgboost/issues/6879
 
-.if ${OSVERSION} < 1300060
-BROKEN_i386=	undefined symbol: __atomic_load (on 11 and 12, but not on 13)
-.endif
+NO_ARCH=	yes
 
-post-install:
-	@${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}/lib/libxgboost.so
+POST_PLIST=	fix-plist
 
 fix-plist: # https://github.com/dmlc/xgboost/issues/5705
-	@${REINPLACE_CMD} 's|/libxgboost${PYTHON_EXT_SUFFIX}.so$$|/xgboost/lib/libxgboost.so|' ${TMPPLIST}
+	@${REINPLACE_CMD} 's|.*libxgboost.so$$||' ${TMPPLIST}
+
+do-test: # tests fail w/out CUDA: https://github.com/dmlc/xgboost/issues/6881
+	@cd ${WRKSRC}/.. && ${PYTHON_CMD} -m pytest
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/misc/py-xgboost/distinfo b/misc/py-xgboost/distinfo
index 18880207d083..44464a7c1344 100644
--- a/misc/py-xgboost/distinfo
+++ b/misc/py-xgboost/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1603744234
-SHA256 (dmlc-xgboost-v1.2.1_GH0.tar.gz) = 0190b902cdf4e0a05e735a382708e2025f1ff541a53251e43160beb3041bf35b
-SIZE (dmlc-xgboost-v1.2.1_GH0.tar.gz) = 1341653
-SHA256 (dmlc-rabit-4acdd7c6f68debe1c39ae07ca75466d74d194dd1_GH0.tar.gz) = 9e8bbdc04e504d7e7c98b9f683be5378cc5394405983d30737a14ca3dd43d449
-SIZE (dmlc-rabit-4acdd7c6f68debe1c39ae07ca75466d74d194dd1_GH0.tar.gz) = 94118
+TIMESTAMP = 1618948792
+SHA256 (dmlc-xgboost-v1.4.1_GH0.tar.gz) = 3464cb2463b25e8a6702129a2b3d1e270e28478369bd524d048d5c2422345a51
+SIZE (dmlc-xgboost-v1.4.1_GH0.tar.gz) = 1580682
+SHA256 (dmlc-rabit-f307ace_GH0.tar.gz) = de7592accfbef39bc147cd0df00fc4cfb7f12e184d414d057437c0567a63c1d4
+SIZE (dmlc-rabit-f307ace_GH0.tar.gz) = 94142
diff --git a/misc/py-xgboost/files/patch-CMakeLists.txt b/misc/py-xgboost/files/patch-CMakeLists.txt
index 87c993afdabb..d71345f99187 100644
--- a/misc/py-xgboost/files/patch-CMakeLists.txt
+++ b/misc/py-xgboost/files/patch-CMakeLists.txt
@@ -17,27 +17,3 @@
  if (MSVC)
    target_compile_options(dmlc PRIVATE
                           -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)
-@@ -144,10 +144,10 @@ if (MSVC)
-                            -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)
-   endif (TARGET dmlc_unit_tests)
- endif (MSVC)
--if (ENABLE_ALL_WARNINGS)
--  target_compile_options(dmlc PRIVATE -Wall -Wextra)
--endif (ENABLE_ALL_WARNINGS)
--target_link_libraries(objxgboost PUBLIC dmlc)
-+#if (ENABLE_ALL_WARNINGS)
-+#  target_compile_options(dmlc PRIVATE -Wall -Wextra)
-+#endif (ENABLE_ALL_WARNINGS)
-+#target_link_libraries(objxgboost PUBLIC dmlc)
- 
- # rabit
- set(RABIT_BUILD_DMLC OFF)
-@@ -202,7 +202,7 @@
- 
- #-- Hide all C++ symbols
- if (HIDE_CXX_SYMBOLS)
--  foreach(target objxgboost xgboost dmlc rabit rabit_mock_static)
-+  foreach(target objxgboost xgboost rabit rabit_mock_static)
-     set_target_properties(${target} PROPERTIES CXX_VISIBILITY_PRESET hidden)
-   endforeach()
- endif (HIDE_CXX_SYMBOLS)
diff --git a/misc/py-xgboost/files/patch-setup.py b/misc/py-xgboost/files/patch-setup.py
index a5f38829a045..99247ee24d23 100644
--- a/misc/py-xgboost/files/patch-setup.py
+++ b/misc/py-xgboost/files/patch-setup.py
@@ -1,6 +1,6 @@
---- setup.py.orig	2020-05-25 18:12:50 UTC
+--- setup.py.orig	2021-04-20 00:31:38 UTC
 +++ setup.py
-@@ -57,14 +57,14 @@ def copy_tree(src_dir, target_dir):
+@@ -60,14 +60,14 @@ def copy_tree(src_dir, target_dir):
  
      src = os.path.join(src_dir, 'src')
      inc = os.path.join(src_dir, 'include')
@@ -17,3 +17,21 @@
      clean_copy_tree(rabit, os.path.join(target_dir, 'rabit'))
      clean_copy_tree(cmake, os.path.join(target_dir, 'cmake'))
      clean_copy_tree(plugin, os.path.join(target_dir, 'plugin'))
+@@ -125,7 +125,7 @@ class BuildExt(build_ext.build_ext):  # pylint: disabl
+ 
+     def build_cmake_extension(self):
+         '''Configure and build using CMake'''
+-        if USER_OPTIONS['use-system-libxgboost'][2]:
++        if True or USER_OPTIONS['use-system-libxgboost'][2]: # see https://github.com/dmlc/xgboost/issues/6879
+             self.logger.info('Using system libxgboost.')
+             return
+ 
+@@ -217,7 +217,7 @@ class InstallLib(install_lib.install_lib):
+     def install(self):
+         outfiles = super().install()
+ 
+-        if USER_OPTIONS['use-system-libxgboost'][2] != 0:
++        if True or USER_OPTIONS['use-system-libxgboost'][2] != 0: # see https://github.com/dmlc/xgboost/issues/6879
+             self.logger.info('Using system libxgboost.')
+             lib_path = os.path.join(sys.prefix, 'lib')
+             msg = 'use-system-libxgboost is specified, but ' + lib_name() + \
diff --git a/misc/py-xgboost/files/patch-xgboost_libpath.py b/misc/py-xgboost/files/patch-xgboost_libpath.py
index 12916ce3222b..e3f94a08c138 100644
--- a/misc/py-xgboost/files/patch-xgboost_libpath.py
+++ b/misc/py-xgboost/files/patch-xgboost_libpath.py
@@ -1,14 +1,14 @@
---- xgboost/libpath.py.orig	2020-10-12 22:10:16 UTC
+--- xgboost/libpath.py.orig	2021-04-20 00:31:38 UTC
 +++ xgboost/libpath.py
-@@ -4,6 +4,7 @@
- import os
+@@ -5,6 +5,7 @@ import os
  import platform
+ from typing import List
  import sys
 +import sysconfig # from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247408#c0
  
  
  class XGBoostLibraryNotFound(Exception):
-@@ -20,6 +21,8 @@ def find_lib_path():
+@@ -21,6 +22,8 @@ def find_lib_path() -> List[str]:
      """
      curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
      dll_path = [



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104202047.13KKln8F031373>