public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: dev-python/lightgbm/, dev-python/lightgbm/files/
@ 2025-03-24 12:44 Nowa Ammerlaan
  0 siblings, 0 replies; only message in thread
From: Nowa Ammerlaan @ 2025-03-24 12:44 UTC (permalink / raw
  To: gentoo-commits

commit:     f4cb6c9c7238b7c6899bc65701350ea5f80c448a
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Fri Dec 13 06:41:27 2024 +0000
Commit:     Nowa Ammerlaan <nowa <AT> gentoo <DOT> org>
CommitDate: Mon Mar 24 12:43:45 2025 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=f4cb6c9c

dev-python/lightgbm: new package, add 4.5.0

Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Nowa Ammerlaan <nowa <AT> gentoo.org>

 .../lightgbm/files/lightgbm-4.5.0-loadlib.patch    | 14 ++++++++++
 dev-python/lightgbm/lightgbm-4.5.0.ebuild          | 30 ++++++++++++++++++++++
 dev-python/lightgbm/metadata.xml                   | 11 ++++++++
 3 files changed, 55 insertions(+)

diff --git a/dev-python/lightgbm/files/lightgbm-4.5.0-loadlib.patch b/dev-python/lightgbm/files/lightgbm-4.5.0-loadlib.patch
new file mode 100644
index 000000000..89fac71f0
--- /dev/null
+++ b/dev-python/lightgbm/files/lightgbm-4.5.0-loadlib.patch
@@ -0,0 +1,14 @@
+Index: lightgbm-4.5.0/lightgbm/basic.py
+===================================================================
+--- lightgbm-4.5.0.orig/lightgbm/basic.py
++++ lightgbm-4.5.0/lightgbm/basic.py
+@@ -261,8 +261,7 @@ def _log_callback(msg: bytes) -> None:
+ 
+ def _load_lib() -> ctypes.CDLL:
+     """Load LightGBM library."""
+-    lib_path = find_lib_path()
+-    lib = ctypes.cdll.LoadLibrary(lib_path[0])
++    lib = ctypes.cdll.LoadLibrary("lib_lightgbm.so")
+     lib.LGBM_GetLastError.restype = ctypes.c_char_p
+     callback = ctypes.CFUNCTYPE(None, ctypes.c_char_p)
+     lib.callback = callback(_log_callback)  # type: ignore[attr-defined]

diff --git a/dev-python/lightgbm/lightgbm-4.5.0.ebuild b/dev-python/lightgbm/lightgbm-4.5.0.ebuild
new file mode 100644
index 000000000..9d012f662
--- /dev/null
+++ b/dev-python/lightgbm/lightgbm-4.5.0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=scikit-build-core
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="LightGBM Python Package"
+HOMEPAGE="https://github.com/microsoft/LightGBM"
+SRC_URI="$(pypi_sdist_url "${PN^}" "${PV}")"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="dev-python/wheel[${PYTHON_USEDEP}]
+	dev-python/numpy[${PYTHON_USEDEP}]
+	dev-python/scipy[${PYTHON_USEDEP}]
+	dev-python/scikit-learn[${PYTHON_USEDEP}]
+	sci-libs/lightgbm"
+distutils_enable_tests pytest
+
+PATCHES=( "${FILESDIR}/${PN}-4.5.0-loadlib.patch" )
+
+python_compile() {
+	SKBUILD_WHEEL_CMAKE=false distutils-r1_python_compile
+}

diff --git a/dev-python/lightgbm/metadata.xml b/dev-python/lightgbm/metadata.xml
new file mode 100644
index 000000000..14d853470
--- /dev/null
+++ b/dev-python/lightgbm/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+  <maintainer type="person">
+    <email>heroxbd@gentoo.org</email>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">microsoft/LightGBM</remote-id>
+    <remote-id type="pypi">Lightgbm</remote-id>
+  </upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-24 12:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24 12:44 [gentoo-commits] proj/sci:master commit in: dev-python/lightgbm/, dev-python/lightgbm/files/ Nowa Ammerlaan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox