Compare commits
3 Commits
d458eb8387
...
204451a781
Author | SHA1 | Date | |
---|---|---|---|
|
204451a781 | ||
|
2b88f82646 | ||
|
7e1b235ef5 |
@@ -1,10 +0,0 @@
|
||||
AUX calibre-7.0.0-jxr-test.patch 935 BLAKE2B bc38ea2f2d10ec4859ee03ab5d18048df4cf0af5ce4076efc013013bc975966390d618c43ce621675e3b8ee8f929bfaebaa72cf6bb7d8dea544bca77d9772b60 SHA512 db8da42fdcf5b5d5dfad35c128e394cf8f51e57dda6cd1a482803429738515fc1a8b338c711679a11acb93678f35f10883e1bf282e1443ccaafe2eb470fbbfee
|
||||
AUX calibre-server-3.conf 541 BLAKE2B 06593633721e6adf2cf2077dffa83953eea46ccdcdc857ad468a9b74788326e9424f6ab9058be344dbbac8e49d343f5a1e53ddb486f2018b77319a7f8f713cf4 SHA512 12ef793a5b6ffd4413f780a13cad63927a95f15d17d85d4229eb5005ead68e51779abb822f9898ab5ae8c2094affeec1f9e85c34f109499739e6726b7641542a
|
||||
AUX calibre-server-3.init 1796 BLAKE2B f87d785d6f6fc10fa648d40944ec8538027854bb872d9a3be6b5b35b0abf3cda1e4e93874a9422914da5eb4287f193459733956e3f1e25e61bec0c214c552c99 SHA512 88110ded1b9c6cf8d3bfc3d5889654f77578f9d299e88daea9023767b930082e00fbddbb92a6e43c46d900248f3684232d93396ec1d0e784c7ec14b44783f98a
|
||||
DIST calibre-8.6.0.tar.xz 45082996 BLAKE2B 61bc57b7c7f92cd80df5927d92473eedff3b673541115bd73e73732b5c6e76aa0027ae134359a432f2864fadac954550560ee4ffd989546713a2be6e2ce5fe46 SHA512 4841893f48d71a08bd28cfea04ced7ef4977b3c875a15400afa6d39a705f12e895e02a808a24085e001392f92e5c9a1721ec4b36dd3c9033255576a0de8a60da
|
||||
DIST calibre-8.6.0.tar.xz.sig 566 BLAKE2B ad2296ae50ff8230965bce8f028ea98e15768175a245e023d067f3c160e3e813f615b10b58d97792ad0b08816342f04863a4c460dd4d5665322bb92414bc286a SHA512 cdaf6f1bcff870c82b5156d8358ce91b9259d096dcc7a15d7c1c123e7aeb430afa6dc8c18c2e8b14c8845e71e4724c814b5b6920f2fca20b1a4d110334bba056
|
||||
DIST calibre-8.7.0.tar.xz 45111468 BLAKE2B 2b8042f44422945a027f289015e5c9a42450b94ca0e53cdbaac7d0a2f7f41ea2a19f3e90b702f043a086e7218d4d9a25b441bc5b516c3e7f6454422d2c4accd1 SHA512 12d6f49d09edef8677a966198b0b05da9f8deee3c3ff6980804e13561edc35a515555e6a8cb53be70925bc3bdb8e3714cb018454f4e5da4794105b0fe53bba63
|
||||
DIST calibre-8.7.0.tar.xz.sig 566 BLAKE2B 1d24f99f6311d55a5a9f0fc5cd23c17b8f5296f5fb8a8a24125fe8cbdda6ab2b9520bd70c91b1b0f0a3d30281c44c84aa397ed9d6f3447f898fe52e89f756f64 SHA512 6e5d555d622a01b78b9a291640099751cea2658d39d03b0a5d80623fedfd6fe8145c0d53fd90dcbb62fb08d593db086f00c4d531eb499ad9fcbbdac21059b132
|
||||
EBUILD calibre-8.6.0.ebuild 8340 BLAKE2B fda5f93301c705f8b04deb1f6597902ffafed32f19e9237f50026d58a59931c1a8a755ffa03aa65d7d35f0dd427c39b8fb901ffab02a989bd1fe3544ac03b641 SHA512 d7fe8fcbe231721b73f3559dc8ddf6b01145c2ea94d40b886b87c6c9e7ae44b4b36f43bf33c619169296cd1dde1ae649bf66db97aba160f4db0bcd04a0e3926d
|
||||
EBUILD calibre-8.7.0.ebuild 8340 BLAKE2B fda5f93301c705f8b04deb1f6597902ffafed32f19e9237f50026d58a59931c1a8a755ffa03aa65d7d35f0dd427c39b8fb901ffab02a989bd1fe3544ac03b641 SHA512 d7fe8fcbe231721b73f3559dc8ddf6b01145c2ea94d40b886b87c6c9e7ae44b4b36f43bf33c619169296cd1dde1ae649bf66db97aba160f4db0bcd04a0e3926d
|
||||
MISC metadata.xml 642 BLAKE2B 9d32b118040e9907bc689fc9575e5fdc76624809d9ae4e16feb860f5779846d5cd51ff0605ed19116ef564c62c7a7a75dc3532765bef5c7b42447d47dc4df152 SHA512 9050d849ad74a20e801f3d762aff8ec16c7f7c20efa5bdc46e9a2f0b3e505a511116d55ce65f270ad1d53b6fcaadc61d7039aa0b0a83f4bb3af0cec065adf41c
|
@@ -1,254 +0,0 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
PYTHON_REQ_USE='sqlite,ssl'
|
||||
|
||||
inherit edo toolchain-funcs python-single-r1 qmake-utils verify-sig xdg
|
||||
|
||||
DESCRIPTION='Ebook management application'
|
||||
HOMEPAGE='https://calibre-ebook.com/'
|
||||
SRC_URI="
|
||||
https://download.calibre-ebook.com/${PV}/${P}.tar.xz
|
||||
verify-sig? ( https://calibre-ebook.com/signatures/${P}.tar.xz.sig )
|
||||
"
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/kovidgoyal.gpg
|
||||
|
||||
LICENSE='
|
||||
GPL-3+
|
||||
GPL-3
|
||||
GPL-2+
|
||||
GPL-2
|
||||
GPL-1+
|
||||
LGPL-3+
|
||||
LGPL-2.1+
|
||||
LGPL-2.1
|
||||
BSD
|
||||
MIT
|
||||
Old-MIT
|
||||
Apache-2.0
|
||||
public-domain
|
||||
|| ( Artistic GPL-1+ )
|
||||
CC-BY-3.0
|
||||
OFL-1.1
|
||||
PSF-2
|
||||
'
|
||||
SLOT='0'
|
||||
KEYWORDS='~amd64 ~arm64'
|
||||
IUSE='+font-subsetting ios speech +system-mathjax test +udisks unrar'
|
||||
|
||||
RESTRICT='!test? ( test )'
|
||||
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
# Qt slotted dependencies are used because the libheadless.so plugin links to
|
||||
# QT_*_PRIVATE_ABI. It only uses core/gui/dbus.
|
||||
COMMON_DEPEND="${PYTHON_DEPS}
|
||||
app-i18n/uchardet
|
||||
>=app-text/hunspell-1.7:=
|
||||
>=app-text/podofo-0.10.0:=
|
||||
app-text/poppler[utils]
|
||||
dev-libs/hyphen:=
|
||||
>=dev-libs/icu-57.1:=
|
||||
dev-libs/openssl:=
|
||||
dev-libs/snowball-stemmer:=
|
||||
$(python_gen_cond_dep '
|
||||
>=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
|
||||
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
|
||||
>=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
|
||||
dev-python/dnspython[${PYTHON_USEDEP}]
|
||||
>=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}]
|
||||
>=dev-python/html5-parser-0.4.9[${PYTHON_USEDEP}]
|
||||
dev-python/jeepney[${PYTHON_USEDEP}]
|
||||
>=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
|
||||
dev-python/lxml-html-clean[${PYTHON_USEDEP}]
|
||||
>=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
|
||||
>=dev-python/msgpack-0.6.2[${PYTHON_USEDEP}]
|
||||
>=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
|
||||
>=dev-python/pillow-3.2.0[jpeg,truetype,webp,zlib,${PYTHON_USEDEP}]
|
||||
>=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/pychm-0.8.6[${PYTHON_USEDEP}]
|
||||
dev-python/pykakasi[${PYTHON_USEDEP}]
|
||||
>=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
|
||||
dev-python/pyqt6[gui,network,opengl,printsupport,quick,svg,widgets,${PYTHON_USEDEP}]
|
||||
dev-python/pyqt6-webengine[widgets,${PYTHON_USEDEP}]
|
||||
dev-python/regex[${PYTHON_USEDEP}]
|
||||
dev-python/xxhash[${PYTHON_USEDEP}]
|
||||
>=dev-python/zeroconf-0.75.0[${PYTHON_USEDEP}]
|
||||
')
|
||||
dev-qt/qtbase:6=[gui,widgets]
|
||||
dev-qt/qtimageformats:6
|
||||
dev-util/desktop-file-utils
|
||||
dev-util/gtk-update-icon-cache
|
||||
media-fonts/liberation-fonts
|
||||
media-libs/fontconfig:=
|
||||
>=media-libs/freetype-2:=
|
||||
>=media-libs/libmtp-1.1.11:=
|
||||
>=media-gfx/optipng-0.7.6
|
||||
>=media-video/ffmpeg-6:=
|
||||
virtual/libusb:1=
|
||||
x11-misc/shared-mime-info
|
||||
>=x11-misc/xdg-utils-1.0.2-r2
|
||||
font-subsetting? ( $(python_gen_cond_dep 'dev-python/fonttools[${PYTHON_USEDEP}]') )
|
||||
ios? (
|
||||
>=app-pda/usbmuxd-1.0.8
|
||||
>=app-pda/libimobiledevice-1.2.0
|
||||
)
|
||||
speech? (
|
||||
$(python_gen_cond_dep 'app-accessibility/speech-dispatcher[python,${PYTHON_USEDEP}]')
|
||||
dev-python/pyqt6[multimedia,speech]
|
||||
)
|
||||
system-mathjax? ( >=dev-libs/mathjax-3:= )
|
||||
udisks? ( virtual/libudev )
|
||||
unrar? ( dev-python/unrardll )
|
||||
"
|
||||
RDEPEND="${COMMON_DEPEND}
|
||||
udisks? ( sys-fs/udisks:2 )"
|
||||
DEPEND="${COMMON_DEPEND}
|
||||
test? ( $(python_gen_cond_dep '>=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]') )
|
||||
"
|
||||
BDEPEND="$(python_gen_cond_dep '
|
||||
>=dev-python/pyqt-builder-1.10.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/sip-5[${PYTHON_USEDEP}]
|
||||
')
|
||||
virtual/pkgconfig
|
||||
system-mathjax? ( dev-lang/rapydscript-ng )
|
||||
verify-sig? ( sec-keys/openpgp-keys-kovidgoyal )
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
# Skip calling a binary (JxrDecApp) from libjxr which is used for tests
|
||||
# We don't (yet?) package libjxr and it seems to be dead upstream
|
||||
# (last commit in 2017)
|
||||
"${FILESDIR}/${PN}-7.0.0-jxr-test.patch"
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# Warning:
|
||||
#
|
||||
# While it might be rather tempting to add yet another sed here,
|
||||
# please don't. There have been several bugs in Gentoo's packaging
|
||||
# of calibre from seds-which-become-stale. Please consider
|
||||
# creating a patch instead, but in any case, run the test suite
|
||||
# and ensure it passes.
|
||||
#
|
||||
# If in doubt about a problem, checking Fedora's packaging is recommended.
|
||||
|
||||
# Disable unnecessary privilege dropping for bug #287067.
|
||||
sed -e 's:if os.geteuid() == 0:if False and os.geteuid() == 0:' \
|
||||
-i setup/install.py || die 'sed failed to patch install.py'
|
||||
|
||||
# This is only ever used at build time. It contains a small embedded copy
|
||||
# of the rapydscript-ng compiler usable inside of qtwebengine, if you don't
|
||||
# have rapydscript-ng (a nodejs package) itself installed. Its only purpose
|
||||
# is to build some resources that come bundled in dist tarballs already...
|
||||
# and which we may also need to regenerate e.g. to use system-mathjax.
|
||||
#
|
||||
# However, running qtwebengine violates the portage sandbox (among other
|
||||
# things, it tries to create directories in /usr! amazing) so this is a
|
||||
# wash anyway. The only real solution here is to package rapydscript-ng.
|
||||
#
|
||||
# We do not need it at build time, and *no one* needs it at install time.
|
||||
# Delete the cruft.
|
||||
rm -r resources/rapydscript/ || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# TODO: get qmake called by setup.py to respect CC and CXX too
|
||||
tc-export CC CXX
|
||||
|
||||
# bug 821871
|
||||
local MY_LIBDIR="${ESYSROOT}/usr/$(get_libdir)"
|
||||
export FT_LIB_DIR="${MY_LIBDIR}" HUNSPELL_LIB_DIR="${MY_LIBDIR}" PODOFO_LIB_DIR="${MY_LIBDIR}"
|
||||
export QMAKE="$(qt6_get_bindir)/qmake"
|
||||
|
||||
edo ${EPYTHON} setup.py build
|
||||
edo ${EPYTHON} setup.py gui
|
||||
|
||||
# A few different resources are bundled in the distfile by default, because
|
||||
# not all systems necessarily have them. We un-vendor them, using the
|
||||
# upstream integrated approach if possible. See setup/revendor.py and
|
||||
# consider migrating other resources to this if they do not use it, in
|
||||
# *preference* over manual rm'ing.
|
||||
edo ${EPYTHON} setup.py liberation_fonts \
|
||||
--path-to-liberation_fonts "${EPREFIX}"/usr/share/fonts/liberation-fonts \
|
||||
--system-liberation_fonts
|
||||
if use system-mathjax; then
|
||||
edo ${EPYTHON} setup.py mathjax --path-to-mathjax "${EPREFIX}"/usr/share/mathjax --system-mathjax
|
||||
edo ${EPYTHON} setup.py rapydscript
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# Skipped tests:
|
||||
local _test_excludes=(
|
||||
# unpackaged Python dependency: py7zr
|
||||
7z
|
||||
# unpackaged Python dependency: pyzstd
|
||||
test_zstd
|
||||
# unpackaged TTS backend (optional at runtime): https://github.com/rhasspy/piper
|
||||
piper
|
||||
# tests if a completely unused module is bundled
|
||||
pycryptodome
|
||||
|
||||
$(usev !speech speech_dispatcher)
|
||||
$(usev !unrar test_unrar)
|
||||
|
||||
# undocumented reasons
|
||||
test_mem_leaks
|
||||
test_searching
|
||||
)
|
||||
|
||||
# Some of these tests weren't practical to split out into distinct tests, so
|
||||
# have a different control mechanism
|
||||
use speech || export SKIP_SPEECH_TESTS=1
|
||||
|
||||
edo ${PYTHON} setup.py test "${_test_excludes[@]/#/--exclude-test-name=}"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
|
||||
# File '/usr/lib/python2.6/locale.py', line 486, in getdefaultlocale
|
||||
# return _parse_localename(localename)
|
||||
# File '/usr/lib/python2.6/locale.py', line 418, in _parse_localename
|
||||
# raise ValueError, 'unknown locale: %s' % localename
|
||||
#ValueError: unknown locale: 46
|
||||
export -n LANG LANGUAGE ${!LC_*}
|
||||
export LC_ALL=C.utf8 # bug #709682
|
||||
|
||||
# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
|
||||
# variables to point to our fake temporary $HOME.
|
||||
export HOME="${T}/fake_homedir"
|
||||
export CALIBRE_CONFIG_DIRECTORY="${HOME}/.config/calibre"
|
||||
mkdir -p "${CALIBRE_CONFIG_DIRECTORY}" || die
|
||||
|
||||
addpredict /dev/dri #665310
|
||||
|
||||
# If this directory doesn't exist, zsh completion won't install
|
||||
dodir /usr/share/zsh/site-functions
|
||||
|
||||
edo "${PYTHON}" setup.py install \
|
||||
--staging-root="${ED}/usr" \
|
||||
--prefix="${EPREFIX}/usr" \
|
||||
--libdir="${EPREFIX}/usr/$(get_libdir)" \
|
||||
--staging-libdir="${ED}/usr/$(get_libdir)" \
|
||||
--system-plugins-location="${EPREFIX}/usr/share/calibre/system-plugins"
|
||||
|
||||
cp -r man-pages/ "${ED}"/usr/share/man || die
|
||||
|
||||
find "${ED}"/usr/share -type d -empty -delete || die
|
||||
|
||||
python_fix_shebang "${ED}/usr/bin"
|
||||
|
||||
python_optimize "${ED}"/usr/"$(get_libdir)"/calibre "${D}/$(python_get_sitedir)"
|
||||
|
||||
newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
|
||||
newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
|
||||
}
|
@@ -1,254 +0,0 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
PYTHON_REQ_USE='sqlite,ssl'
|
||||
|
||||
inherit edo toolchain-funcs python-single-r1 qmake-utils verify-sig xdg
|
||||
|
||||
DESCRIPTION='Ebook management application'
|
||||
HOMEPAGE='https://calibre-ebook.com/'
|
||||
SRC_URI="
|
||||
https://download.calibre-ebook.com/${PV}/${P}.tar.xz
|
||||
verify-sig? ( https://calibre-ebook.com/signatures/${P}.tar.xz.sig )
|
||||
"
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/kovidgoyal.gpg
|
||||
|
||||
LICENSE='
|
||||
GPL-3+
|
||||
GPL-3
|
||||
GPL-2+
|
||||
GPL-2
|
||||
GPL-1+
|
||||
LGPL-3+
|
||||
LGPL-2.1+
|
||||
LGPL-2.1
|
||||
BSD
|
||||
MIT
|
||||
Old-MIT
|
||||
Apache-2.0
|
||||
public-domain
|
||||
|| ( Artistic GPL-1+ )
|
||||
CC-BY-3.0
|
||||
OFL-1.1
|
||||
PSF-2
|
||||
'
|
||||
SLOT='0'
|
||||
KEYWORDS='~amd64 ~arm64'
|
||||
IUSE='+font-subsetting ios speech +system-mathjax test +udisks unrar'
|
||||
|
||||
RESTRICT='!test? ( test )'
|
||||
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
# Qt slotted dependencies are used because the libheadless.so plugin links to
|
||||
# QT_*_PRIVATE_ABI. It only uses core/gui/dbus.
|
||||
COMMON_DEPEND="${PYTHON_DEPS}
|
||||
app-i18n/uchardet
|
||||
>=app-text/hunspell-1.7:=
|
||||
>=app-text/podofo-0.10.0:=
|
||||
app-text/poppler[utils]
|
||||
dev-libs/hyphen:=
|
||||
>=dev-libs/icu-57.1:=
|
||||
dev-libs/openssl:=
|
||||
dev-libs/snowball-stemmer:=
|
||||
$(python_gen_cond_dep '
|
||||
>=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
|
||||
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
|
||||
>=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
|
||||
dev-python/dnspython[${PYTHON_USEDEP}]
|
||||
>=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}]
|
||||
>=dev-python/html5-parser-0.4.9[${PYTHON_USEDEP}]
|
||||
dev-python/jeepney[${PYTHON_USEDEP}]
|
||||
>=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
|
||||
dev-python/lxml-html-clean[${PYTHON_USEDEP}]
|
||||
>=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
|
||||
>=dev-python/msgpack-0.6.2[${PYTHON_USEDEP}]
|
||||
>=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
|
||||
>=dev-python/pillow-3.2.0[jpeg,truetype,webp,zlib,${PYTHON_USEDEP}]
|
||||
>=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/pychm-0.8.6[${PYTHON_USEDEP}]
|
||||
dev-python/pykakasi[${PYTHON_USEDEP}]
|
||||
>=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
|
||||
dev-python/pyqt6[gui,network,opengl,printsupport,quick,svg,widgets,${PYTHON_USEDEP}]
|
||||
dev-python/pyqt6-webengine[widgets,${PYTHON_USEDEP}]
|
||||
dev-python/regex[${PYTHON_USEDEP}]
|
||||
dev-python/xxhash[${PYTHON_USEDEP}]
|
||||
>=dev-python/zeroconf-0.75.0[${PYTHON_USEDEP}]
|
||||
')
|
||||
dev-qt/qtbase:6=[gui,widgets]
|
||||
dev-qt/qtimageformats:6
|
||||
dev-util/desktop-file-utils
|
||||
dev-util/gtk-update-icon-cache
|
||||
media-fonts/liberation-fonts
|
||||
media-libs/fontconfig:=
|
||||
>=media-libs/freetype-2:=
|
||||
>=media-libs/libmtp-1.1.11:=
|
||||
>=media-gfx/optipng-0.7.6
|
||||
>=media-video/ffmpeg-6:=
|
||||
virtual/libusb:1=
|
||||
x11-misc/shared-mime-info
|
||||
>=x11-misc/xdg-utils-1.0.2-r2
|
||||
font-subsetting? ( $(python_gen_cond_dep 'dev-python/fonttools[${PYTHON_USEDEP}]') )
|
||||
ios? (
|
||||
>=app-pda/usbmuxd-1.0.8
|
||||
>=app-pda/libimobiledevice-1.2.0
|
||||
)
|
||||
speech? (
|
||||
$(python_gen_cond_dep 'app-accessibility/speech-dispatcher[python,${PYTHON_USEDEP}]')
|
||||
dev-python/pyqt6[multimedia,speech]
|
||||
)
|
||||
system-mathjax? ( >=dev-libs/mathjax-3:= )
|
||||
udisks? ( virtual/libudev )
|
||||
unrar? ( dev-python/unrardll )
|
||||
"
|
||||
RDEPEND="${COMMON_DEPEND}
|
||||
udisks? ( sys-fs/udisks:2 )"
|
||||
DEPEND="${COMMON_DEPEND}
|
||||
test? ( $(python_gen_cond_dep '>=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]') )
|
||||
"
|
||||
BDEPEND="$(python_gen_cond_dep '
|
||||
>=dev-python/pyqt-builder-1.10.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/sip-5[${PYTHON_USEDEP}]
|
||||
')
|
||||
virtual/pkgconfig
|
||||
system-mathjax? ( dev-lang/rapydscript-ng )
|
||||
verify-sig? ( sec-keys/openpgp-keys-kovidgoyal )
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
# Skip calling a binary (JxrDecApp) from libjxr which is used for tests
|
||||
# We don't (yet?) package libjxr and it seems to be dead upstream
|
||||
# (last commit in 2017)
|
||||
"${FILESDIR}/${PN}-7.0.0-jxr-test.patch"
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# Warning:
|
||||
#
|
||||
# While it might be rather tempting to add yet another sed here,
|
||||
# please don't. There have been several bugs in Gentoo's packaging
|
||||
# of calibre from seds-which-become-stale. Please consider
|
||||
# creating a patch instead, but in any case, run the test suite
|
||||
# and ensure it passes.
|
||||
#
|
||||
# If in doubt about a problem, checking Fedora's packaging is recommended.
|
||||
|
||||
# Disable unnecessary privilege dropping for bug #287067.
|
||||
sed -e 's:if os.geteuid() == 0:if False and os.geteuid() == 0:' \
|
||||
-i setup/install.py || die 'sed failed to patch install.py'
|
||||
|
||||
# This is only ever used at build time. It contains a small embedded copy
|
||||
# of the rapydscript-ng compiler usable inside of qtwebengine, if you don't
|
||||
# have rapydscript-ng (a nodejs package) itself installed. Its only purpose
|
||||
# is to build some resources that come bundled in dist tarballs already...
|
||||
# and which we may also need to regenerate e.g. to use system-mathjax.
|
||||
#
|
||||
# However, running qtwebengine violates the portage sandbox (among other
|
||||
# things, it tries to create directories in /usr! amazing) so this is a
|
||||
# wash anyway. The only real solution here is to package rapydscript-ng.
|
||||
#
|
||||
# We do not need it at build time, and *no one* needs it at install time.
|
||||
# Delete the cruft.
|
||||
rm -r resources/rapydscript/ || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# TODO: get qmake called by setup.py to respect CC and CXX too
|
||||
tc-export CC CXX
|
||||
|
||||
# bug 821871
|
||||
local MY_LIBDIR="${ESYSROOT}/usr/$(get_libdir)"
|
||||
export FT_LIB_DIR="${MY_LIBDIR}" HUNSPELL_LIB_DIR="${MY_LIBDIR}" PODOFO_LIB_DIR="${MY_LIBDIR}"
|
||||
export QMAKE="$(qt6_get_bindir)/qmake"
|
||||
|
||||
edo ${EPYTHON} setup.py build
|
||||
edo ${EPYTHON} setup.py gui
|
||||
|
||||
# A few different resources are bundled in the distfile by default, because
|
||||
# not all systems necessarily have them. We un-vendor them, using the
|
||||
# upstream integrated approach if possible. See setup/revendor.py and
|
||||
# consider migrating other resources to this if they do not use it, in
|
||||
# *preference* over manual rm'ing.
|
||||
edo ${EPYTHON} setup.py liberation_fonts \
|
||||
--path-to-liberation_fonts "${EPREFIX}"/usr/share/fonts/liberation-fonts \
|
||||
--system-liberation_fonts
|
||||
if use system-mathjax; then
|
||||
edo ${EPYTHON} setup.py mathjax --path-to-mathjax "${EPREFIX}"/usr/share/mathjax --system-mathjax
|
||||
edo ${EPYTHON} setup.py rapydscript
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# Skipped tests:
|
||||
local _test_excludes=(
|
||||
# unpackaged Python dependency: py7zr
|
||||
7z
|
||||
# unpackaged Python dependency: pyzstd
|
||||
test_zstd
|
||||
# unpackaged TTS backend (optional at runtime): https://github.com/rhasspy/piper
|
||||
piper
|
||||
# tests if a completely unused module is bundled
|
||||
pycryptodome
|
||||
|
||||
$(usev !speech speech_dispatcher)
|
||||
$(usev !unrar test_unrar)
|
||||
|
||||
# undocumented reasons
|
||||
test_mem_leaks
|
||||
test_searching
|
||||
)
|
||||
|
||||
# Some of these tests weren't practical to split out into distinct tests, so
|
||||
# have a different control mechanism
|
||||
use speech || export SKIP_SPEECH_TESTS=1
|
||||
|
||||
edo ${PYTHON} setup.py test "${_test_excludes[@]/#/--exclude-test-name=}"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
|
||||
# File '/usr/lib/python2.6/locale.py', line 486, in getdefaultlocale
|
||||
# return _parse_localename(localename)
|
||||
# File '/usr/lib/python2.6/locale.py', line 418, in _parse_localename
|
||||
# raise ValueError, 'unknown locale: %s' % localename
|
||||
#ValueError: unknown locale: 46
|
||||
export -n LANG LANGUAGE ${!LC_*}
|
||||
export LC_ALL=C.utf8 # bug #709682
|
||||
|
||||
# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
|
||||
# variables to point to our fake temporary $HOME.
|
||||
export HOME="${T}/fake_homedir"
|
||||
export CALIBRE_CONFIG_DIRECTORY="${HOME}/.config/calibre"
|
||||
mkdir -p "${CALIBRE_CONFIG_DIRECTORY}" || die
|
||||
|
||||
addpredict /dev/dri #665310
|
||||
|
||||
# If this directory doesn't exist, zsh completion won't install
|
||||
dodir /usr/share/zsh/site-functions
|
||||
|
||||
edo "${PYTHON}" setup.py install \
|
||||
--staging-root="${ED}/usr" \
|
||||
--prefix="${EPREFIX}/usr" \
|
||||
--libdir="${EPREFIX}/usr/$(get_libdir)" \
|
||||
--staging-libdir="${ED}/usr/$(get_libdir)" \
|
||||
--system-plugins-location="${EPREFIX}/usr/share/calibre/system-plugins"
|
||||
|
||||
cp -r man-pages/ "${ED}"/usr/share/man || die
|
||||
|
||||
find "${ED}"/usr/share -type d -empty -delete || die
|
||||
|
||||
python_fix_shebang "${ED}/usr/bin"
|
||||
|
||||
python_optimize "${ED}"/usr/"$(get_libdir)"/calibre "${D}/$(python_get_sitedir)"
|
||||
|
||||
newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
|
||||
newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
diff --git a/src/calibre/utils/img.py b/src/calibre/utils/img.py
|
||||
index b61627b63e..ff51c76e75 100644
|
||||
--- a/src/calibre/utils/img.py
|
||||
+++ b/src/calibre/utils/img.py
|
||||
@@ -129,8 +129,6 @@ def image_from_data(data):
|
||||
i = QImage()
|
||||
if not i.loadFromData(data):
|
||||
q = what(None, data)
|
||||
- if q == 'jxr':
|
||||
- return load_jxr_data(data)
|
||||
raise NotImage(f'Not a valid image (detected type: {q})')
|
||||
return i
|
||||
|
||||
@@ -693,13 +691,6 @@ def test(): # {{{
|
||||
despeckle_image(img)
|
||||
remove_borders_from_image(img)
|
||||
image_to_data(img, fmt='GIF')
|
||||
- p = subprocess.Popen([get_exe_path('JxrDecApp'), '-h'],
|
||||
- creationflags=subprocess.DETACHED_PROCESS if iswindows else 0,
|
||||
- stdout=subprocess.PIPE)
|
||||
- raw, _ = p.communicate()
|
||||
- p.wait()
|
||||
- if b'JPEG XR Decoder Utility' not in raw:
|
||||
- raise SystemExit('Failed to run JxrDecApp')
|
||||
# }}}
|
||||
|
||||
|
@@ -1,13 +0,0 @@
|
||||
# /etc/conf.d/calibre-server
|
||||
# Change this to the user you want to run calibre-server as.
|
||||
# You may specify a group too, after a colon
|
||||
# NOTE: This must be set and not to root!
|
||||
CALIBRE_USER=
|
||||
|
||||
# Set the path of the library to serve.
|
||||
# Defaults to the default location for CALIBRE_USER.
|
||||
#CALIBRE_LIBRARY='<user home directory>/Calibre Library'
|
||||
|
||||
# Extra options to pass to calibre-server.
|
||||
# See the calibre-server man page for more options.
|
||||
#CALIBRE_SERVER_OPTS="--userdb /srv/calibre/users.sqlite --enable-auth --worker-count 10 --port 8080"
|
@@ -1,58 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License, v2 or later
|
||||
|
||||
depend() {
|
||||
need net
|
||||
need localmount
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
if [ "${CALIBRE_USER}" = "" -o "${CALIBRE_USER}" = "root" ] ; then
|
||||
eerror "Please edit /etc/conf.d/calibre-server"
|
||||
eerror "You have to specify a user to run calibre-server as, as we will not run it as root!"
|
||||
eerror "Modify CALIBRE_USER to your needs (you can also add a group, after a colon)"
|
||||
return 1
|
||||
fi
|
||||
if ! getent passwd "${CALIBRE_USER%:*}" >/dev/null ; then
|
||||
eerror "Please edit /etc/conf.d/calibre-server"
|
||||
eerror "Your user has to exist!"
|
||||
return 1
|
||||
fi
|
||||
if [ "${CALIBRE_USER%:*}" != "${CALIBRE_USER}" ] ; then
|
||||
if ! getent group "${CALIBRE_USER#*:}" >/dev/null ; then
|
||||
eerror "Please edit /etc/conf.d/calibre-server"
|
||||
eerror "Your group has to exist too!"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
if [ "${CALIBRE_LIBRARY}" = "" ] ; then
|
||||
CALIBRE_USER_HOME=$(getent passwd "${CALIBRE_USER%:*}" | cut -d ':' -f 6)
|
||||
CALIBRE_LIBRARY="${CALIBRE_USER_HOME}/Calibre Library"
|
||||
fi
|
||||
if [ ! -d "${CALIBRE_LIBRARY}" ] ; then
|
||||
eerror "Please edit /etc/conf.d/calibre-server"
|
||||
eerror "The Calibre library, '${CALIBRE_LIBRARY},' does not exist."
|
||||
eerror "Please modify CALIBRE_LIBRARY to point to a valid library."
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
start() {
|
||||
checkconfig || return $?
|
||||
local pidfile=/var/run/calibre-server.pid
|
||||
ebegin "Starting calibre-server"
|
||||
start-stop-daemon --user "${CALIBRE_USER}" \
|
||||
--pidfile "${pidfile}" --make-pidfile --background --exec /usr/bin/calibre-server \
|
||||
-- ${CALIBRE_OPTS} "${CALIBRE_LIBRARY}"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping calibre-server"
|
||||
start-stop-daemon --stop --user "${CALIBRE_USER}" \
|
||||
--pidfile /var/run/calibre-server.pid
|
||||
eend $?
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>eschwartz@gentoo.org</email>
|
||||
<name>Eli Schwartz</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="github">kovidgoyal/calibre</remote-id>
|
||||
<changelog>https://calibre-ebook.com/whats-new</changelog>
|
||||
</upstream>
|
||||
<use>
|
||||
<flag name="font-subsetting">Enable font subsetting support</flag>
|
||||
<flag name="system-mathjax">Use a system copy of mathjax</flag>
|
||||
<flag name="unrar">Enable support for comic books compressed with the non-free Rar format</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
@@ -1,5 +1,3 @@
|
||||
DIST cudnn-linux-x86_64-9.10.2.21_cuda12-archive.tar.xz 1003149584 BLAKE2B 17d56a2e459df88a7ae6c27c1edc093c3b58e6732e49d001d277e159ff90face0b722db9edd089bf36383dd4f48e225582583e2fbf52fae134787349bfda19c6 SHA512 3bb42370ea5be3eade3a3203de3d925ed67169e7c019aee9e5c3e9d77422fd2c3e6682ecb7398e4be20d106b9f29ae8ff3adcdba891e129fbb04a441f165713f
|
||||
DIST cudnn-linux-x86_64-9.11.0.98_cuda12-archive.tar.xz 845552612 BLAKE2B 3c0c9ac68fe9436b5ebbb3483e848d7d33fb2c6d8bfc426b32ddad3c9efab5129d6f1aabc78c31c73c01f3408970e864a12d4c9fa6cca562759f580d80c5571e SHA512 1a45c46409b3ca8c06dda29af8449cd2464acfe5215d860dcdc86abdba346758ef4eaa2a487908a845d95ada1c4f899fe98fdaface3d03c0ff8fdac3221beb32
|
||||
EBUILD cudnn-9.10.2.21.ebuild 744 BLAKE2B 85b70faa66ca63122260f47e27b1a0c2ee16e3ab3d6809ede6ada5e9c1b53cc3458dc56d05270443e0a84d33ae8bddd767f77ed54e80f0498d4190aa35faa727 SHA512 acc2caae1c2a15558bfc1b0c2f7556f23af55891a8a8ac2c1340e57340a1124ef49a8046ec308f694e87af72f2c823785f0f476ec469f21a0155ae0e3a7018fc
|
||||
EBUILD cudnn-9.11.0.98.ebuild 744 BLAKE2B 85b70faa66ca63122260f47e27b1a0c2ee16e3ab3d6809ede6ada5e9c1b53cc3458dc56d05270443e0a84d33ae8bddd767f77ed54e80f0498d4190aa35faa727 SHA512 acc2caae1c2a15558bfc1b0c2f7556f23af55891a8a8ac2c1340e57340a1124ef49a8046ec308f694e87af72f2c823785f0f476ec469f21a0155ae0e3a7018fc
|
||||
MISC metadata.xml 254 BLAKE2B b855316ec6a32691e84730979c9a077765d46802f09c19f3a06f2cddf677674c9a2ea24c9b57a0fc6344d7f70276ca507a68f5fa690555360665ac494fca54c2 SHA512 5f6faacd216c7ece09e847c09115add5261e7a899e0b0c9304f2ee72e2d0ad208338939e4e37946008bdc81fbbacf415fb220c5c1f9832b17f18c6778d0c0368
|
||||
|
@@ -1,28 +0,0 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit unpacker
|
||||
|
||||
CUDA_V='12'
|
||||
|
||||
DESCRIPTION='NVIDIA Accelerated Deep Learning on GPU library'
|
||||
HOMEPAGE='https://developer.nvidia.com/cudnn'
|
||||
SRC_URI="https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-${PV}_cuda${CUDA_V}-archive.tar.xz"
|
||||
S="${WORKDIR}/cudnn-linux-x86_64-${PV%%_*}_cuda${CUDA_V}-archive"
|
||||
|
||||
LICENSE='NVIDIA-cuDNN'
|
||||
SLOT="0/$(ver_cut 1)"
|
||||
KEYWORDS='-* ~amd64 ~amd64-linux'
|
||||
RESTRICT='mirror'
|
||||
|
||||
RDEPEND="=dev-util/nvidia-cuda-toolkit-${CUDA_V}*"
|
||||
|
||||
QA_PREBUILT='/opt/cuda/targets/x86_64-linux/lib/*'
|
||||
|
||||
src_install() {
|
||||
insinto /opt/cuda/targets/x86_64-linux
|
||||
|
||||
doins -r include lib
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
AUX cuda-config.in 407 BLAKE2B 5f7a0d50d774db58c180b767f00bead7c7dbf5f6b3b4a2f960dfc3b8450f7abf5c2b67c6620c5318f1331646dd2003d61c70a4c31359efd16ff418ecc9d0b446 SHA512 363903b999c43a47a48c52e8898c6044fadcc66d259338ee22863e859c2bc9873a2f1392aa83c9182486d3aa4eaeb5f164cf8ccf29cc74fd8ad56245f76a039a
|
||||
AUX nvidia-cuda-toolkit-glibc-2.41-r1.patch 4855 BLAKE2B e06dc68c473fb427c8347343652dbd93f209fb0b19ade54aba7bb2a6ab5344b896d1f2dc86ed4e0ec1a4de739716fe30ff1ff3629d73eb6a4c081c25a7454fae SHA512 037c906903cf7058543c6636263d93ce5b80bedcc601417c7e23758966c428434593d61ee7e32d51e07c5f16ee595510f1ce7db9f000f906fe96928a3b4ed5fb
|
||||
AUX parse_manifest.py 8488 BLAKE2B 8ac93a39276eaf89b41a5b0baa168b5974423077b0fd4b22841451514513c914fb4188863d73591f89975cc833dcb88bde289b0676f218715d8735a2d5c0f159 SHA512 4b2d9de215858d25319254666a22a184e26510a3488fc97a939704fab1e81a9baa363fc1168129618ce076de84d7acbeb71d98b8be272017f47b54c237d9b9a4
|
||||
DIST cuda_12.9.1_575.57.08_linux.run 5860276058 BLAKE2B 482aee91731ca490956f3cf375e973b15ddcf69b295693d34488958e2592e5c55dabed589aa4f5f4ad59a50ae00b4523e5ebf760a613b634ca00164d363fb567 SHA512 fc29c5fc1121fb6634f1fe396abe7f34d351686454516269e9143e678ea178f906a35b916b8bb2d96ecfcfc705dda7d0f4547f7e7f00d36e392d981a766b6a56
|
||||
DIST cuda_12.9.1_575.57.08_linux_sbsa.run 5074335372 BLAKE2B 71782c3e7e39503aa914c8e02b7e5e44c856bd98bb9d1d46b90dfb7db4a2becb03ed1467fbca34c2ea1147202deb379198495007d69c7987320e138a63f2164e SHA512 91e3b457b6c36c8c3f07ae6fbd24f3f90b9ea22397059f91655ad68c32b96547e2c732af987a0c5ea63c37c43d48f199d97b9e84068c145633ebf67c34465ac6
|
||||
EBUILD nvidia-cuda-toolkit-12.9.1.ebuild 10590 BLAKE2B bd84a00b2c334de9625a6d00250372b3a227746d22efec9f24f6679523a45cbd39825bc28fb002abced5fa447769d416c0706362cf3d549074a2d42e46520c44 SHA512 4cafc7bdbc64d039cd922286ddb990dc8544a23427191c639bc36bbd93117521d7e49efb363a2a448158f9b392f2357cf41c82785dff5475ec07985b78ebd6fd
|
||||
MISC metadata.xml 843 BLAKE2B 5ed06252572415290175ff90b66c1e13b67d282085295586e046019cc7d28b6e11728fba310bcf4101caaf09f4d1383f8df3f1c97325fa9e979dfa06e4704571 SHA512 208c83e0d968796d526b7223c5221f0805401b31420807a21f078797cba8e3f141c654017331a89649af2aa29a40cc1ff28f9cfa3ba2e6bee85fa76957c01837
|
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
SUPPORT_GCC_VERSIONS_BY_CUDA="CUDA_SUPPORTED_GCC"
|
||||
|
||||
_print_help() {
|
||||
cat <<- EOF
|
||||
Usage:
|
||||
$(basename $0) [options]
|
||||
|
||||
-s | --supported Returns by current CUDA supported gcc versions
|
||||
-h | --help Shows this help
|
||||
EOF
|
||||
}
|
||||
|
||||
case ${1} in
|
||||
-s|--supported)
|
||||
echo "${SUPPORT_GCC_VERSIONS_BY_CUDA}"
|
||||
exit 0
|
||||
;;
|
||||
-h|--help)
|
||||
_print_help
|
||||
exit 255
|
||||
;;
|
||||
*)
|
||||
_print_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
@@ -1,119 +0,0 @@
|
||||
From cae8ab12c9f981f110bb2e1318d9c5306e3a2d81 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Zander <negril.nx@gmail.com>
|
||||
Date: Sat, 8 Feb 2025 16:34:42 +0100
|
||||
Subject: [PATCH] Updates headers for glibc-2.41
|
||||
|
||||
Match the extern definitions in cuda-crt headers with the changes in glibc-2.41.
|
||||
|
||||
/usr/include/bits/mathcalls.h(79): error: exception specification is
|
||||
incompatible with that of previous function "cospi" (declared at line 2601
|
||||
of
|
||||
/opt/cuda-12.8.0/bin/../targets/x86_64-linux/include/crt/math_functions.h)
|
||||
|
||||
extern double cospi (double __x) noexcept (true); extern double __cospi (double __x) noexcept (true);
|
||||
|
||||
/opt/cuda-12.8.1/bin/../targets/x86_64-linux/include/crt/math_functions.hpp:2982:17: error: 'sinpi' is missing exception specification 'throw()'
|
||||
2982 | __func__(double sinpi(double a))
|
||||
| ^
|
||||
| throw()
|
||||
/opt/cuda-12.8.1/bin/../targets/x86_64-linux/include/crt/func_macro.h:37:16: note: expanded from macro '__func__'
|
||||
37 | inline decl
|
||||
| ^
|
||||
/opt/cuda-12.8.1/bin/../targets/x86_64-linux/include/crt/math_functions.h:6006:17: note: previous declaration is here
|
||||
6006 | __func__(double sinpi(double a));
|
||||
|
||||
See-Also: https://sourceware.org/git/?p=glibc.git;a=commit;h=0ae0af68d8fa3bf6cbe1e4f1de5929ff71de67b3
|
||||
Signed-off-by: Paul Zander <negril.nx@gmail.com>
|
||||
|
||||
diff --git a/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h b/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h
|
||||
index d8201f9..a9b19d4 100644
|
||||
--- a/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h
|
||||
+++ b/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h
|
||||
@@ -2553,7 +2553,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rcbrt
|
||||
*
|
||||
* \note_accuracy_double
|
||||
*/
|
||||
+#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 41
|
||||
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x) noexcept (true);
|
||||
+#else
|
||||
extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x);
|
||||
+#endif
|
||||
/**
|
||||
* \ingroup CUDA_MATH_SINGLE
|
||||
* \brief Calculate the sine of the input argument
|
||||
@@ -2576,7 +2580,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi
|
||||
*
|
||||
* \note_accuracy_single
|
||||
*/
|
||||
+#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 41
|
||||
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x) noexcept (true);
|
||||
+#else
|
||||
extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x);
|
||||
+#endif
|
||||
/**
|
||||
* \ingroup CUDA_MATH_DOUBLE
|
||||
* \brief Calculate the cosine of the input argument
|
||||
@@ -2598,7 +2606,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpi
|
||||
*
|
||||
* \note_accuracy_double
|
||||
*/
|
||||
+#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 41
|
||||
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x) noexcept (true);
|
||||
+#else
|
||||
extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x);
|
||||
+#endif
|
||||
/**
|
||||
* \ingroup CUDA_MATH_SINGLE
|
||||
* \brief Calculate the cosine of the input argument
|
||||
@@ -2620,7 +2632,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi
|
||||
*
|
||||
* \note_accuracy_single
|
||||
*/
|
||||
+#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 41
|
||||
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x) noexcept (true);
|
||||
+#else
|
||||
extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x);
|
||||
+#endif
|
||||
/**
|
||||
* \ingroup CUDA_MATH_DOUBLE
|
||||
* \brief Calculate the sine and cosine of the first input argument
|
||||
diff --git a/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.hpp b/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.hpp
|
||||
index cc09b91..11eec71 100644
|
||||
--- a/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.hpp
|
||||
+++ b/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.hpp
|
||||
@@ -2979,7 +2979,7 @@ __func__(double rcbrt(const double a))
|
||||
return t;
|
||||
}
|
||||
|
||||
-__func__(double sinpi(double a))
|
||||
+__func__(double sinpi(double a)) throw()
|
||||
{
|
||||
int n;
|
||||
|
||||
@@ -3009,7 +3009,7 @@ __func__(double sinpi(double a))
|
||||
return a;
|
||||
}
|
||||
|
||||
-__func__(double cospi(double a))
|
||||
+__func__(double cospi(double a)) throw()
|
||||
{
|
||||
int n;
|
||||
|
||||
@@ -3340,12 +3340,12 @@ __func__(float rcbrtf(const float a))
|
||||
return static_cast<float>(rcbrt(static_cast<double>(a)));
|
||||
}
|
||||
|
||||
-__func__(float sinpif(const float a))
|
||||
+__func__(float sinpif(const float a)) throw()
|
||||
{
|
||||
return static_cast<float>(sinpi(static_cast<double>(a)));
|
||||
}
|
||||
|
||||
-__func__(float cospif(const float a))
|
||||
+__func__(float cospif(const float a)) throw()
|
||||
{
|
||||
return static_cast<float>(cospi(static_cast<double>(a)));
|
||||
}
|
||||
--
|
||||
2.48.1
|
||||
|
@@ -1,223 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2024-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
#
|
||||
#
|
||||
# Takes the manifests/*.xml file from the NVIDIA CUDA Toolkit as input.
|
||||
# Those files contain a nested tree of package items.
|
||||
#
|
||||
# For each package node a if block is output that checks the package's
|
||||
# name attribute against the environment provided array SKIP_COMPONENTS
|
||||
# and skips that whole package if it's listed in it.
|
||||
#
|
||||
# Each item contains four nodes that reference things to install,
|
||||
# `dir`, `file`, `desktopFile`, & `pcfile`, and metadata that further
|
||||
# detail these. This script will output calls to do* calls that
|
||||
# use the metadata.
|
||||
# - dodir would create an empty file - we handle this in dofile
|
||||
# - dofile copies a regex file glob
|
||||
# - dodesktopFile creates a .desktop file
|
||||
# - dopcfile creates a pkgconfig file
|
||||
#
|
||||
# The resulting bash code can be run inside src_install().
|
||||
#
|
||||
# Usage: python parse_manifest.py <cuda_aarch64.xml|cuda_x86_64.xml>
|
||||
|
||||
|
||||
import argparse
|
||||
import xml.etree.ElementTree
|
||||
|
||||
import defusedxml.ElementTree
|
||||
from pathlib import Path
|
||||
|
||||
ind = "\t"
|
||||
indent = 1
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('filename') # positional argument
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
basedir = Path(args.filename).parents[1]
|
||||
|
||||
et = defusedxml.ElementTree.parse(args.filename)
|
||||
|
||||
# Find all packages under the package with the id main (i.e. under "CUDA Installer")
|
||||
for e in et.findall("[@id='main']/package"):
|
||||
def p_package(el: xml.etree.ElementTree.Element, level: int = 0):
|
||||
|
||||
skip = {
|
||||
"Documentation", # obsolete
|
||||
"Driver", # unused
|
||||
# "Kernel Objects", # split
|
||||
# "Demo Suite",
|
||||
# "Visual Tools",
|
||||
# old eclipse
|
||||
# "nsight",
|
||||
# old java
|
||||
# "nvvp",
|
||||
# "cuda-gdb-src"
|
||||
}
|
||||
|
||||
name = el.get("name")
|
||||
|
||||
# trim leading CUDA and trailing version
|
||||
if name.startswith("CUDA"):
|
||||
name2 = ' '.join(name.split(" ")[1:-1])
|
||||
else:
|
||||
name2 = name
|
||||
|
||||
if name2 in skip:
|
||||
return
|
||||
|
||||
# avoid having to deal with whitespaces in bash
|
||||
name2 = name2.replace(" ", "_")
|
||||
|
||||
path = ""
|
||||
|
||||
print(f"{ind * (level + 0) * indent}if ! has {name2} \"${{SKIP_COMPONENTS[@]}}\"; then # \"{name}\"")
|
||||
|
||||
# output attributes from unhandled tags
|
||||
for child in el:
|
||||
if child.tag == "package":
|
||||
continue
|
||||
if child.tag == "file":
|
||||
continue
|
||||
if child.tag == "desktopFile":
|
||||
continue
|
||||
if child.tag == "pcfile":
|
||||
continue
|
||||
for attrib in child.attrib:
|
||||
print(f"{child.tag} {attrib}={child.attrib[attrib]}")
|
||||
|
||||
# <name>CUDA Installer</name>
|
||||
# only for CUDA Installer
|
||||
# unused
|
||||
for node in el.findall("./name"):
|
||||
print(f"{ind * (level + 1) * indent}# {node.tag}: \"{node.text}\"")
|
||||
|
||||
# <type>compiler</type>
|
||||
# category. We use the package name instead.
|
||||
# unused
|
||||
# for node in el.findall("./type"):
|
||||
# print(f"{ind * (level + 1) * indent}# {node.tag}: \"{node.text}\"")
|
||||
|
||||
# <priority>1</priority>
|
||||
# probably sorting for the tui installer
|
||||
# unused
|
||||
# for node in el.findall("./priority"):
|
||||
# print(f"{ind * (level + 1) * indent}# {node.tag}: \"{node.text}\"")
|
||||
|
||||
# <single-selection/>
|
||||
# proably for tui installer
|
||||
# unused
|
||||
# for node in el.findall("./single-selection"):
|
||||
# print(f"{ind * (level + 1) * indent}# {node.tag}: \"{node.text}\"")
|
||||
|
||||
# <koversion>2.24.2</koversion>
|
||||
# version of the installed kernel object (Kernel Objects only)
|
||||
# unused
|
||||
for node in el.findall("./koversion"):
|
||||
print(f"{ind * (level + 1) * indent}# {node.tag}: \"{node.text}\"")
|
||||
|
||||
# <installPath>/usr/local/cuda-12.8</installPath>
|
||||
# overrides the install location
|
||||
# unused
|
||||
# for node in el.findall("./installPath"):
|
||||
# print(f"{ind * (level + 1) * indent}# {node.tag}: \"{node.text}\"")
|
||||
|
||||
# <buildPath>./builds/cuda_cccl/</buildPath>
|
||||
# path where the package files are found
|
||||
# we cd into it
|
||||
for node in el.findall("./buildPath"):
|
||||
path = node.text.removeprefix('./')
|
||||
print(f"{ind * (level + 1) * indent}cd \"${{S}}/{path}\" || die \"cd ${{S}}/{path} failed\"")
|
||||
print()
|
||||
|
||||
# <dir>bin</dir>
|
||||
# would install empty dirs
|
||||
# unused
|
||||
# for node in el.findall("./dir"):
|
||||
# pass
|
||||
|
||||
# <file dir="bin/">.*</file>
|
||||
# <file>targets/x86_64-linux/lib/.*\.so</file>
|
||||
# regex glob of files to install.
|
||||
for node in el.findall("./file"):
|
||||
# unescape '.*' -> '*' & '\.' -> '.'
|
||||
file = (node.text
|
||||
.replace(".*", "*")
|
||||
.replace(r"\.", ".")
|
||||
.replace("x86_64", "${narch}")
|
||||
.replace("sbsa", "${narch}")
|
||||
)
|
||||
|
||||
# optional dir offset, we merge it into path
|
||||
dir = ""
|
||||
if "dir" in node.attrib:
|
||||
dir = f" \"{Path(node.attrib['dir'])}\""
|
||||
|
||||
filepath = basedir / path / file
|
||||
|
||||
# ignore existing symlinks ( include, lib* ) and the uninstallers
|
||||
if not filepath.is_symlink() and not file.endswith("-uninstaller"):
|
||||
print(f"{ind * (level + 1) * indent}dofile \"{file}\"{dir}")
|
||||
|
||||
# <pcfile description="CUDA Runtime Library">opencl-12.8.pc</pcfile>
|
||||
# create a pkgconfig file for the given description and lib name/version
|
||||
for node in el.findall("./pcfile"):
|
||||
offset = node.text.rfind('-')
|
||||
if offset == -1:
|
||||
raise RuntimeError(f"failed to split pcfile {node.text}")
|
||||
|
||||
lib_name = node.text[:offset]
|
||||
|
||||
if not node.text.endswith('.pc'):
|
||||
raise RuntimeError(f"pcfile does not end in '.pc' {node.text}")
|
||||
lib_version = node.text[offset+1:-3]
|
||||
|
||||
if "description" not in node.attrib:
|
||||
raise RuntimeError(f"no description for {node.text}")
|
||||
|
||||
subdir = ""
|
||||
if "subdir" in node.attrib:
|
||||
subdir = f" \"{node.attrib['subdir']}\""
|
||||
|
||||
print(f"{ind * (level + 1) * indent}dopcfile "
|
||||
f"\"{lib_name}\" "
|
||||
f"\"{lib_version}\" "
|
||||
f"\"{node.attrib['description']}\"{subdir}")
|
||||
|
||||
# <desktopFile
|
||||
# filename="nsight"
|
||||
# name="Nsight Eclipse Edition"
|
||||
# categories="Development;IDE;Debugger;ParallelComputing"
|
||||
# keywords="cuda;gpu;nvidia;debugger;"
|
||||
# iconPath="libnsight/icon.xpm"
|
||||
# execPath="bin/nsight"
|
||||
# tryExecPath="bin/nsight"
|
||||
# />
|
||||
# create a .desktop file
|
||||
for node in el.findall("./desktopFile"):
|
||||
print(f"{ind * (level + 1) * indent}dodesktopFile \\")
|
||||
print(f"{ind * (level + 2) * indent}\"{node.attrib['filename']}\" \\")
|
||||
print(f"{ind * (level + 2) * indent}\"{node.attrib['name']}\" \\")
|
||||
print(f"{ind * (level + 2) * indent}\"{node.attrib['categories']}\" \\")
|
||||
print(f"{ind * (level + 2) * indent}\"{node.attrib['keywords']}\" \\")
|
||||
print(f"{ind * (level + 2) * indent}\"{node.attrib['iconPath']}\" \\")
|
||||
print(f"{ind * (level + 2) * indent}\"{node.attrib['execPath']}\" \\")
|
||||
print(f"{ind * (level + 2) * indent}\"{node.attrib['tryExecPath']}\"")
|
||||
|
||||
# iterator over all nested packages
|
||||
for node in el.findall("./package"):
|
||||
p_package(node, level + 1)
|
||||
|
||||
print(f"{ind * (level + 0) * indent}fi")
|
||||
|
||||
p_package(e)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="project">
|
||||
<email>sci@gentoo.org</email>
|
||||
<name>Gentoo Science Project</name>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="clang">Depend on <pkg>llvm-core/clang</pkg> as host compiler</flag>
|
||||
<flag name="debugger">Install the CUDA debugger</flag>
|
||||
<flag name="nsight">Install profiling and optimizing tools (nsight-compute, nsight-systems)</flag>
|
||||
<flag name="profiler">Install the NVIDIA CUDA profiler (nvprof) and the related libraries</flag>
|
||||
<flag name="rdma">Enable infiniband support via <pkg>sys-cluster/rdma-core</pkg></flag>
|
||||
<flag name="sanitizer">Install compute-sanitizer tool</flag>
|
||||
<flag name="vis-profiler">Install the NVIDIA CUDA visual profiler (nvvp)</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
@@ -1,382 +0,0 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# shellcheck disable=SC2317
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{11..13} )
|
||||
inherit check-reqs edo toolchain-funcs
|
||||
inherit python-r1
|
||||
|
||||
DRIVER_PV="575.57.08"
|
||||
GCC_MAX_VER="14"
|
||||
CLANG_MAX_VER="19"
|
||||
|
||||
DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)"
|
||||
HOMEPAGE="https://developer.nvidia.com/cuda-zone"
|
||||
SRC_URI="
|
||||
amd64? (
|
||||
https://developer.download.nvidia.com/compute/cuda/${PV}/local_installers/cuda_${PV}_${DRIVER_PV}_linux.run
|
||||
)
|
||||
arm64? (
|
||||
https://developer.download.nvidia.com/compute/cuda/${PV}/local_installers/cuda_${PV}_${DRIVER_PV}_linux_sbsa.run
|
||||
)
|
||||
"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="NVIDIA-CUDA"
|
||||
|
||||
SLOT="0/${PV}" # UNSLOTTED
|
||||
# SLOT="${PV}" # SLOTTED
|
||||
|
||||
KEYWORDS="-* ~amd64 ~arm64 ~amd64-linux ~arm64-linux"
|
||||
IUSE="clang debugger examples nsight profiler rdma sanitizer"
|
||||
RESTRICT="bindist mirror strip test"
|
||||
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
# since CUDA 11, the bundled toolkit driver (== ${DRIVER_PV}) and the
|
||||
# actual required minimum driver version are different.
|
||||
RDEPEND="
|
||||
!clang? (
|
||||
<sys-devel/gcc-$(( GCC_MAX_VER + 1 ))_pre[cxx]
|
||||
)
|
||||
clang? (
|
||||
<llvm-core/clang-$(( CLANG_MAX_VER + 1 ))_pre
|
||||
)
|
||||
sys-process/numactl
|
||||
debugger? (
|
||||
${PYTHON_DEPS}
|
||||
)
|
||||
examples? (
|
||||
media-libs/freeglut
|
||||
media-libs/glu
|
||||
)
|
||||
nsight? (
|
||||
dev-util/nsight-compute
|
||||
dev-util/nsight-systems
|
||||
)
|
||||
rdma? (
|
||||
sys-cluster/rdma-core
|
||||
)
|
||||
"
|
||||
BDEPEND="
|
||||
$(python_gen_any_dep '
|
||||
dev-python/defusedxml[${PYTHON_USEDEP}]
|
||||
')
|
||||
"
|
||||
|
||||
# CUDA_PATH="/opt/cuda-${PV}" #950207
|
||||
CUDA_PATH="/opt/cuda"
|
||||
QA_PREBUILT="${CUDA_PATH#/}/*"
|
||||
|
||||
python_check_deps() {
|
||||
python_has_version "dev-python/defusedxml[${PYTHON_USEDEP}]"
|
||||
}
|
||||
|
||||
cuda-toolkit_check_reqs() {
|
||||
if use amd64; then
|
||||
export CHECKREQS_DISK_BUILD="7195M"
|
||||
elif use arm64; then
|
||||
export CHECKREQS_DISK_BUILD="6969M"
|
||||
fi
|
||||
|
||||
"check-reqs_pkg_${EBUILD_PHASE}"
|
||||
}
|
||||
|
||||
cuda_verify() {
|
||||
# only works with unpacked sources
|
||||
[[ "${EBUILD_PHASE}" != prepare ]] && return
|
||||
|
||||
# run self checks
|
||||
local compiler_versions GCC_HAS_VER CLANG_HAS_VER
|
||||
compiler_versions="$(
|
||||
grep -oP "unsupported (GNU|clang) version.*(gcc versions later than|clang version must be less than) [0-9]*" \
|
||||
"${S}"/builds/cuda_nvcc/targets/*/include/crt/host_config.h
|
||||
)"
|
||||
|
||||
GCC_HAS_VER="$( echo "${compiler_versions}" | grep gcc | grep -oP "(?<=than )[0-9]*")"
|
||||
if [[ "${GCC_MAX_VER}" -ne "${GCC_HAS_VER}" ]]; then
|
||||
eqawarn "check GCC_MAX_VER is ${GCC_MAX_VER} and should be ${GCC_HAS_VER}"
|
||||
fi
|
||||
|
||||
CLANG_HAS_VER="$(( $(echo "${compiler_versions}" | grep clang | grep -oP "(?<=than )[0-9]*") - 1 ))"
|
||||
if [[ "${CLANG_MAX_VER}" -ne "${CLANG_HAS_VER}" ]]; then
|
||||
eqawarn "check CLANG_MAX_VER is ${CLANG_MAX_VER} and should be ${CLANG_HAS_VER}"
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
cuda-toolkit_check_reqs
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
cuda-toolkit_check_reqs
|
||||
|
||||
if [[ "${MERGE_TYPE}" == binary ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# we need python for manifest parsing and to determine the supported python versions for cuda-gdb
|
||||
python_setup
|
||||
|
||||
if use amd64; then
|
||||
narch=x86_64
|
||||
elif use arm64; then
|
||||
narch=sbsa
|
||||
else
|
||||
die "unknown arch ${ARCH}"
|
||||
fi
|
||||
|
||||
export narch
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
cuda_verify
|
||||
|
||||
local exclude=(
|
||||
"cuda-installer"
|
||||
"*-uninstaller"
|
||||
"NVIDIA-Linux-${narch}-${DRIVER_PV}.run"
|
||||
"builds/cuda_documentation"
|
||||
"builds/cuda_nsight"
|
||||
"builds/cuda_nvvp"
|
||||
"builds/nsight_compute"
|
||||
"builds/nsight_systems"
|
||||
"builds/nvidia_fs"
|
||||
)
|
||||
|
||||
edob -m "Extracting ${A}" \
|
||||
bash "${DISTDIR}/${A}" --tar xf -X <(printf "%s\n" "${exclude[@]}")
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
pushd "builds/cuda_nvcc/targets/${narch}-linux" >/dev/null || die
|
||||
eapply -p5 "${FILESDIR}/nvidia-cuda-toolkit-glibc-2.41-r1.patch"
|
||||
popd >/dev/null || die
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
:
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
:
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local -x SKIP_COMPONENTS=(
|
||||
"Kernel_Objects"
|
||||
"Visual_Tools"
|
||||
"Documentation" # obsolete
|
||||
"cuda-gdb-src" # not used
|
||||
)
|
||||
|
||||
! use debugger && SKIP_COMPONENTS+=( "cuda-gdb" )
|
||||
! use examples && SKIP_COMPONENTS+=( "Demo_Suite" )
|
||||
! use profiler && SKIP_COMPONENTS+=( "cuda-cupti" "cuda-profiler-api" "nvprof" )
|
||||
! use sanitizer && SKIP_COMPONENTS+=( "compute-sanitizer" )
|
||||
|
||||
dodir "${CUDA_PATH}"
|
||||
into "${CUDA_PATH}"
|
||||
|
||||
dofile() {
|
||||
debug-print-function "${FUNCNAME[0]}" "$@"
|
||||
|
||||
if [[ $# -ne 1 ]] && [[ $# -ne 2 ]]; then
|
||||
die "${FUNCNAME[0]} must receive one or two arguments"
|
||||
fi
|
||||
|
||||
local _DESTDIR
|
||||
_DESTDIR="$(dirname "${CUDA_PATH}/${1%/}")${2:+/${2%/}}"
|
||||
mkdir -p "${ED}${_DESTDIR}" || die "mkdir ${_DESTDIR} failed"
|
||||
|
||||
local dir
|
||||
dir="$(dirname "${1}")"
|
||||
|
||||
if test -z "$(find "${dir}" -maxdepth 1 -name "$(basename "$1")" -print -quit)"; then
|
||||
if [[ -e "${ED}${_DESTDIR}/$(basename "${1}")" ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ "$1" == "targets/x86_64-linux/lib/stubs/libcusolverMg*" ]] ||
|
||||
[[ "$1" == "targets/x86_64-linux/lib/libcusparse.so.*" ]]; then
|
||||
return
|
||||
fi
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ -e "${ED}${_DESTDIR}/$(basename "${1}")" ]]; then
|
||||
# skip noisy warnings
|
||||
if [[ "$(basename "${1}")" == "include" ]] ||
|
||||
[[ "$(basename "${1}")" == "lib64" ]]; then
|
||||
return
|
||||
fi
|
||||
eqawarn "${ED}${_DESTDIR}/$(basename "${1}") exists"
|
||||
return
|
||||
fi
|
||||
|
||||
eval mv -i "${1}" "${ED}${_DESTDIR}" || die "mv failed ${PWD} / ${1} -> ${ED} ${_DESTDIR}"
|
||||
}
|
||||
|
||||
dopcfile() {
|
||||
[[ $# -eq 0 ]] && return
|
||||
|
||||
dodir "${CUDA_PATH}/pkgconfig"
|
||||
cat > "${ED}${CUDA_PATH}/pkgconfig/${1}.pc" <<-EOF || die "dopcfile"
|
||||
cudaroot=${EPREFIX}${CUDA_PATH}
|
||||
libdir=\${cudaroot}/targets/${narch}-linux/lib${4}
|
||||
includedir=\${cudaroot}/targets/${narch}-linux/include
|
||||
|
||||
Name: ${1}
|
||||
Description: ${3}
|
||||
Version: ${2}
|
||||
Libs: -L\${libdir} -l${1}
|
||||
Cflags: -I\${includedir}
|
||||
EOF
|
||||
}
|
||||
|
||||
pushd builds >/dev/null || die
|
||||
fix_executable_bit=(
|
||||
cuda_cupti/extras/CUPTI/samples/pc_sampling_utility/pc_sampling_utility_helper.h
|
||||
cuda_cupti/extras/CUPTI/samples/pc_sampling_continuous/libpc_sampling_continuous.pl
|
||||
|
||||
libcufile/gds/tools/run_gdsio.cfg
|
||||
)
|
||||
|
||||
if use amd64; then
|
||||
fix_executable_bit+=(
|
||||
cuda_opencl/targets/*/include/CL/cl.hpp
|
||||
|
||||
libcufile/targets/*/lib/libcufile_rdma_static.a
|
||||
libcufile/targets/*/lib/libcufile_static.a
|
||||
)
|
||||
fi
|
||||
chmod -x "${fix_executable_bit[@]}" || die "failed chmod"
|
||||
popd >/dev/null || die
|
||||
|
||||
ebegin "parsing manifest" "${S}/manifests/cuda_"*.xml # {{{
|
||||
|
||||
"${EPYTHON}" "${FILESDIR}/parse_manifest.py" "${S}/manifests/cuda_"*".xml" &> "${T}/install.sh" \
|
||||
|| die "failed to parse manifest"
|
||||
# shellcheck disable=SC1091
|
||||
source "${T}/install.sh" || die "failed to source install script"
|
||||
|
||||
eend $? # }}}
|
||||
|
||||
if use debugger; then
|
||||
if [[ -d "${ED}/${CUDA_PATH}/extras/Debugger/lib64" ]]; then
|
||||
rmdir "${ED}/${CUDA_PATH}/extras/Debugger/lib64" || die "remove debugger lib64"
|
||||
fi
|
||||
|
||||
find "${ED}/${CUDA_PATH}/bin" -maxdepth 1 -name "cuda-gdb-*-tui" -print0 | while read -rd $'\0' tui_name; do
|
||||
impl="$(basename "${tui_name}" | cut -d '-' -f 3 | tr '.' '_')"
|
||||
|
||||
if ! has "${impl}" "${PYTHON_COMPAT[@]}" || ! use "python_targets_${impl}"; then
|
||||
rm "${tui_name}" || die "tui-name rm ${tui_name}"
|
||||
sed -e "/$(basename "${tui_name}")\"/d" -i "${ED}/${CUDA_PATH}/bin/cuda-gdb" || die "tui_name sed"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# remove rdma libs (unless USE=rdma)
|
||||
if ! use rdma; then
|
||||
rm "${ED}/${CUDA_PATH}/targets/${narch}-linux/lib/libcufile_rdma"* || die "failed to remove rdma files"
|
||||
fi
|
||||
|
||||
# Add include and lib symlinks
|
||||
dosym -r "${CUDA_PATH}/targets/${narch}-linux/include" "${CUDA_PATH}/include"
|
||||
dosym -r "${CUDA_PATH}/targets/${narch}-linux/lib" "${CUDA_PATH}/$(get_libdir)"
|
||||
|
||||
find "${ED}/${CUDA_PATH}" -empty -delete || die
|
||||
|
||||
local ldpathextradirs pathextradirs
|
||||
|
||||
use debugger && ldpathextradirs+=":${EPREFIX}${CUDA_PATH}/extras/Debugger/lib64"
|
||||
use profiler && ldpathextradirs+=":${EPREFIX}${CUDA_PATH}/extras/CUPTI/lib64"
|
||||
|
||||
local revord=$(( 999999 - $(printf "%02d%02d%02d" "$(ver_cut 1)" "$(ver_cut 2)" "$(ver_cut 3)") ))
|
||||
newenvd - "99cuda${revord}" <<-EOF
|
||||
PATH=${EPREFIX}${CUDA_PATH}/bin${pathextradirs}
|
||||
PKG_CONFIG_PATH=${EPREFIX}${CUDA_PATH}/pkgconfig
|
||||
LDPATH=${EPREFIX}${CUDA_PATH}/$(get_libdir):${EPREFIX}${CUDA_PATH}/nvvm/lib64${ldpathextradirs}
|
||||
EOF
|
||||
|
||||
# CUDA prepackages libraries, don't revdep-build on them
|
||||
insinto /etc/revdep-rebuild
|
||||
newins - "80${PN}${revord}" <<-EOF
|
||||
SEARCH_DIRS_MASK="${EPREFIX}${CUDA_PATH}"
|
||||
EOF
|
||||
|
||||
# https://bugs.gentoo.org/926116
|
||||
insinto /etc/sandbox.d
|
||||
newins - "80${PN}" <<-EOF
|
||||
SANDBOX_PREDICT="/proc/self/task"
|
||||
EOF
|
||||
|
||||
# TODO drop and replace with runtime detection similar to what python does {{{
|
||||
# ATTENTION: change requires revbump, see link below for supported GCC # versions
|
||||
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements
|
||||
local cuda_supported_gcc=( 8.5 9.5 10 11 12 13 "${GCC_MAX_VER}" )
|
||||
|
||||
sed \
|
||||
-e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc[*]}:g" \
|
||||
"${FILESDIR}"/cuda-config.in > "${ED}/${CUDA_PATH}/bin/cuda-config" || die
|
||||
fperms +x "${CUDA_PATH}/bin/cuda-config"
|
||||
# }}}
|
||||
|
||||
# skip til cudnn has been changed #950207
|
||||
# if [[ "${SLOT}" != "${PV}" ]]; then
|
||||
# dosym -r "${CUDA_PATH}" "${CUDA_PATH%"-${PV}"}"
|
||||
# fi
|
||||
|
||||
fowners -R root:root "${CUDA_PATH}"
|
||||
}
|
||||
|
||||
pkg_postinst_check() {
|
||||
if tc-is-gcc || ! use clang; then
|
||||
if ver_test "$(gcc-major-version)" -gt "${GCC_MAX_VER}"; then
|
||||
ewarn
|
||||
ewarn "gcc > ${GCC_MAX_VER} will not work with CUDA"
|
||||
ewarn
|
||||
ewarn "Append --ccbin= pointing to a gcc bindir to the nvcc compiler flags (NVCCFLAGS)"
|
||||
ewarn "or set NVCC_CCBIN to the same bindir."
|
||||
ewarn " NVCCFLAGS=\"--ccbin=$(eval echo "${EPREFIX}/usr/*-linux-gnu/gcc-bin/${GCC_MAX_VER}")\""
|
||||
ewarn " NVCC_CCBIN=$(eval echo "${EPREFIX}/usr/*-linux-gnu/gcc-bin/${GCC_MAX_VER}")"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
|
||||
if tc-is-clang || use clang; then
|
||||
if ver_test "$(clang-major-version)" -gt "${CLANG_MAX_VER}"; then
|
||||
ewarn
|
||||
ewarn "clang > ${CLANG_MAX_VER} will not work with CUDA"
|
||||
ewarn
|
||||
ewarn "Append --ccbin= pointing to a clang bindir to the nvcc compiler flags (NVCCFLAGS)"
|
||||
ewarn "or set NVCC_CCBIN to the same bindir."
|
||||
ewarn " NVCCFLAGS=\"--ccbin=$(eval echo "${EPREFIX}/usr/lib/llvm/*/bin${CLANG_MAX_VER}")\""
|
||||
ewarn " NVCC_CCBIN=$(eval echo "${EPREFIX}/usr/lib/llvm/*/bin${CLANG_MAX_VER}")"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ ${MERGE_TYPE} != binary ]]; then
|
||||
pkg_postinst_check
|
||||
fi
|
||||
|
||||
if use profiler; then
|
||||
einfo
|
||||
einfo "nvidia-drivers restricts access to performance counters."
|
||||
einfo "You'll need to run profiling tools (nvprof) "
|
||||
einfo "using sudo (needs cap SYS_ADMIN) or add the following line to "
|
||||
einfo "a modprobe configuration file "
|
||||
einfo "(e.g. /etc/modprobe.d/nvidia-prof.conf): "
|
||||
einfo
|
||||
einfo "options nvidia NVreg_RestrictProfilingToAdminUsers=0"
|
||||
einfo
|
||||
fi
|
||||
}
|
File diff suppressed because one or more lines are too long
@@ -1,13 +0,0 @@
|
||||
DEFINED_PHASES=install unpack
|
||||
DESCRIPTION=NVIDIA Accelerated Deep Learning on GPU library
|
||||
EAPI=8
|
||||
HOMEPAGE=https://developer.nvidia.com/cudnn
|
||||
INHERIT=unpacker
|
||||
KEYWORDS=-* ~amd64 ~amd64-linux
|
||||
LICENSE=NVIDIA-cuDNN
|
||||
RDEPEND==dev-util/nvidia-cuda-toolkit-12*
|
||||
RESTRICT=mirror
|
||||
SLOT=0/9
|
||||
SRC_URI=https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-9.10.2.21_cuda12-archive.tar.xz
|
||||
_eclasses_=multiprocessing 1e32df7deee68372153dca65f4a7c21f toolchain-funcs a0b29008c671a362b505f96fa80ce9c0 unpacker 3b4ee72d1e2e0374fd8cd3eddfa00627
|
||||
_md5_=fe7f28caf363fdfe01331bc8394319c3
|
@@ -1,16 +0,0 @@
|
||||
BDEPEND=|| ( ( dev-lang/python:3.13 dev-python/defusedxml[python_targets_python3_13(-)] ) ( dev-lang/python:3.12 dev-python/defusedxml[python_targets_python3_12(-)] ) ( dev-lang/python:3.11 dev-python/defusedxml[python_targets_python3_11(-)] ) )
|
||||
DEFINED_PHASES=compile configure install postinst prepare pretend setup unpack
|
||||
DESCRIPTION=NVIDIA CUDA Toolkit (compiler and friends)
|
||||
EAPI=8
|
||||
HOMEPAGE=https://developer.nvidia.com/cuda-zone
|
||||
INHERIT=check-reqs edo toolchain-funcs python-r1
|
||||
IUSE=clang debugger examples nsight profiler rdma sanitizer python_targets_python3_11 python_targets_python3_12 python_targets_python3_13
|
||||
KEYWORDS=-* ~amd64 ~arm64 ~amd64-linux ~arm64-linux
|
||||
LICENSE=NVIDIA-CUDA
|
||||
RDEPEND=!clang? ( <sys-devel/gcc-15_pre[cxx] ) clang? ( <llvm-core/clang-20_pre ) sys-process/numactl debugger? ( python_targets_python3_11? ( dev-lang/python:3.11 ) python_targets_python3_12? ( dev-lang/python:3.12 ) python_targets_python3_13? ( dev-lang/python:3.13 ) ) examples? ( media-libs/freeglut media-libs/glu ) nsight? ( dev-util/nsight-compute dev-util/nsight-systems ) rdma? ( sys-cluster/rdma-core )
|
||||
REQUIRED_USE=|| ( python_targets_python3_11 python_targets_python3_12 python_targets_python3_13 )
|
||||
RESTRICT=bindist mirror strip test
|
||||
SLOT=0/12.9.1
|
||||
SRC_URI=amd64? ( https://developer.download.nvidia.com/compute/cuda/12.9.1/local_installers/cuda_12.9.1_575.57.08_linux.run ) arm64? ( https://developer.download.nvidia.com/compute/cuda/12.9.1/local_installers/cuda_12.9.1_575.57.08_linux_sbsa.run )
|
||||
_eclasses_=check-reqs 2a9731073c152554078a9a8df8fc0f1b edo a5e294016aa84979fcb2459749eb80b2 toolchain-funcs a0b29008c671a362b505f96fa80ce9c0 out-of-source-utils dbf9e34ee8964084651e25907fa8f52c multibuild 4650a65187015567b4e041bb9bfdb364 multiprocessing 1e32df7deee68372153dca65f4a7c21f python-utils-r1 bb392d69d55c48a5483d356933a26d57 python-r1 0e15b2ab9cfc87d7474678201d6bca38
|
||||
_md5_=cd600e071df1454a8a8962b10738aa21
|
Reference in New Issue
Block a user