mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-17 19:13:13 -04:00
Merge updates from master
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
DIST esp-idf-5.3.2.zip 1900574501 BLAKE2B fa6937d0bc90ae8b3e6590bebbc1703b89c3e6467cf555256d68d5854d093f06cbbe0e8fe83f4afefe044cba1d8f1ff37b4dc08c1bcd0c50ceef76f1a13192cb SHA512 87be2eed9faab03d5da6c5fdecf19e7c59f1ad8b98ba8796c5070c20a286029d5162f48f4a24e623698bc410dbed6ef5476833362238e6508503408bf761af51
|
||||
DIST esp-idf-5.3.3.zip 1286860664 BLAKE2B b1d6f866bfa8d97580c6421b9412723d5e9978dc7c0630e3450aa15c8d5d5bbfc8c69e9df7a2ad8349e50bbbe9f3641b61a844d78a021effc04f06fb98cb08a7 SHA512 be790154d8877886725a500d054dcdf3b36a2a4fb1b48f9a8bba8c55885890151b93a15a62e9ff721ca7a008bb23dbe803e52ae33fa1c34d6a90d39f9692e473
|
||||
DIST esp-idf-5.4.1.zip 1235191686 BLAKE2B e29ce7dbf0783bcc2c549b240d4bad767adabca2f9ad6eb322ab8af3924becb29defffe97f792484a9f8bcd4a7ddc5ebd1ecf306d238c93e3d020df25c422530 SHA512 02e012bfe92f365151bef667588c93516abacf438c2687f05fd7db968b6efb6a4e3469031cf36771d6df5ceb5bef6202d6f205c9b1d537431fa39160ccf5497a
|
||||
DIST esp-idf-5.4.zip 1945165988 BLAKE2B ae91d8c4a3ae3190e6bbeaec2e26e89af053db77ac7f3c9d381713f14d1777b51a5e1b5e4b1f07d941f33e54f6df69fb26f6ad8d46b0520ce8d11b45521cb4a0 SHA512 c0fcd0e553a2845b4b4583f0ae2301c60cb456c177563c92cb6f76ad9c57a2055f607ccad647de9510b18487dc0b4f338cf8a17bd4b7459d087185533eafaae9
|
||||
DIST esp-idf-5.4.2.zip 1368863611 BLAKE2B 222a6fb0aef3ad4a15d06c56a188879549297816fe59473135af747aae73c0e87d1b191e4ffe1b54cdca1b4d588dc57f1a8c2f39f21bf1bbd154d84ddda690af SHA512 90b5b495015adc55be740e5cc462ad5020c0d2fd33378438f0b8032927d64f931fe537384c8f95168da5550c8989fa776524cb79903352391ab46c0d0b8606e6
|
||||
DIST openocd-esp32-linux-amd64-0.12.0-esp32-20241016.tar.gz 2398717 BLAKE2B 4550fb391e77c4eb09f88bc596f002de12a1c26e07af1d4e1a9efb25851facab39afc96a73d7c3f5c1bd8dc11963c6dc619d161741ee96cb2fb39c2b9bfbacd8 SHA512 bc72521e5c01090b1628d97a33adf336d32e4b451050abd056046672bb5d8bc0326db350d8c96390a11891d783d1223ff98ebef35e7299cc2f36dde9f0b466f8
|
||||
DIST openocd-esp32-linux-amd64-0.12.0-esp32-20250422.tar.gz 2445546 BLAKE2B 4f88b4215d2df2131c108f7acb87422462ba06cc2373e1d09dfd9fa127b9fab20dae5b1aa5b2a851c25ca903c396ae9ff5c6138831a20db3c5b3a27b9c3b39b7 SHA512 f9d70c8a8beaff8096ef5e01265ce9a17b96d9481727b72df33e86eba2e22d9fcfad865e4b7845d29b48ebb91d016b2ffffc913ef93922957719e44d2f881b36
|
||||
DIST riscv32-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.xz 145544808 BLAKE2B b55513bf4cd6526a438aa5460806f0886438a52932631f5d142bc9c5f0b0affcda7a830b2f9b13c83ed356a4cebd7e3e0c0b5c29e718e880d312b6aa2f61c5b2 SHA512 fb4c868877bd9e68bedceb816c1aeec1736e2876bc1adf3138d59b73f0e9b0fb14eb826c885749b6070e6cf1e8e794f0a53c85bf5c5c896d8b3a6c7e6d0d821b
|
||||
DIST riscv32-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.xz 298069324 BLAKE2B dea43004940ef825bca79fbd5f371a3891b8de78f7c145a72aa70228df8604ee482f520efc7dca79d363d68d55f136a6064111e7ea8287b616c9b25ffa7d0ef9 SHA512 7a426fb8cf820d65f0cb1eacf71250d63916222921b90dfd4d98a8064e854cf5fabce20c138a217186df7b04cd722ec23bc86a836956e27318f163c3ed05a188
|
||||
DIST riscv32-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz 30707431 BLAKE2B 99809fbd5abe99c4890fbf4edd964ee53bc9269b9bb15f487316d0092a9d7aae9d3f9f61f7597f5721aec4f95813908c8ce6a3f6f97cd453d1610a5caa7dc42e SHA512 1ad4854c53f435b08d634f8e5e1a9169037745684b13972876176483badc7ebf5a6c38109e7ac5c3f484df76e82bf790244661ac70b1e52dd3b2fc8a4956e5ff
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{11..13} )
|
||||
|
||||
PYTHON_GDB_USE=( python_targets_python3_{11,12} )
|
||||
VER="14.2.0_20241119"
|
||||
GDB_VER="14.2_20240403"
|
||||
OPENOCD_VER="0.12.0-esp32-20241016"
|
||||
OPENOCD_VER="0.12.0-esp32-20250422"
|
||||
|
||||
CROSSTOOL_URL="https://github.com/espressif/crosstool-NG/releases/download/esp-${VER}"
|
||||
|
||||
@@ -16,12 +16,12 @@ inherit estack optfeature python-r1
|
||||
DESCRIPTION="Espressif IoT Development Framework"
|
||||
HOMEPAGE="https://www.espressif.com/"
|
||||
|
||||
# See https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.3.txt for information about version dependencies
|
||||
# See https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.4.txt for information about version dependencies
|
||||
|
||||
SRC_URI="https://dl.espressif.com/github_assets/espressif/${PN}/releases/download/v${PV}/${PN}-v${PV}.zip -> ${P}.zip
|
||||
https://github.com/espressif/openocd-esp32/releases/download/v${OPENOCD_VER}/openocd-esp32-linux-amd64-${OPENOCD_VER}.tar.gz
|
||||
https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v${GDB_VER}/xtensa-esp-elf-gdb-${GDB_VER}-x86_64-linux-gnu.tar.gz"
|
||||
SRC_URI+=" ${CROSSTOOL_URL}/xtensa-esp-elf-${VER}-x86_64-linux-gnu.tar.xz"
|
||||
https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v${GDB_VER}/xtensa-esp-elf-gdb-${GDB_VER}-x86_64-linux-gnu.tar.gz
|
||||
${CROSSTOOL_URL}/xtensa-esp-elf-${VER}-x86_64-linux-gnu.tar.xz"
|
||||
SRC_URI+=" riscv32? (
|
||||
${CROSSTOOL_URL}/riscv32-esp-elf-${VER}-x86_64-linux-gnu.tar.xz
|
||||
https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v${GDB_VER}/riscv32-esp-elf-gdb-${GDB_VER}-x86_64-linux-gnu.tar.gz
|
||||
@@ -30,11 +30,14 @@ SRC_URI+=" riscv32? (
|
||||
S="${WORKDIR}/${PN}-v${PV}"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
SLOT="0/$(ver_cut 1-2)"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
IUSE="riscv32"
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
IUSE="python-gdb riscv32"
|
||||
REQUIRED_USE="
|
||||
python-gdb? ( || ( ${PYTHON_GDB_USE[@]} ) )
|
||||
${PYTHON_REQUIRED_USE}
|
||||
"
|
||||
|
||||
BDEPEND="app-arch/unzip"
|
||||
RDEPEND="
|
||||
@@ -123,6 +126,7 @@ install_tool() {
|
||||
eshopts_pop
|
||||
}
|
||||
|
||||
|
||||
src_install() {
|
||||
echo "v${PV}" > version.txt || die
|
||||
|
||||
@@ -146,6 +150,20 @@ EOF
|
||||
|
||||
# Remove unsupported python versions
|
||||
rm "${WORKDIR}"/xtensa-esp-elf-gdb/bin/xtensa-esp-elf-gdb-3.{8..10} || die
|
||||
if use riscv32; then
|
||||
rm "${WORKDIR}"/riscv32-esp-elf-gdb/bin/riscv32-esp-elf-gdb-3.{8..10} || die
|
||||
fi
|
||||
|
||||
# Remove disabled python versions
|
||||
for i in "${PYTHON_GDB_USE[@]}"; do
|
||||
if ! has "${i}" "${PYTHON_COMPAT[@]}"; then
|
||||
rm -f "${WORKDIR}"/xtensa-esp-elf-gdb/bin/xtensa-esp-elf-gdb-3."${i##*_}" || die
|
||||
if use riscv32; then
|
||||
rm -f "${WORKDIR}"/riscv32-esp-elf-gdb/bin/riscv32-esp-elf-gdb-3."${i##*_}" || die
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
install_tool xtensa-esp-elf-gdb
|
||||
if use riscv32; then
|
||||
install_tool riscv32-esp-elf-gdb
|
||||
@@ -6,6 +6,7 @@
|
||||
<name>David Roman</name>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="python-gdb">Enable python-dependent gdb for Xtensa and riscv32</flag>
|
||||
<flag name="riscv32">Enable support for riscv32</flag>
|
||||
</use>
|
||||
<upstream>
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
DIST librepo-1.18.1.tar.gz 841526 BLAKE2B 62860d29df4a7288802098f866a17862dd803ffdf58dd78f0dbcb439ee04f8713e644c17e75bb273dccc461c6b654c5092fcc81eecc1119ff302a8d548ee680e SHA512 bc5ef06786f3bd10bc096fa72543be2f528388e1490de6dc95e78c5f0f81511d24346a0fd55a37e844f7ea2864dd53d2ae921e767cd6f721b2c0a7fb6c9ab9f7
|
||||
DIST librepo-1.19.0.tar.gz 841780 BLAKE2B 01689cc356a946c61d2018e892d60436fcb7fed02965bb1c48864f6b1735741039e02d4d2471d7659c9dcf0cece5c3b2fdeba8f0696aa1c560cb837fbd2967a5 SHA512 dd6c0cc69a3fa7324e0753b260a394a0ac5587ca73a6d5d567c63e92ced0d71b35b48db573130cfcce2b6bd582fe486f40ca3299439742f0287778f613195e2d
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
# Copyright 2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit cmake
|
||||
|
||||
DESCRIPTION="Repodata downloading library"
|
||||
HOMEPAGE="https://github.com/rpm-software-management/librepo"
|
||||
SRC_URI="https://github.com/rpm-software-management/librepo/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="LGPL-2.1+"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE="doc gpgme test +zchunk"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
>=dev-libs/glib-2.66:2
|
||||
dev-libs/libxml2
|
||||
dev-libs/openssl:=
|
||||
>=net-misc/curl-7.52.0
|
||||
gpgme? ( app-crypt/gpgme:1= )
|
||||
!gpgme? ( >=app-arch/rpm-4.18.0 )
|
||||
zchunk? ( >=app-arch/zchunk-0.9.11 )
|
||||
"
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="
|
||||
virtual/pkgconfig
|
||||
doc? ( app-text/doxygen )
|
||||
test? ( dev-libs/check )
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
# getxattr does not seem to work well under QA box. bug #934951
|
||||
"${FILESDIR}/${PN}-1.18.0-disable-checksum-test.patch"
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
cmake_src_prepare
|
||||
|
||||
# respect temp directory during tests, bug #924463
|
||||
sed -i "s|/tmp/|${T}/|" tests/testsys.h || die
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DENABLE_EXAMPLES=OFF
|
||||
-DENABLE_PYTHON=OFF
|
||||
-DENABLE_SELINUX=OFF
|
||||
-DUSE_GPGME=$(usex gpgme)
|
||||
-DENABLE_DOCS=$(usex doc)
|
||||
-DENABLE_TESTS=$(usex test)
|
||||
-DWITH_ZCHUNK=$(usex zchunk)
|
||||
)
|
||||
cmake_src_configure
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
DIST dateparser-1.2.1.tar.gz 309924 BLAKE2B 09b7cf4148edea37bb80d1734b2f5a3ddac7965e6d46bc1775f2f0807d3421c80bd3927dd62135a80adc99451a85a2961b61335784d191cfdd1fdc51b3d81298 SHA512 85e1c5cabb8acebd63ec60c0913ac89b362b64edfbe5af06bcd5968ed7be6383d4035ec9f45afadc0d10fc95a3f538702285d75365c4f8e4522ac9643f4ed4da
|
||||
DIST dateparser-1.2.2.tar.gz 329840 BLAKE2B 7f17feb402cd72d6b99c1c5e75627588e085963193aef72eaaeada82ea448d5d45c19d3aa5b8986500cecbc7b2417c9fc5f8526de47560455a6e9f12b2e500f1 SHA512 96ebc214843f57f3cdede79f63fd3067e9b26e17882a0dea023830e7a2a3f50b07145ae34d174bd3cd11f4f42980110111f90e7175fd38a4b0c428ac5f26428d
|
||||
|
||||
61
dev-python/dateparser/dateparser-1.2.2.ebuild
Normal file
61
dev-python/dateparser/dateparser-1.2.2.ebuild
Normal file
@@ -0,0 +1,61 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{11..13} )
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
inherit distutils-r1 optfeature pypi
|
||||
|
||||
DESCRIPTION="Date parsing library designed to parse dates from HTML pages"
|
||||
HOMEPAGE="
|
||||
https://pypi.org/project/dateparser/
|
||||
https://github.com/scrapinghub/dateparser
|
||||
"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
RDEPEND="
|
||||
dev-python/python-dateutil[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
dev-python/regex[${PYTHON_USEDEP}]
|
||||
dev-python/tzlocal[${PYTHON_USEDEP}]
|
||||
"
|
||||
BDEPEND="test? (
|
||||
dev-libs/fastText[python,${PYTHON_USEDEP}]
|
||||
dev-python/convertdate[${PYTHON_USEDEP}]
|
||||
dev-python/hijridate[${PYTHON_USEDEP}]
|
||||
dev-python/langdetect[${PYTHON_USEDEP}]
|
||||
dev-python/parameterized[${PYTHON_USEDEP}]
|
||||
)"
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
distutils_enable_sphinx docs \
|
||||
dev-python/sphinx-rtd-theme
|
||||
|
||||
python_test() {
|
||||
# Need to set TZ when testing with gentoo docker images.
|
||||
# Their /etc/{timezone,localtime} are inconsistent, which causes
|
||||
# to tests to fail.
|
||||
local -x TZ=UTC
|
||||
|
||||
local EPYTEST_IGNORE=(
|
||||
# tests that require network
|
||||
tests/test_dateparser_data_integrity.py
|
||||
)
|
||||
local EPYTEST_DESELECT=(
|
||||
# tests that require network
|
||||
tests/test_language_detect.py::CustomLangDetectParserTest::test_custom_language_detect_fast_text_{0,1}
|
||||
)
|
||||
|
||||
epytest
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
optfeature "calendars support" "dev-python/hijridate dev-python/convertdate"
|
||||
optfeature "fasttext support" "dev-libs/fastText[python]"
|
||||
optfeature "langdetect support" dev-python/langdetect
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
DIST fastapi-0.115.12.tar.gz 295236 BLAKE2B 224b74553668721dde3592a50a3d5b02a967a58f55d3beb6bec753755cddfbb803f0661ce6cc41af3ddfc28bb304d053f41aad8ab9d8965048ff80cad6c3207e SHA512 8eb8d998643ca748744b9c00e14cdd62f02e58145e2a64dcf090361d56fa52a12b643b8fc3dc98f41af74c06d46b787acf92ae2be828d99b6d4290c20ced7f6f
|
||||
DIST fastapi-0.115.13.tar.gz 295680 BLAKE2B 04fa6fec81e25045f6e6601dc6207973fa4afe7b2fe6ebd27645a48f5b6f0a30758581dba947972fbcfb62e6e5dcf119c03f007c9f31ddc80236f1ea7e39d453 SHA512 0c337265d118ce86e1800251caba4f55ece9c8262870000cf5b3b36f21467079043377a136c1c5aa17f96b724c3633cc600c96093192ced7a2ffa18eba7c8171
|
||||
DIST fastapi-0.115.14.tar.gz 296263 BLAKE2B 196cf0043d43b9b03b24198c9c001e1fcd9a37ba608ae0190908024dfb0cff2789f85a8a1b5f9b61f66101df5b28c701638e15f414e446b5a57b64d482d52b9e SHA512 48831b78c6a4738b02ba32327d4cef251e776126180b265877fcf3bab3d7631dbb20434b63c5845781d3dae495cce9fb12ee59e35edc656c8806efbddbfc0e53
|
||||
|
||||
@@ -60,7 +60,7 @@ BDEPEND="
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.115.6-httpx-0.28-test-fix.patch"
|
||||
"${FILESDIR}/${PN}-0.115.12-starlette-0.48.0.patch"
|
||||
"${FILESDIR}/${PN}-0.115.14-starlette-bump.patch"
|
||||
)
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
@@ -6,7 +6,7 @@ EAPI=8
|
||||
DISTUTILS_USE_PEP517=pdm-backend
|
||||
PYTHON_COMPAT=( python3_{12..13} )
|
||||
|
||||
inherit distutils-r1 optfeature pypi
|
||||
inherit distutils-r1 optfeature
|
||||
|
||||
DESCRIPTION="FastAPI framework, high performance, easy to learn, ready for production"
|
||||
HOMEPAGE="
|
||||
@@ -15,9 +15,16 @@ HOMEPAGE="
|
||||
https://github.com/fastapi/fastapi
|
||||
"
|
||||
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/fastapi/fastapi.git"
|
||||
else
|
||||
inherit pypi
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
RDEPEND="
|
||||
<dev-python/pydantic-3.0.0[${PYTHON_USEDEP}]
|
||||
@@ -30,10 +37,11 @@ BDEPEND="
|
||||
test? (
|
||||
dev-python/aiosqlite[${PYTHON_USEDEP}]
|
||||
>=dev-python/anyio-3.2.1[${PYTHON_USEDEP}]
|
||||
dev-python/bcrypt[${PYTHON_USEDEP}]
|
||||
dev-python/dirty-equals[${PYTHON_USEDEP}]
|
||||
dev-python/email-validator[${PYTHON_USEDEP}]
|
||||
>=dev-python/flask-1.1.2[${PYTHON_USEDEP}]
|
||||
dev-python/inline-snapshot[${PYTHON_USEDEP}]
|
||||
>=dev-python/inline-snapshot-0.21.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/jinja2-3.1.5[${PYTHON_USEDEP}]
|
||||
dev-python/orjson[${PYTHON_USEDEP}]
|
||||
<dev-python/passlib-2.0.0[${PYTHON_USEDEP}]
|
||||
@@ -52,7 +60,7 @@ BDEPEND="
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.115.6-httpx-0.28-test-fix.patch"
|
||||
"${FILESDIR}/${PN}-0.115.12-starlette-0.48.0.patch"
|
||||
"${FILESDIR}/${PN}-0.115.14-starlette-bump.patch"
|
||||
)
|
||||
|
||||
distutils_enable_tests pytest
|
||||
@@ -63,6 +71,8 @@ EPYTEST_DESELECT=(
|
||||
# Test result affected by unrelated packages such as brotli and zstd
|
||||
# https://github.com/fastapi/fastapi/blob/7c6f2f8fde68f488163376c9e92a59d46c491298/tests/test_tutorial/test_header_param_models/test_tutorial001.py#L77
|
||||
"tests/test_tutorial/test_header_param_models/test_tutorial001.py::test_header_param_model_invalid"
|
||||
"tests/test_tutorial/test_header_param_models/test_tutorial003.py::test_header_param_model_invalid"
|
||||
"tests/test_tutorial/test_header_param_models/test_tutorial003.py::test_header_param_model_no_underscore"
|
||||
# https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6afa196ca0cb1604875847b1b84fa64896a06f6e
|
||||
"tests/test_multipart_installation.py::test_incorrect_multipart_installed_form"
|
||||
"tests/test_multipart_installation.py::test_incorrect_multipart_installed_file_upload"
|
||||
@@ -75,10 +85,9 @@ EPYTEST_DESELECT=(
|
||||
"tests/test_multipart_installation.py::test_no_multipart_installed_multi_form"
|
||||
"tests/test_multipart_installation.py::test_no_multipart_installed_form_file"
|
||||
"tests/test_multipart_installation.py::test_old_multipart_installed"
|
||||
# Hangs with network-sandbox
|
||||
"tests/test_tutorial/test_websockets/test_tutorial003_py39.py::test_websocket_handle_disconnection"
|
||||
|
||||
# formatting changes?
|
||||
"tests/test_tutorial/test_header_param_models/test_tutorial003.py::test_header_param_model_no_underscore"
|
||||
"tests/test_tutorial/test_header_param_models/test_tutorial003.py::test_header_param_model_invalid"
|
||||
)
|
||||
|
||||
python_prepare_all() {
|
||||
@@ -1,3 +1,5 @@
|
||||
https://github.com/fastapi/fastapi/pull/13743
|
||||
|
||||
From 037aff6a9c4e3ea94d9312f734efd79220ac94d2 Mon Sep 17 00:00:00 2001
|
||||
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
|
||||
Date: Thu, 29 May 2025 13:25:06 -0400
|
||||
@@ -7,12 +9,6 @@ MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
pyproject.toml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/pyproject.toml b/pyproject.toml
|
||||
index 1c540e2f63b66..a0fe805cdb3b3 100644
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -43,7 +43,7 @@ classifiers = [
|
||||
@@ -1,2 +1,2 @@
|
||||
DIST pysdl3-0.9.8b2.tar.gz 1419685 BLAKE2B fcc5ceeeb78cdc45ceb8e35ed7e420375ff0ebd7cbbae23dd68718e5417be727aef179760f2f22841966c3e43aff87a20e7b4fb140baad19e62443f505ff312d SHA512 8c2548baa173302ca5ff6e3a2c47d71af3e9b3c8d5c31d6848dd2f734acbb05a765b489a66a83e20d412621155c7fee7dc8618a20bcbd715299e75596ca08fa4
|
||||
DIST pysdl3-0.9.8b3.tar.gz 1416965 BLAKE2B d8eed631739051045998f5c0be78ea47f83338077c9024322fb9ac5ed1331b9c6e36dfff02402da0a5d4dd5139627afa2e17b2e239727438b5a291beaa60bf17 SHA512 680153060e479560db0ffb32cb5a76a951f0b784fc1a805999ae7ac03dec3f3e6797f5361b94ec00b87c692a4c6c63ee994f94a98cb73491036574f15145b837
|
||||
DIST pysdl3-0.9.8b5.tar.gz 1416932 BLAKE2B c8de2c87d77a741e75dfdf10adde2ddedfa161661202bbdcc40440a2cfb9f2dab94ff405a2a9a8eb97c13883620063967c3fdc6bda2ca219b58e1ec6ecab94fb SHA512 7c3471def81967a80da19d5aad69f38b22179889c1303dc609ad44b831945bb583f3ea0c5ef7159e66900810f42863fdaa1f63fe6d7935b438ca1acb9044e540
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
DIST FFXIVQuickLauncher-cdde1fbeb31549dea13bd015e76b0b3964543c12.tar.gz 5282837 BLAKE2B ec46127c91bd5490fc7f0dcdfe0aea357654d896b09b4ccbffba0047d9b6c4b0d9b901d4940a1a3607c2009cf285faee1e0230d493c1cb5adbff90a4b593fa3f SHA512 ac30a0edf808b21b2e347d3b9245c359909c28a3d535927900b54849e68f7347d7b12ce198099022f053a74aaa9f90b465e11cdc9ecec7e07c3a5801e8897f3a
|
||||
DIST FFXIVQuickLauncher-5ea1ee9c87b9542aaf8b1739ddf869960a5c007f.tar.gz 5283113 BLAKE2B 3453c426fa57b2464c97f8087686fee230f90a726d913c4bbb70bca5004de2fea7caa679f39ccf7f5a3b81a9e429cbddfaccf98ca73b6dd4830bea184ecf5ff8 SHA512 9a28dab98c1bf37082d11380a6dcfece0084169258c61f7d8e37271a85b2748a0563b89667cc61302c5e19cc0f8817d8c5649406b0186a94c977ecceaa2601b7
|
||||
DIST castle.core.4.4.1.nupkg 919111 BLAKE2B 5ee1245ef79f00b89fd03957b260337b4af242667c10cd9189540853344d062e27dee224989ef6a29544083f9a8416a197b9d97ba38ee1ace4630e89893355e7 SHA512 b27c340df07622abda8543a48c057eb936c9b02b7ed2d6f58e09e33bd5a5f70c7a2ee867127a05697e5a4127ba40494a17ea40080482578328aa8a33ae97aa3a
|
||||
DIST cheaploc.1.1.6.nupkg 17585 BLAKE2B 1ed77a02342449f2b20fc97f0dfca7122637beb9f5f08854dc3d6c4f3676340686e49ac46173945f90dc56e7f41bc719d1976b5b4e61f1b25ced0b94cdb6a29d SHA512 ff2d6e19a08b54d288eced17cafe2dca9943bc7b0fab131c477f9ce7d8390762b11949228bc4193e661490432828ea8596ccb3d0d01ce2e990c346caa4cbb8fa
|
||||
DIST commandlineparser.2.9.1.nupkg 496069 BLAKE2B e2c4b38841f83d6bc10432b8055af90369f1fe0a10105a58b51b44cd48e5d84cb0b5e4b19f444d8c81b38646a62c7c4d11cbd710e92fea68be3ebea6ab98e3f1 SHA512 4f364e45c9668c7e7cc6a922b488f3fa523033c20d7a432694f0a6af05ce528ea0481d8375e2f4f1032c6990347b4803ce9a0e48068c6fe15ec46fb1254f085d
|
||||
@@ -227,4 +227,4 @@ DIST vortice.direct3d11.2.3.0.nupkg 1000170 BLAKE2B 3cb6882ff784a72f887265ce366e
|
||||
DIST vortice.directx.2.3.0.nupkg 1123600 BLAKE2B 4af31197c9056e95d1ad3f860696637150ea950665a76efb6365b39b11b4b4d1cf6480ac8df82e945b0c5b187135f6e2bd22f1295a7b230a94d881d9c1d59af7 SHA512 3366ab9156a17cc0389fb7948f8385783672cedc30f03f13fff53ef6ab1678af61f560919e6ac50387c44b6722414f6986d55435791c4dd1d29a6e80f08b21a1
|
||||
DIST vortice.dxgi.2.3.0.nupkg 339067 BLAKE2B 63a8f23f3a5a29b7b68c5429005c3ca0d623b8122d0b1fbd9ec9715cc78283df3951ebeed624d98ca2032ffcd3361f8d944c68176fff40800936c044e8ebe1c0 SHA512 adaad404537114fd3092817419680b78e1cfca01c7b3e0941f98071dbefad4160355d868f63ccf7187d4e6b4b7341fd01f406d9ff0de23f9676af4afb62dd31f
|
||||
DIST vortice.mathematics.1.4.25.nupkg 360426 BLAKE2B 31780297d1e2e5bcdae92f34a93982c63bcf42ebbbb5ac848c4fbaea6d9340724ae83826fa20d0b1e82456f1f66d0332dd2e85f5f623d03fb53b5d4b7d6eb86b SHA512 4721b4514028384405e213a33b152a2760794e62d62f7078352486d43636f428c8a815d18d02f4cdca6168ef44898da85ec55760b25f240f0c074e3ea978f0db
|
||||
DIST xivlauncher-1.1.2.tar.gz 18020812 BLAKE2B 7687aa5ca13bd87790443368ebf6cc87362fbfa959302b5fb3ccaf9264c4c3a08134729615f320ca6a01494946142b28f71356669e031335c0ecb1373ba957f0 SHA512 adb6f2a17c3ab65d8d60d9ce640b8ec58c4eb63ab5baf629fe84c7df62c29c6a716f6079dbc50b58ffcede7352a686b13d4441ff75dd5bfc84f31a9fb4e261c2
|
||||
DIST xivlauncher-1.2.1.tar.gz 18024523 BLAKE2B 27433a81982a53b04015b87f02068406137a412cc5fe95e1abc0bd41367ad26de103cb777faebc8df9fae8066dde821e363bdd0549cd9fe5188c0ffb86c4cc5e SHA512 a92ea9286c7a3e186665efa2b6cdb60408ee8659f8c13deb21b0d3266248a32f2396d009d7403499921aeb64f4102cf022c94ae5eb7ee28fda89fc6470098383
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
DOTNET_PKG_COMPAT="8.0"
|
||||
DOTNET_PKG_COMPAT="9.0"
|
||||
NUGETS="
|
||||
castle.core@4.4.1
|
||||
cheaploc@1.1.6
|
||||
@@ -237,7 +237,7 @@ vortice.mathematics@1.4.25
|
||||
|
||||
inherit dotnet-pkg desktop xdg
|
||||
|
||||
XIVQL_COMMIT="cdde1fbeb31549dea13bd015e76b0b3964543c12"
|
||||
XIVQL_COMMIT="5ea1ee9c87b9542aaf8b1739ddf869960a5c007f"
|
||||
|
||||
DESCRIPTION="Custom Launcher for Final Fantasy XIV Online (Crossplatform rewrite)"
|
||||
HOMEPAGE="https://github.com/goatcorp/XIVLauncher.Core/"
|
||||
@@ -4,7 +4,7 @@
|
||||
EAPI=8
|
||||
|
||||
MPV_REQ_USE="lua"
|
||||
PYTHON_COMPAT=( python3_{11..12} )
|
||||
PYTHON_COMPAT=( python3_{11..13} )
|
||||
inherit mpv-plugin python-any-r1
|
||||
|
||||
DESCRIPTION="A Lua script to show preview thumbnails in mpv's OSC seekbar"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
EAPI=8
|
||||
|
||||
MPV_REQ_USE="lua"
|
||||
PYTHON_COMPAT=( python3_{11..12} )
|
||||
PYTHON_COMPAT=( python3_{11..13} )
|
||||
inherit mpv-plugin python-any-r1
|
||||
|
||||
DESCRIPTION="A Lua script to show preview thumbnails in mpv's OSC seekbar"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
EAPI=8
|
||||
|
||||
MPV_REQ_USE="lua"
|
||||
PYTHON_COMPAT=( python3_{11..12} )
|
||||
PYTHON_COMPAT=( python3_{11..13} )
|
||||
inherit mpv-plugin python-any-r1
|
||||
|
||||
DESCRIPTION="A Lua script to show preview thumbnails in mpv's OSC seekbar"
|
||||
|
||||
@@ -1,12 +1,2 @@
|
||||
DIST ollama-0.7.1-vendor.tar.xz 4410404 BLAKE2B 5174658814f562ed2d57e4af911231c8a4e98b4059602d616330c38e8729282a79aaed61b4325e48ed9d1c7afec94f6427ddaf697ea016b5efc40cd91c3149b9 SHA512 9e708606098cea14abf59285fc4d477bbc2e3fcb6fb95c83ca45f090ef5a8e10d5f17c7f07d568d9b12da1751359b0e20b14b7e69b50e9f9df9c0a39a4b5796e
|
||||
DIST ollama-0.7.1.gh.tar.gz 8359685 BLAKE2B 43a6cbd3d5af6f25fa85263d02573ac843d11e22ffe1dfd16f8129ea4f64b806b37defbaee10e940ddffe4289e949316f135cdbcf9c94d302ff6864d2c904557 SHA512 58f8fcbd65a3457d0bae1106589cb585ef4afca7e637458a538fc21dd402a4b7ad1a0a99979abda330a65dcac238729eff8d0708fa3085554a9af81f70fbd015
|
||||
DIST ollama-0.8.0-vendor.tar.xz 4407120 BLAKE2B db48867f9cbb01fff84d79c278bae4c3e6d069f28153fcdeaf0c74a7ecc0bb75d1d4027a0d08b21fe1c1d9b8d1fbaf55fb3c450415d208d20823a577bb739be2 SHA512 8ff8442bcf5fc84f66f39b2208b9b1c3cd7f33df5ce76d1dd1ae0676b95c543407ee08a7258e7c70fff519eb3a22eb5378e04187ebc9d0806868bd51fd060e75
|
||||
DIST ollama-0.8.0.gh.tar.gz 8345667 BLAKE2B d04b498ef5e108e6740d7c79efd1e100bf8cf004f736d31964318b9fe3f5860b91e221488e24e07abe2f28668c0d04aa333b9a5829957eaaeb7c00078f76e2c4 SHA512 c5a45fb86ec8472fe27dd2e4f3f597a7bfb5fa4a954332b4cde3ffa961feb8983ffeeec213bd2e59a02896dba683e9462572bb4a1b0e931e67adca3120a0b830
|
||||
DIST ollama-0.9.0-vendor.tar.xz 4412428 BLAKE2B 8d84c7020d350cf6aaf67216ef37be69676ca781b30ab8768d36776b19e7b988a662cf34bbebd514809c91f9e81bd6fb2c1e2b17f4fb668cc25e261553597dfd SHA512 7127e2e7fc3e9a13f3b6e0124c5ab8f41f4444a4b5ba30bef24d0c6b7caa52db9840e11133ff09850094997f88c6c6ca9cadf17b5129c65b295f4c34594d37d3
|
||||
DIST ollama-0.9.0.gh.tar.gz 8353746 BLAKE2B 14b685fdc017c0a0485917d3690430e5205366de94291623f07cb3b9c9862ba96894b62ba4798876f841cb3a3ee7497dbae71b253bfb513556bdfc9153deb45c SHA512 32ef42663ea831556fa033bc03a481d103f09e8f5c16f611b3f2308ae80c81daec924192800a2f7c22f70ac86c5440377f892a88cce522223cbbdff793114091
|
||||
DIST ollama-0.9.1-vendor.tar.xz 4414480 BLAKE2B 60854edfd5f4a0abb674bb4a430694f4a51fae75cfdda268fd0589cc73f467bc6f2fb1fc451c009627818909fa79539f101654069f86583a5457a9e243413f51 SHA512 1b4bc511a74289ccff9940c6a11fab48205d46f2bbbaae028a64476353ff204038703143c5e3207e5dbfc4a27160806e47564728282d8b47030d7303654263b1
|
||||
DIST ollama-0.9.1.gh.tar.gz 8358070 BLAKE2B 601b93e38247046ad958b332caac074a78554c97cbac93cf3b2eff87f4353d901cc3c807e597a4b217e20aaa2982ec0be6c80e2825ffa87061ad926bcf393f55 SHA512 dffc3da4f2b0c5b50c195a98c1ab8ace049f61536297658cb1ac8dc90a35cd0402e92f61aa11b5283791a5c2e7ac6756b9232a9713d30aee4d7cc24fa2a577e3
|
||||
DIST ollama-0.9.2-vendor.tar.xz 4408288 BLAKE2B 704b11317733e10d95f4782a86d7762bb259b20cd1cf879385f236824cfe2378b617bf96ca455d018d4a4dea84db2165459e8015aa6c320bdaf1aea1de0fb9f9 SHA512 4dd32d6c67bafa05db47a0bcc4a7852b5fbd8776acde470bdd524a4772d312a3724778025011ea85135184229b0eac89ccfe4c2323bc02d218686a3497949400
|
||||
DIST ollama-0.9.2.gh.tar.gz 8351627 BLAKE2B 84aba6436304260a5743d43eb3c74d48dc3b3168679db26ecb76c25ec78c517bb4d9318eba166e2e2053e6d444d06d3798849f5fe1de53851b01607d18aaeb59 SHA512 a68c581af7a7ea7a2193165773a9e5f1d832ab53e6e5f9f1786d530deab4c7a1e01b39cb1b2775f8415b3e9556991b6cf3e1e2a1066d1070d3ae500433217a33
|
||||
DIST ollama-0.9.3-vendor.tar.xz 4498620 BLAKE2B f064eb1fc8d226fa1cb916bdc0bb161d342bf2b33658d2328d0b38f338e26ed9e1ea3eccbb0c8f484f81974f58545623bad15352f17a6aed8bc37d14ba7dabb0 SHA512 e010082df3b6808e4347bf22e8e9d9ecec916e62c4205308cb351ecfde6cf1f52c7a97f369e08c198ebd9f80b3568f740aac6948e9e572a35564eaaa4dc054ce
|
||||
DIST ollama-0.9.3.gh.tar.gz 8397536 BLAKE2B 296cf7916bd5dc222d42ebb7e946f50b6008662e09b197e33475d6b024d7311758d443a7930e737a8b72f47db5c3d1312117c40fc9bac776dc9e7faf42c90eb4 SHA512 981d2d1369cd931de1f856cf071de5575f3a14f9b05631f78b6aae4bb127cc544fce8ef2ee8d72ace921acada75e91e7a667d0369a36738775b3fe20704f6122
|
||||
|
||||
@@ -1,308 +0,0 @@
|
||||
# Copyright 2024-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# supports ROCM/HIP >=5.5, but we define 6.1 due to the eclass
|
||||
ROCM_VERSION=6.1
|
||||
inherit cuda rocm
|
||||
inherit cmake
|
||||
inherit go-module systemd toolchain-funcs
|
||||
|
||||
DESCRIPTION="Get up and running with Llama 3, Mistral, Gemma, and other language models."
|
||||
HOMEPAGE="https://ollama.com"
|
||||
|
||||
if [[ ${PV} == *9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/ollama/ollama.git"
|
||||
else
|
||||
SRC_URI="
|
||||
https://github.com/ollama/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
|
||||
https://github.com/negril/gentoo-overlay-vendored/raw/refs/heads/blobs/${P}-vendor.tar.xz
|
||||
"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
|
||||
X86_CPU_FLAGS=(
|
||||
sse4_2
|
||||
avx
|
||||
f16c
|
||||
avx2
|
||||
bmi2
|
||||
fma3
|
||||
avx512f
|
||||
avx512vbmi
|
||||
avx512_vnni
|
||||
avx_vnni
|
||||
)
|
||||
CPU_FLAGS=( "${X86_CPU_FLAGS[@]/#/cpu_flags_x86_}" )
|
||||
IUSE="${CPU_FLAGS[*]} cuda blas mkl rocm"
|
||||
# IUSE+=" opencl vulkan"
|
||||
|
||||
RESTRICT="test"
|
||||
|
||||
COMMON_DEPEND="
|
||||
cuda? (
|
||||
dev-util/nvidia-cuda-toolkit:=
|
||||
)
|
||||
blas? (
|
||||
!mkl? (
|
||||
virtual/blas
|
||||
)
|
||||
mkl? (
|
||||
sci-libs/mkl
|
||||
)
|
||||
)
|
||||
rocm? (
|
||||
>=sci-libs/hipBLAS-5.5:=[${ROCM_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${COMMON_DEPEND}
|
||||
>=dev-lang/go-1.23.4
|
||||
"
|
||||
|
||||
RDEPEND="
|
||||
${COMMON_DEPEND}
|
||||
acct-group/${PN}
|
||||
>=acct-user/${PN}-3[cuda?]
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.6.3-use-GNUInstallDirs.patch"
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
if use amd64; then
|
||||
if use cpu_flags_x86_f16c && use cpu_flags_x86_avx2 && use cpu_flags_x86_fma3 && ! use cpu_flags_x86_bmi2; then
|
||||
ewarn
|
||||
ewarn "CPU_FLAGS_X86: bmi2 not enabled."
|
||||
ewarn " Not building haswell runner."
|
||||
ewarn " Not building skylakex runner."
|
||||
ewarn " Not building icelake runner."
|
||||
ewarn " Not building alderlake runner."
|
||||
ewarn
|
||||
if grep bmi2 /proc/cpuinfo > /dev/null; then
|
||||
ewarn "bmi2 found in /proc/cpuinfo"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ "${PV}" == *9999* ]]; then
|
||||
git-r3_src_unpack
|
||||
go-module_live_vendor
|
||||
else
|
||||
go-module_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
cmake_src_prepare
|
||||
|
||||
sed \
|
||||
-e "/set(GGML_CCACHE/s/ON/OFF/g" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*cu/d" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*hip/d" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/ -O3//g" \
|
||||
-i ml/backend/ggml/ggml/src/ggml-cpu/cpu.go || die sed
|
||||
|
||||
# fix library location
|
||||
sed \
|
||||
-e "s#lib/ollama#$(get_libdir)/ollama#g" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/\"..\", \"lib\"/\"..\", \"$(get_libdir)\"/" \
|
||||
-e "s#\"lib/ollama\"#\"$(get_libdir)/ollama\"#" \
|
||||
-i \
|
||||
ml/backend/ggml/ggml/src/ggml.go \
|
||||
discover/path.go \
|
||||
|| die
|
||||
|
||||
if use amd64; then
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sse42/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sandybridge/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(haswell/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(skylakex/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f ||
|
||||
! use cpu_flags_x86_avx512vbmi ||
|
||||
! use cpu_flags_x86_avx512_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(icelake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512 AVX512_VBMI AVX512_VNNI)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(alderlake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX_VNNI)
|
||||
fi
|
||||
|
||||
# ml/backend/ggml/ggml/src/CMakeLists.txt
|
||||
fi
|
||||
|
||||
# default
|
||||
# return
|
||||
if use cuda; then
|
||||
cuda_src_prepare
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
# --hip-version gets appended to the compile flags which isn't a known flag.
|
||||
# This causes rocm builds to fail because -Wunused-command-line-argument is turned on.
|
||||
# Use nuclear option to fix this.
|
||||
# Disable -Werror's from go modules.
|
||||
find "${S}" -name ".go" -exec sed -i "s/ -Werror / /g" {} + || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DGGML_CCACHE="no"
|
||||
|
||||
# -DGGML_CPU="yes"
|
||||
-DGGML_BLAS="$(usex blas)"
|
||||
# -DGGML_CUDA="$(usex cuda)"
|
||||
# -DGGML_HIP="$(usex rocm)"
|
||||
|
||||
# -DGGML_METAL="yes" # apple
|
||||
# missing from ml/backend/ggml/ggml/src/
|
||||
# -DGGML_CANN="yes"
|
||||
# -DGGML_MUSA="yes"
|
||||
# -DGGML_RPC="yes"
|
||||
# -DGGML_SYCL="yes"
|
||||
# -DGGML_KOMPUTE="$(usex kompute)"
|
||||
# -DGGML_OPENCL="$(usex opencl)"
|
||||
# -DGGML_VULKAN="$(usex vulkan)"
|
||||
)
|
||||
|
||||
if use blas; then
|
||||
if use mkl; then
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Intel"
|
||||
)
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Generic"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
if use cuda; then
|
||||
local -x CUDAHOSTCXX CUDAHOSTLD
|
||||
CUDAHOSTCXX="$(cuda_gccdir)"
|
||||
CUDAHOSTLD="$(tc-getCXX)"
|
||||
|
||||
cuda_add_sandbox -w
|
||||
addpredict "/dev/char/"
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_CUDA_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_ARCHITECTURES="$(get_amdgpu_flags)"
|
||||
-DCMAKE_HIP_PLATFORM="amd"
|
||||
# ollama doesn't honor the default cmake options
|
||||
-DAMDGPU_TARGETS="$(get_amdgpu_flags)"
|
||||
)
|
||||
|
||||
local -x HIP_PATH="${ESYSROOT}/usr"
|
||||
|
||||
check_amdgpu
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
ego build
|
||||
|
||||
cmake_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin ollama
|
||||
|
||||
cmake_src_install
|
||||
|
||||
newinitd "${FILESDIR}/ollama.init" "${PN}"
|
||||
newconfd "${FILESDIR}/ollama.confd" "${PN}"
|
||||
|
||||
systemd_dounit "${FILESDIR}/ollama.service"
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
keepdir /var/log/ollama
|
||||
fperms 750 /var/log/ollama
|
||||
fowners "${PN}:${PN}" /var/log/ollama
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ -z ${REPLACING_VERSIONS} ]] ; then
|
||||
einfo "Quick guide:"
|
||||
einfo "\tollama serve"
|
||||
einfo "\tollama run llama3:70b"
|
||||
einfo
|
||||
einfo "See available models at https://ollama.com/library"
|
||||
fi
|
||||
|
||||
if use cuda ; then
|
||||
einfo "When using cuda the user running ${PN} has to be in the video group or it won't detect devices."
|
||||
einfo "The ebuild ensures this for user ${PN} via acct-user/${PN}[cuda]"
|
||||
fi
|
||||
}
|
||||
@@ -1,308 +0,0 @@
|
||||
# Copyright 2024-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# supports ROCM/HIP >=5.5, but we define 6.1 due to the eclass
|
||||
ROCM_VERSION=6.1
|
||||
inherit cuda rocm
|
||||
inherit cmake
|
||||
inherit go-module systemd toolchain-funcs
|
||||
|
||||
DESCRIPTION="Get up and running with Llama 3, Mistral, Gemma, and other language models."
|
||||
HOMEPAGE="https://ollama.com"
|
||||
|
||||
if [[ ${PV} == *9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/ollama/ollama.git"
|
||||
else
|
||||
SRC_URI="
|
||||
https://github.com/ollama/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
|
||||
https://github.com/negril/gentoo-overlay-vendored/raw/refs/heads/blobs/${P}-vendor.tar.xz
|
||||
"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
|
||||
X86_CPU_FLAGS=(
|
||||
sse4_2
|
||||
avx
|
||||
f16c
|
||||
avx2
|
||||
bmi2
|
||||
fma3
|
||||
avx512f
|
||||
avx512vbmi
|
||||
avx512_vnni
|
||||
avx_vnni
|
||||
)
|
||||
CPU_FLAGS=( "${X86_CPU_FLAGS[@]/#/cpu_flags_x86_}" )
|
||||
IUSE="${CPU_FLAGS[*]} cuda blas mkl rocm"
|
||||
# IUSE+=" opencl vulkan"
|
||||
|
||||
RESTRICT="test"
|
||||
|
||||
COMMON_DEPEND="
|
||||
cuda? (
|
||||
dev-util/nvidia-cuda-toolkit:=
|
||||
)
|
||||
blas? (
|
||||
!mkl? (
|
||||
virtual/blas
|
||||
)
|
||||
mkl? (
|
||||
sci-libs/mkl
|
||||
)
|
||||
)
|
||||
rocm? (
|
||||
>=sci-libs/hipBLAS-5.5:=[${ROCM_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${COMMON_DEPEND}
|
||||
>=dev-lang/go-1.23.4
|
||||
"
|
||||
|
||||
RDEPEND="
|
||||
${COMMON_DEPEND}
|
||||
acct-group/${PN}
|
||||
>=acct-user/${PN}-3[cuda?]
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.6.3-use-GNUInstallDirs.patch"
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
if use amd64; then
|
||||
if use cpu_flags_x86_f16c && use cpu_flags_x86_avx2 && use cpu_flags_x86_fma3 && ! use cpu_flags_x86_bmi2; then
|
||||
ewarn
|
||||
ewarn "CPU_FLAGS_X86: bmi2 not enabled."
|
||||
ewarn " Not building haswell runner."
|
||||
ewarn " Not building skylakex runner."
|
||||
ewarn " Not building icelake runner."
|
||||
ewarn " Not building alderlake runner."
|
||||
ewarn
|
||||
if grep bmi2 /proc/cpuinfo > /dev/null; then
|
||||
ewarn "bmi2 found in /proc/cpuinfo"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ "${PV}" == *9999* ]]; then
|
||||
git-r3_src_unpack
|
||||
go-module_live_vendor
|
||||
else
|
||||
go-module_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
cmake_src_prepare
|
||||
|
||||
sed \
|
||||
-e "/set(GGML_CCACHE/s/ON/OFF/g" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*cu/d" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*hip/d" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/ -O3//g" \
|
||||
-i ml/backend/ggml/ggml/src/ggml-cpu/cpu.go || die sed
|
||||
|
||||
# fix library location
|
||||
sed \
|
||||
-e "s#lib/ollama#$(get_libdir)/ollama#g" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/\"..\", \"lib\"/\"..\", \"$(get_libdir)\"/" \
|
||||
-e "s#\"lib/ollama\"#\"$(get_libdir)/ollama\"#" \
|
||||
-i \
|
||||
ml/backend/ggml/ggml/src/ggml.go \
|
||||
discover/path.go \
|
||||
|| die
|
||||
|
||||
if use amd64; then
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sse42/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sandybridge/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(haswell/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(skylakex/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f ||
|
||||
! use cpu_flags_x86_avx512vbmi ||
|
||||
! use cpu_flags_x86_avx512_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(icelake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512 AVX512_VBMI AVX512_VNNI)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(alderlake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX_VNNI)
|
||||
fi
|
||||
|
||||
# ml/backend/ggml/ggml/src/CMakeLists.txt
|
||||
fi
|
||||
|
||||
# default
|
||||
# return
|
||||
if use cuda; then
|
||||
cuda_src_prepare
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
# --hip-version gets appended to the compile flags which isn't a known flag.
|
||||
# This causes rocm builds to fail because -Wunused-command-line-argument is turned on.
|
||||
# Use nuclear option to fix this.
|
||||
# Disable -Werror's from go modules.
|
||||
find "${S}" -name ".go" -exec sed -i "s/ -Werror / /g" {} + || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DGGML_CCACHE="no"
|
||||
|
||||
# -DGGML_CPU="yes"
|
||||
-DGGML_BLAS="$(usex blas)"
|
||||
# -DGGML_CUDA="$(usex cuda)"
|
||||
# -DGGML_HIP="$(usex rocm)"
|
||||
|
||||
# -DGGML_METAL="yes" # apple
|
||||
# missing from ml/backend/ggml/ggml/src/
|
||||
# -DGGML_CANN="yes"
|
||||
# -DGGML_MUSA="yes"
|
||||
# -DGGML_RPC="yes"
|
||||
# -DGGML_SYCL="yes"
|
||||
# -DGGML_KOMPUTE="$(usex kompute)"
|
||||
# -DGGML_OPENCL="$(usex opencl)"
|
||||
# -DGGML_VULKAN="$(usex vulkan)"
|
||||
)
|
||||
|
||||
if use blas; then
|
||||
if use mkl; then
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Intel"
|
||||
)
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Generic"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
if use cuda; then
|
||||
local -x CUDAHOSTCXX CUDAHOSTLD
|
||||
CUDAHOSTCXX="$(cuda_gccdir)"
|
||||
CUDAHOSTLD="$(tc-getCXX)"
|
||||
|
||||
cuda_add_sandbox -w
|
||||
addpredict "/dev/char/"
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_CUDA_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_ARCHITECTURES="$(get_amdgpu_flags)"
|
||||
-DCMAKE_HIP_PLATFORM="amd"
|
||||
# ollama doesn't honor the default cmake options
|
||||
-DAMDGPU_TARGETS="$(get_amdgpu_flags)"
|
||||
)
|
||||
|
||||
local -x HIP_PATH="${ESYSROOT}/usr"
|
||||
|
||||
check_amdgpu
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
ego build
|
||||
|
||||
cmake_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin ollama
|
||||
|
||||
cmake_src_install
|
||||
|
||||
newinitd "${FILESDIR}/ollama.init" "${PN}"
|
||||
newconfd "${FILESDIR}/ollama.confd" "${PN}"
|
||||
|
||||
systemd_dounit "${FILESDIR}/ollama.service"
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
keepdir /var/log/ollama
|
||||
fperms 750 /var/log/ollama
|
||||
fowners "${PN}:${PN}" /var/log/ollama
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ -z ${REPLACING_VERSIONS} ]] ; then
|
||||
einfo "Quick guide:"
|
||||
einfo "\tollama serve"
|
||||
einfo "\tollama run llama3:70b"
|
||||
einfo
|
||||
einfo "See available models at https://ollama.com/library"
|
||||
fi
|
||||
|
||||
if use cuda ; then
|
||||
einfo "When using cuda the user running ${PN} has to be in the video group or it won't detect devices."
|
||||
einfo "The ebuild ensures this for user ${PN} via acct-user/${PN}[cuda]"
|
||||
fi
|
||||
}
|
||||
@@ -1,308 +0,0 @@
|
||||
# Copyright 2024-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# supports ROCM/HIP >=5.5, but we define 6.1 due to the eclass
|
||||
ROCM_VERSION=6.1
|
||||
inherit cuda rocm
|
||||
inherit cmake
|
||||
inherit go-module systemd toolchain-funcs
|
||||
|
||||
DESCRIPTION="Get up and running with Llama 3, Mistral, Gemma, and other language models."
|
||||
HOMEPAGE="https://ollama.com"
|
||||
|
||||
if [[ ${PV} == *9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/ollama/ollama.git"
|
||||
else
|
||||
SRC_URI="
|
||||
https://github.com/ollama/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
|
||||
https://github.com/negril/gentoo-overlay-vendored/raw/refs/heads/blobs/${P}-vendor.tar.xz
|
||||
"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
|
||||
X86_CPU_FLAGS=(
|
||||
sse4_2
|
||||
avx
|
||||
f16c
|
||||
avx2
|
||||
bmi2
|
||||
fma3
|
||||
avx512f
|
||||
avx512vbmi
|
||||
avx512_vnni
|
||||
avx_vnni
|
||||
)
|
||||
CPU_FLAGS=( "${X86_CPU_FLAGS[@]/#/cpu_flags_x86_}" )
|
||||
IUSE="${CPU_FLAGS[*]} cuda blas mkl rocm"
|
||||
# IUSE+=" opencl vulkan"
|
||||
|
||||
RESTRICT="test"
|
||||
|
||||
COMMON_DEPEND="
|
||||
cuda? (
|
||||
dev-util/nvidia-cuda-toolkit:=
|
||||
)
|
||||
blas? (
|
||||
!mkl? (
|
||||
virtual/blas
|
||||
)
|
||||
mkl? (
|
||||
sci-libs/mkl
|
||||
)
|
||||
)
|
||||
rocm? (
|
||||
>=sci-libs/hipBLAS-5.5:=[${ROCM_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${COMMON_DEPEND}
|
||||
>=dev-lang/go-1.23.4
|
||||
"
|
||||
|
||||
RDEPEND="
|
||||
${COMMON_DEPEND}
|
||||
acct-group/${PN}
|
||||
>=acct-user/${PN}-3[cuda?]
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.6.3-use-GNUInstallDirs.patch"
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
if use amd64; then
|
||||
if use cpu_flags_x86_f16c && use cpu_flags_x86_avx2 && use cpu_flags_x86_fma3 && ! use cpu_flags_x86_bmi2; then
|
||||
ewarn
|
||||
ewarn "CPU_FLAGS_X86: bmi2 not enabled."
|
||||
ewarn " Not building haswell runner."
|
||||
ewarn " Not building skylakex runner."
|
||||
ewarn " Not building icelake runner."
|
||||
ewarn " Not building alderlake runner."
|
||||
ewarn
|
||||
if grep bmi2 /proc/cpuinfo > /dev/null; then
|
||||
ewarn "bmi2 found in /proc/cpuinfo"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ "${PV}" == *9999* ]]; then
|
||||
git-r3_src_unpack
|
||||
go-module_live_vendor
|
||||
else
|
||||
go-module_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
cmake_src_prepare
|
||||
|
||||
sed \
|
||||
-e "/set(GGML_CCACHE/s/ON/OFF/g" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*cu/d" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*hip/d" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/ -O3//g" \
|
||||
-i ml/backend/ggml/ggml/src/ggml-cpu/cpu.go || die sed
|
||||
|
||||
# fix library location
|
||||
sed \
|
||||
-e "s#lib/ollama#$(get_libdir)/ollama#g" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/\"..\", \"lib\"/\"..\", \"$(get_libdir)\"/" \
|
||||
-e "s#\"lib/ollama\"#\"$(get_libdir)/ollama\"#" \
|
||||
-i \
|
||||
ml/backend/ggml/ggml/src/ggml.go \
|
||||
discover/path.go \
|
||||
|| die
|
||||
|
||||
if use amd64; then
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sse42/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sandybridge/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(haswell/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(skylakex/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f ||
|
||||
! use cpu_flags_x86_avx512vbmi ||
|
||||
! use cpu_flags_x86_avx512_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(icelake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512 AVX512_VBMI AVX512_VNNI)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(alderlake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX_VNNI)
|
||||
fi
|
||||
|
||||
# ml/backend/ggml/ggml/src/CMakeLists.txt
|
||||
fi
|
||||
|
||||
# default
|
||||
# return
|
||||
if use cuda; then
|
||||
cuda_src_prepare
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
# --hip-version gets appended to the compile flags which isn't a known flag.
|
||||
# This causes rocm builds to fail because -Wunused-command-line-argument is turned on.
|
||||
# Use nuclear option to fix this.
|
||||
# Disable -Werror's from go modules.
|
||||
find "${S}" -name ".go" -exec sed -i "s/ -Werror / /g" {} + || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DGGML_CCACHE="no"
|
||||
|
||||
# -DGGML_CPU="yes"
|
||||
-DGGML_BLAS="$(usex blas)"
|
||||
# -DGGML_CUDA="$(usex cuda)"
|
||||
# -DGGML_HIP="$(usex rocm)"
|
||||
|
||||
# -DGGML_METAL="yes" # apple
|
||||
# missing from ml/backend/ggml/ggml/src/
|
||||
# -DGGML_CANN="yes"
|
||||
# -DGGML_MUSA="yes"
|
||||
# -DGGML_RPC="yes"
|
||||
# -DGGML_SYCL="yes"
|
||||
# -DGGML_KOMPUTE="$(usex kompute)"
|
||||
# -DGGML_OPENCL="$(usex opencl)"
|
||||
# -DGGML_VULKAN="$(usex vulkan)"
|
||||
)
|
||||
|
||||
if use blas; then
|
||||
if use mkl; then
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Intel"
|
||||
)
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Generic"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
if use cuda; then
|
||||
local -x CUDAHOSTCXX CUDAHOSTLD
|
||||
CUDAHOSTCXX="$(cuda_gccdir)"
|
||||
CUDAHOSTLD="$(tc-getCXX)"
|
||||
|
||||
cuda_add_sandbox -w
|
||||
addpredict "/dev/char/"
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_CUDA_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_ARCHITECTURES="$(get_amdgpu_flags)"
|
||||
-DCMAKE_HIP_PLATFORM="amd"
|
||||
# ollama doesn't honor the default cmake options
|
||||
-DAMDGPU_TARGETS="$(get_amdgpu_flags)"
|
||||
)
|
||||
|
||||
local -x HIP_PATH="${ESYSROOT}/usr"
|
||||
|
||||
check_amdgpu
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
ego build
|
||||
|
||||
cmake_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin ollama
|
||||
|
||||
cmake_src_install
|
||||
|
||||
newinitd "${FILESDIR}/ollama.init" "${PN}"
|
||||
newconfd "${FILESDIR}/ollama.confd" "${PN}"
|
||||
|
||||
systemd_dounit "${FILESDIR}/ollama.service"
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
keepdir /var/log/ollama
|
||||
fperms 750 /var/log/ollama
|
||||
fowners "${PN}:${PN}" /var/log/ollama
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ -z ${REPLACING_VERSIONS} ]] ; then
|
||||
einfo "Quick guide:"
|
||||
einfo "\tollama serve"
|
||||
einfo "\tollama run llama3:70b"
|
||||
einfo
|
||||
einfo "See available models at https://ollama.com/library"
|
||||
fi
|
||||
|
||||
if use cuda ; then
|
||||
einfo "When using cuda the user running ${PN} has to be in the video group or it won't detect devices."
|
||||
einfo "The ebuild ensures this for user ${PN} via acct-user/${PN}[cuda]"
|
||||
fi
|
||||
}
|
||||
@@ -1,308 +0,0 @@
|
||||
# Copyright 2024-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# supports ROCM/HIP >=5.5, but we define 6.1 due to the eclass
|
||||
ROCM_VERSION=6.1
|
||||
inherit cuda rocm
|
||||
inherit cmake
|
||||
inherit go-module systemd toolchain-funcs
|
||||
|
||||
DESCRIPTION="Get up and running with Llama 3, Mistral, Gemma, and other language models."
|
||||
HOMEPAGE="https://ollama.com"
|
||||
|
||||
if [[ ${PV} == *9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/ollama/ollama.git"
|
||||
else
|
||||
SRC_URI="
|
||||
https://github.com/ollama/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
|
||||
https://github.com/negril/gentoo-overlay-vendored/raw/refs/heads/blobs/${P}-vendor.tar.xz
|
||||
"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
|
||||
X86_CPU_FLAGS=(
|
||||
sse4_2
|
||||
avx
|
||||
f16c
|
||||
avx2
|
||||
bmi2
|
||||
fma3
|
||||
avx512f
|
||||
avx512vbmi
|
||||
avx512_vnni
|
||||
avx_vnni
|
||||
)
|
||||
CPU_FLAGS=( "${X86_CPU_FLAGS[@]/#/cpu_flags_x86_}" )
|
||||
IUSE="${CPU_FLAGS[*]} cuda blas mkl rocm"
|
||||
# IUSE+=" opencl vulkan"
|
||||
|
||||
RESTRICT="test"
|
||||
|
||||
COMMON_DEPEND="
|
||||
cuda? (
|
||||
dev-util/nvidia-cuda-toolkit:=
|
||||
)
|
||||
blas? (
|
||||
!mkl? (
|
||||
virtual/blas
|
||||
)
|
||||
mkl? (
|
||||
sci-libs/mkl
|
||||
)
|
||||
)
|
||||
rocm? (
|
||||
>=sci-libs/hipBLAS-5.5:=[${ROCM_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${COMMON_DEPEND}
|
||||
>=dev-lang/go-1.23.4
|
||||
"
|
||||
|
||||
RDEPEND="
|
||||
${COMMON_DEPEND}
|
||||
acct-group/${PN}
|
||||
>=acct-user/${PN}-3[cuda?]
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.6.3-use-GNUInstallDirs.patch"
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
if use amd64; then
|
||||
if use cpu_flags_x86_f16c && use cpu_flags_x86_avx2 && use cpu_flags_x86_fma3 && ! use cpu_flags_x86_bmi2; then
|
||||
ewarn
|
||||
ewarn "CPU_FLAGS_X86: bmi2 not enabled."
|
||||
ewarn " Not building haswell runner."
|
||||
ewarn " Not building skylakex runner."
|
||||
ewarn " Not building icelake runner."
|
||||
ewarn " Not building alderlake runner."
|
||||
ewarn
|
||||
if grep bmi2 /proc/cpuinfo > /dev/null; then
|
||||
ewarn "bmi2 found in /proc/cpuinfo"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ "${PV}" == *9999* ]]; then
|
||||
git-r3_src_unpack
|
||||
go-module_live_vendor
|
||||
else
|
||||
go-module_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
cmake_src_prepare
|
||||
|
||||
sed \
|
||||
-e "/set(GGML_CCACHE/s/ON/OFF/g" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*cu/d" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*hip/d" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/ -O3//g" \
|
||||
-i ml/backend/ggml/ggml/src/ggml-cpu/cpu.go || die sed
|
||||
|
||||
# fix library location
|
||||
sed \
|
||||
-e "s#lib/ollama#$(get_libdir)/ollama#g" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/\"..\", \"lib\"/\"..\", \"$(get_libdir)\"/" \
|
||||
-e "s#\"lib/ollama\"#\"$(get_libdir)/ollama\"#" \
|
||||
-i \
|
||||
ml/backend/ggml/ggml/src/ggml.go \
|
||||
discover/path.go \
|
||||
|| die
|
||||
|
||||
if use amd64; then
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sse42/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sandybridge/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(haswell/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(skylakex/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f ||
|
||||
! use cpu_flags_x86_avx512vbmi ||
|
||||
! use cpu_flags_x86_avx512_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(icelake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512 AVX512_VBMI AVX512_VNNI)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(alderlake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX_VNNI)
|
||||
fi
|
||||
|
||||
# ml/backend/ggml/ggml/src/CMakeLists.txt
|
||||
fi
|
||||
|
||||
# default
|
||||
# return
|
||||
if use cuda; then
|
||||
cuda_src_prepare
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
# --hip-version gets appended to the compile flags which isn't a known flag.
|
||||
# This causes rocm builds to fail because -Wunused-command-line-argument is turned on.
|
||||
# Use nuclear option to fix this.
|
||||
# Disable -Werror's from go modules.
|
||||
find "${S}" -name ".go" -exec sed -i "s/ -Werror / /g" {} + || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DGGML_CCACHE="no"
|
||||
|
||||
# -DGGML_CPU="yes"
|
||||
-DGGML_BLAS="$(usex blas)"
|
||||
# -DGGML_CUDA="$(usex cuda)"
|
||||
# -DGGML_HIP="$(usex rocm)"
|
||||
|
||||
# -DGGML_METAL="yes" # apple
|
||||
# missing from ml/backend/ggml/ggml/src/
|
||||
# -DGGML_CANN="yes"
|
||||
# -DGGML_MUSA="yes"
|
||||
# -DGGML_RPC="yes"
|
||||
# -DGGML_SYCL="yes"
|
||||
# -DGGML_KOMPUTE="$(usex kompute)"
|
||||
# -DGGML_OPENCL="$(usex opencl)"
|
||||
# -DGGML_VULKAN="$(usex vulkan)"
|
||||
)
|
||||
|
||||
if use blas; then
|
||||
if use mkl; then
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Intel"
|
||||
)
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Generic"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
if use cuda; then
|
||||
local -x CUDAHOSTCXX CUDAHOSTLD
|
||||
CUDAHOSTCXX="$(cuda_gccdir)"
|
||||
CUDAHOSTLD="$(tc-getCXX)"
|
||||
|
||||
cuda_add_sandbox -w
|
||||
addpredict "/dev/char/"
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_CUDA_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_ARCHITECTURES="$(get_amdgpu_flags)"
|
||||
-DCMAKE_HIP_PLATFORM="amd"
|
||||
# ollama doesn't honor the default cmake options
|
||||
-DAMDGPU_TARGETS="$(get_amdgpu_flags)"
|
||||
)
|
||||
|
||||
local -x HIP_PATH="${ESYSROOT}/usr"
|
||||
|
||||
check_amdgpu
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
ego build
|
||||
|
||||
cmake_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin ollama
|
||||
|
||||
cmake_src_install
|
||||
|
||||
newinitd "${FILESDIR}/ollama.init" "${PN}"
|
||||
newconfd "${FILESDIR}/ollama.confd" "${PN}"
|
||||
|
||||
systemd_dounit "${FILESDIR}/ollama.service"
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
keepdir /var/log/ollama
|
||||
fperms 750 /var/log/ollama
|
||||
fowners "${PN}:${PN}" /var/log/ollama
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ -z ${REPLACING_VERSIONS} ]] ; then
|
||||
einfo "Quick guide:"
|
||||
einfo "\tollama serve"
|
||||
einfo "\tollama run llama3:70b"
|
||||
einfo
|
||||
einfo "See available models at https://ollama.com/library"
|
||||
fi
|
||||
|
||||
if use cuda ; then
|
||||
einfo "When using cuda the user running ${PN} has to be in the video group or it won't detect devices."
|
||||
einfo "The ebuild ensures this for user ${PN} via acct-user/${PN}[cuda]"
|
||||
fi
|
||||
}
|
||||
@@ -1,308 +0,0 @@
|
||||
# Copyright 2024-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# supports ROCM/HIP >=5.5, but we define 6.1 due to the eclass
|
||||
ROCM_VERSION=6.1
|
||||
inherit cuda rocm
|
||||
inherit cmake
|
||||
inherit go-module systemd toolchain-funcs
|
||||
|
||||
DESCRIPTION="Get up and running with Llama 3, Mistral, Gemma, and other language models."
|
||||
HOMEPAGE="https://ollama.com"
|
||||
|
||||
if [[ ${PV} == *9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/ollama/ollama.git"
|
||||
else
|
||||
SRC_URI="
|
||||
https://github.com/ollama/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
|
||||
https://github.com/negril/gentoo-overlay-vendored/raw/refs/heads/blobs/${P}-vendor.tar.xz
|
||||
"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
|
||||
X86_CPU_FLAGS=(
|
||||
sse4_2
|
||||
avx
|
||||
f16c
|
||||
avx2
|
||||
bmi2
|
||||
fma3
|
||||
avx512f
|
||||
avx512vbmi
|
||||
avx512_vnni
|
||||
avx_vnni
|
||||
)
|
||||
CPU_FLAGS=( "${X86_CPU_FLAGS[@]/#/cpu_flags_x86_}" )
|
||||
IUSE="${CPU_FLAGS[*]} cuda blas mkl rocm"
|
||||
# IUSE+=" opencl vulkan"
|
||||
|
||||
RESTRICT="test"
|
||||
|
||||
COMMON_DEPEND="
|
||||
cuda? (
|
||||
dev-util/nvidia-cuda-toolkit:=
|
||||
)
|
||||
blas? (
|
||||
!mkl? (
|
||||
virtual/blas
|
||||
)
|
||||
mkl? (
|
||||
sci-libs/mkl
|
||||
)
|
||||
)
|
||||
rocm? (
|
||||
>=sci-libs/hipBLAS-5.5:=[${ROCM_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${COMMON_DEPEND}
|
||||
>=dev-lang/go-1.23.4
|
||||
"
|
||||
|
||||
RDEPEND="
|
||||
${COMMON_DEPEND}
|
||||
acct-group/${PN}
|
||||
>=acct-user/${PN}-3[cuda?]
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.6.3-use-GNUInstallDirs.patch"
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
if use amd64; then
|
||||
if use cpu_flags_x86_f16c && use cpu_flags_x86_avx2 && use cpu_flags_x86_fma3 && ! use cpu_flags_x86_bmi2; then
|
||||
ewarn
|
||||
ewarn "CPU_FLAGS_X86: bmi2 not enabled."
|
||||
ewarn " Not building haswell runner."
|
||||
ewarn " Not building skylakex runner."
|
||||
ewarn " Not building icelake runner."
|
||||
ewarn " Not building alderlake runner."
|
||||
ewarn
|
||||
if grep bmi2 /proc/cpuinfo > /dev/null; then
|
||||
ewarn "bmi2 found in /proc/cpuinfo"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ "${PV}" == *9999* ]]; then
|
||||
git-r3_src_unpack
|
||||
go-module_live_vendor
|
||||
else
|
||||
go-module_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
cmake_src_prepare
|
||||
|
||||
sed \
|
||||
-e "/set(GGML_CCACHE/s/ON/OFF/g" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*cu/d" \
|
||||
-e "/PRE_INCLUDE_REGEXES.*hip/d" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/ -O3//g" \
|
||||
-i ml/backend/ggml/ggml/src/ggml-cpu/cpu.go || die sed
|
||||
|
||||
# fix library location
|
||||
sed \
|
||||
-e "s#lib/ollama#$(get_libdir)/ollama#g" \
|
||||
-i CMakeLists.txt || die sed
|
||||
|
||||
sed \
|
||||
-e "s/\"..\", \"lib\"/\"..\", \"$(get_libdir)\"/" \
|
||||
-e "s#\"lib/ollama\"#\"$(get_libdir)/ollama\"#" \
|
||||
-i \
|
||||
ml/backend/ggml/ggml/src/ggml.go \
|
||||
discover/path.go \
|
||||
|| die
|
||||
|
||||
if use amd64; then
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sse42/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(sandybridge/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(haswell/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(skylakex/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx512f ||
|
||||
! use cpu_flags_x86_avx512vbmi ||
|
||||
! use cpu_flags_x86_avx512_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(icelake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX512 AVX512_VBMI AVX512_VNNI)
|
||||
fi
|
||||
if
|
||||
! use cpu_flags_x86_sse4_2 ||
|
||||
! use cpu_flags_x86_avx ||
|
||||
! use cpu_flags_x86_f16c ||
|
||||
! use cpu_flags_x86_avx2 ||
|
||||
! use cpu_flags_x86_bmi2 ||
|
||||
! use cpu_flags_x86_fma3 ||
|
||||
! use cpu_flags_x86_avx_vnni; then
|
||||
sed -e "/ggml_add_cpu_backend_variant(alderlake/s/^/# /g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die
|
||||
# SSE42 AVX F16C AVX2 BMI2 FMA AVX_VNNI)
|
||||
fi
|
||||
|
||||
# ml/backend/ggml/ggml/src/CMakeLists.txt
|
||||
fi
|
||||
|
||||
# default
|
||||
# return
|
||||
if use cuda; then
|
||||
cuda_src_prepare
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
# --hip-version gets appended to the compile flags which isn't a known flag.
|
||||
# This causes rocm builds to fail because -Wunused-command-line-argument is turned on.
|
||||
# Use nuclear option to fix this.
|
||||
# Disable -Werror's from go modules.
|
||||
find "${S}" -name ".go" -exec sed -i "s/ -Werror / /g" {} + || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DGGML_CCACHE="no"
|
||||
|
||||
# -DGGML_CPU="yes"
|
||||
-DGGML_BLAS="$(usex blas)"
|
||||
# -DGGML_CUDA="$(usex cuda)"
|
||||
# -DGGML_HIP="$(usex rocm)"
|
||||
|
||||
# -DGGML_METAL="yes" # apple
|
||||
# missing from ml/backend/ggml/ggml/src/
|
||||
# -DGGML_CANN="yes"
|
||||
# -DGGML_MUSA="yes"
|
||||
# -DGGML_RPC="yes"
|
||||
# -DGGML_SYCL="yes"
|
||||
# -DGGML_KOMPUTE="$(usex kompute)"
|
||||
# -DGGML_OPENCL="$(usex opencl)"
|
||||
# -DGGML_VULKAN="$(usex vulkan)"
|
||||
)
|
||||
|
||||
if use blas; then
|
||||
if use mkl; then
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Intel"
|
||||
)
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS_VENDOR="Generic"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
if use cuda; then
|
||||
local -x CUDAHOSTCXX CUDAHOSTLD
|
||||
CUDAHOSTCXX="$(cuda_gccdir)"
|
||||
CUDAHOSTLD="$(tc-getCXX)"
|
||||
|
||||
cuda_add_sandbox -w
|
||||
addpredict "/dev/char/"
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_CUDA_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_ARCHITECTURES="$(get_amdgpu_flags)"
|
||||
-DCMAKE_HIP_PLATFORM="amd"
|
||||
# ollama doesn't honor the default cmake options
|
||||
-DAMDGPU_TARGETS="$(get_amdgpu_flags)"
|
||||
)
|
||||
|
||||
local -x HIP_PATH="${ESYSROOT}/usr"
|
||||
|
||||
check_amdgpu
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_HIP_COMPILER="NOTFOUND"
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
ego build
|
||||
|
||||
cmake_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin ollama
|
||||
|
||||
cmake_src_install
|
||||
|
||||
newinitd "${FILESDIR}/ollama.init" "${PN}"
|
||||
newconfd "${FILESDIR}/ollama.confd" "${PN}"
|
||||
|
||||
systemd_dounit "${FILESDIR}/ollama.service"
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
keepdir /var/log/ollama
|
||||
fperms 750 /var/log/ollama
|
||||
fowners "${PN}:${PN}" /var/log/ollama
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ -z ${REPLACING_VERSIONS} ]] ; then
|
||||
einfo "Quick guide:"
|
||||
einfo "\tollama serve"
|
||||
einfo "\tollama run llama3:70b"
|
||||
einfo
|
||||
einfo "See available models at https://ollama.com/library"
|
||||
fi
|
||||
|
||||
if use cuda ; then
|
||||
einfo "When using cuda the user running ${PN} has to be in the video group or it won't detect devices."
|
||||
einfo "The ebuild ensures this for user ${PN} via acct-user/${PN}[cuda]"
|
||||
fi
|
||||
}
|
||||
@@ -1,2 +1 @@
|
||||
DIST evdi-1.14.10.tar.gz 97166 BLAKE2B 67e489a3287d773262997cb16337293979fbbfe01b7e32de0dbdf1ab95bcfc25e08707d5fdb44a735a561579b2888d7578761051e78ec34dc76429eb261519ff SHA512 3937af9a2cc377f505c45de4ad0c28c778ef91ee7157341dfe411c8c1dde6c665cede26963678b7492688338059dd57f7fe296666e439240eb0f4d478bafbc28
|
||||
DIST evdi-1.14.9.tar.gz 97080 BLAKE2B 85dd5543bcc9ff94e69a6e9c2c5bc36748bd62ec5f55dee71831c37369c231d71548610547d74e8d307cf2b32b4117f40c0948edccc3e32f4a35a5203e027e18 SHA512 55d1d424ae637436b5f5937df6dbbb14bc02b4d7b2e8ce24002494d4a935466637987a188b74a7bc6b9f4eeb417dd60a471eceee85d0fd440901a5153a323fe2
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{11..13} )
|
||||
inherit linux-mod-r1 python-single-r1 flag-o-matic
|
||||
|
||||
DESCRIPTION="Extensible Virtual Display Interface"
|
||||
HOMEPAGE="https://github.com/DisplayLink/evdi"
|
||||
SRC_URI="https://github.com/DisplayLink/evdi/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="GPL-2 LGPL-2.1"
|
||||
SLOT="0/$(ver_cut 1)"
|
||||
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
|
||||
|
||||
IUSE="python test"
|
||||
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
python? (
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/pybind11[${PYTHON_USEDEP}]
|
||||
test? (
|
||||
dev-python/pytest-mock[${PYTHON_USEDEP}]
|
||||
)
|
||||
')
|
||||
)
|
||||
"
|
||||
|
||||
DEPEND="${RDEPEND}
|
||||
x11-libs/libdrm
|
||||
sys-kernel/linux-headers
|
||||
"
|
||||
|
||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
# module/Kconfig
|
||||
CONFIG_CHECK="~FB_VIRTUAL ~I2C ~DRM ~USB_SUPPORT ~USB_ARCH_HAS_HCD MODULES"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-1.14.4-format-truncation.patch"
|
||||
)
|
||||
|
||||
pkg_setup() {
|
||||
linux-mod-r1_pkg_setup
|
||||
use python && python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
filter-lto
|
||||
|
||||
local modlist=(
|
||||
"evdi=video:module"
|
||||
)
|
||||
local modargs=(
|
||||
CONFIG_DRM_EVDI="m" # https://github.com/DisplayLink/evdi/issues/476
|
||||
KVER="${KV_FULL}"
|
||||
KDIR="${KV_OUT_DIR}"
|
||||
)
|
||||
linux-mod-r1_src_compile
|
||||
|
||||
emake -C library
|
||||
|
||||
use python && emake -C pyevdi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
|
||||
|
||||
use python && emake -C pyevdi tests
|
||||
}
|
||||
|
||||
src_install() {
|
||||
linux-mod-r1_src_install
|
||||
|
||||
local -x DESTDIR="${ED}" PREFIX="${EPREFIX}"
|
||||
|
||||
LIBDIR="/usr/$(get_libdir)" emake -C library install
|
||||
|
||||
use python && emake -C pyevdi install
|
||||
}
|
||||
Reference in New Issue
Block a user