2024-01-19 14:27:33 +01:00
|
|
|
# Copyright 2023-2024 Gentoo Authors
|
2023-02-24 19:03:51 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI=8
|
|
|
|
|
2023-11-24 00:14:14 +01:00
|
|
|
PYTHON_COMPAT=( python3_{10..12} )
|
2023-02-24 19:03:51 +01:00
|
|
|
inherit gnome2-utils python-single-r1 meson xdg optfeature
|
|
|
|
|
|
|
|
DESCRIPTION="Run Windows software and games on Linux"
|
|
|
|
HOMEPAGE="https://usebottles.com/"
|
|
|
|
|
|
|
|
if [[ "${PV}" == "9999" ]]; then
|
|
|
|
inherit git-r3
|
|
|
|
EGIT_REPO_URI="https://github.com/bottlesdevs/Bottles/"
|
|
|
|
else
|
|
|
|
SRC_URI="https://github.com/bottlesdevs/Bottles/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
|
|
|
|
S="${WORKDIR}/Bottles-${PV}"
|
|
|
|
KEYWORDS="~amd64"
|
|
|
|
fi
|
|
|
|
|
|
|
|
LICENSE="GPL-3"
|
|
|
|
SLOT="0"
|
|
|
|
|
2024-06-27 11:59:49 +02:00
|
|
|
IUSE="test"
|
2023-02-24 19:03:51 +01:00
|
|
|
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
2023-06-01 09:05:52 +02:00
|
|
|
RESTRICT="!test? ( test )"
|
2023-02-24 19:03:51 +01:00
|
|
|
|
|
|
|
# Very annoying to figure out the deps
|
|
|
|
# Script for getting python modules:
|
|
|
|
# https://gitlab.com/Parona/my-scripts/-/blob/master/scripts/python_deps.sh
|
|
|
|
# Runtime programs needed can be quickly found with:
|
|
|
|
# grep -r "shutil.which"
|
|
|
|
# But look at context to gauge if they are optional or not
|
|
|
|
#
|
|
|
|
# BDPEPEND dependencies can be thankfully gathered from the meson.build files
|
|
|
|
# DEPEND are instrospection files which can be found as such
|
|
|
|
# find . -name "*.blp" -exec grep -Eh "^using " {} + | sed 's/using \([A-Za-z]*\) \([0-9.]*\);/\1-\2.typelib/'
|
|
|
|
# And in similar vein find runtime required introspection files, similar deal with getting typelib file as above
|
|
|
|
# grep -r "gi.require_version
|
|
|
|
|
|
|
|
# vkbasalt could be optional but vkbasalt-cli isnt
|
|
|
|
# It could work without wine but(!) it still requires all the runtime dependencies for wine
|
|
|
|
# so easier to depend on wine to get it for free
|
|
|
|
|
|
|
|
DEPEND="
|
|
|
|
gui-libs/gtk:4[introspection]
|
|
|
|
gui-libs/libadwaita[introspection]
|
|
|
|
"
|
|
|
|
RDEPEND="
|
|
|
|
${PYTHON_DEPS}
|
|
|
|
${DEPEND}
|
|
|
|
app-arch/cabextract
|
|
|
|
app-arch/p7zip
|
|
|
|
gui-libs/gtksourceview[introspection]
|
|
|
|
media-gfx/imagemagick
|
|
|
|
>=sys-libs/glibc-2.32
|
|
|
|
x11-apps/xdpyinfo
|
2024-01-19 14:27:33 +01:00
|
|
|
|| (
|
2024-06-27 11:59:49 +02:00
|
|
|
app-emulation/wine-vanilla[X]
|
|
|
|
app-emulation/wine-staging[X]
|
|
|
|
app-emulation/wine-proton[X(+)]
|
2023-08-12 03:53:12 +02:00
|
|
|
)
|
2023-02-24 19:03:51 +01:00
|
|
|
$(python_gen_cond_dep '
|
|
|
|
app-arch/patool[${PYTHON_USEDEP}]
|
2023-08-20 20:23:41 +02:00
|
|
|
dev-python/certifi[${PYTHON_USEDEP}]
|
|
|
|
dev-python/chardet[${PYTHON_USEDEP}]
|
|
|
|
dev-python/charset-normalizer[${PYTHON_USEDEP}]
|
2023-02-24 19:03:51 +01:00
|
|
|
dev-python/FVS[${PYTHON_USEDEP}]
|
2023-08-20 20:23:41 +02:00
|
|
|
dev-python/idna[${PYTHON_USEDEP}]
|
2023-02-24 19:03:51 +01:00
|
|
|
dev-python/icoextract[${PYTHON_USEDEP}]
|
|
|
|
dev-python/markdown[${PYTHON_USEDEP}]
|
|
|
|
dev-python/orjson[${PYTHON_USEDEP}]
|
|
|
|
dev-python/pathvalidate[${PYTHON_USEDEP}]
|
|
|
|
dev-python/pefile[${PYTHON_USEDEP}]
|
2023-06-01 09:05:52 +02:00
|
|
|
dev-python/pycairo[${PYTHON_USEDEP}]
|
2023-02-24 19:03:51 +01:00
|
|
|
dev-python/pycurl[${PYTHON_USEDEP}]
|
2023-06-01 09:05:52 +02:00
|
|
|
dev-python/pygobject[${PYTHON_USEDEP}]
|
|
|
|
dev-python/pyyaml[${PYTHON_USEDEP}]
|
2023-02-24 19:03:51 +01:00
|
|
|
dev-python/requests[${PYTHON_USEDEP}]
|
2023-08-20 20:23:41 +02:00
|
|
|
dev-python/urllib3[${PYTHON_USEDEP}]
|
2023-02-24 19:03:51 +01:00
|
|
|
dev-python/vkbasalt-cli[${PYTHON_USEDEP}]
|
2023-06-01 09:05:52 +02:00
|
|
|
dev-python/wheel[${PYTHON_USEDEP}]
|
2023-02-24 19:03:51 +01:00
|
|
|
')
|
|
|
|
"
|
|
|
|
BDEPEND="
|
|
|
|
${PYTHON_DEPS}
|
2023-03-14 19:51:18 +01:00
|
|
|
dev-util/blueprint-compiler
|
2023-02-24 19:03:51 +01:00
|
|
|
dev-libs/glib:2
|
|
|
|
sys-devel/gettext
|
|
|
|
test? (
|
2023-06-01 09:05:52 +02:00
|
|
|
$(python_gen_cond_dep '
|
|
|
|
dev-python/pytest[${PYTHON_USEDEP}]
|
|
|
|
')
|
2023-02-24 19:03:51 +01:00
|
|
|
)
|
|
|
|
"
|
|
|
|
|
2023-08-22 10:39:30 +02:00
|
|
|
EPYTEST_DESELECT=(
|
|
|
|
# tests that check execution time are flaky in the right circumstances
|
|
|
|
# (like compiling llvm at the same time type circumstance)
|
|
|
|
"bottles/tests/backend/state/test_events.py::test_set_reset"
|
|
|
|
"bottles/tests/backend/state/test_events.py::test_simple_event"
|
|
|
|
"bottles/tests/backend/state/test_events.py::test_wait_after_done_event"
|
|
|
|
)
|
|
|
|
|
2023-02-24 19:03:51 +01:00
|
|
|
pkg_setup() {
|
|
|
|
python-single-r1_pkg_setup
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
2023-09-23 20:36:50 +02:00
|
|
|
if [[ "${PV}" == "9999" ]]; then
|
2023-02-24 19:03:51 +01:00
|
|
|
local emesonargs=(
|
|
|
|
-Ddevel=true
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
meson_src_configure
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
meson_src_install
|
|
|
|
python_optimize "${D}/usr/share/bottles/"
|
|
|
|
python_fix_shebang "${D}/usr/"
|
|
|
|
}
|
|
|
|
|
2023-06-01 09:05:52 +02:00
|
|
|
src_test() {
|
|
|
|
epytest
|
|
|
|
}
|
|
|
|
|
2023-02-24 19:03:51 +01:00
|
|
|
pkg_preinst() {
|
|
|
|
xdg_pkg_preinst
|
|
|
|
gnome2_schemas_savelist
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
xdg_pkg_postinst
|
|
|
|
gnome2_schemas_update
|
|
|
|
optfeature "gamemode support" games-util/gamemode
|
2024-07-11 18:08:49 +02:00
|
|
|
optfeature "gamescope support" gui-wm/gamescope
|
2023-02-24 19:03:51 +01:00
|
|
|
optfeature "vmtouch support" dev-utils/vmtouch
|
|
|
|
#optfeature "MangoHub support" games-util/mangohub
|
|
|
|
#optfeature "obs-vkcapture support" media-video/obs-vkcapture
|
2024-06-27 11:59:49 +02:00
|
|
|
|
|
|
|
if has_version app-emulation/wine-vanilla[llvm-libunwind] || \
|
|
|
|
has_version app-emulation/wine-staging[llvm-libunwind] || \
|
|
|
|
has_version app-emulation/wine-proton[llvm-libunwind]; then
|
|
|
|
ewarn "With llvm-libunwind all the runners downloaded from bottles are most likely broken"
|
|
|
|
ewarn "So when using llvm-libunwind system wide it is recommended to stick to runners compiled by your system"
|
|
|
|
ewarn "More information:"
|
|
|
|
ewarn "https://gitlab.com/src_prepare/src_prepare-overlay/-/issues/49"
|
|
|
|
ewarn "https://gitlab.com/src_prepare/src_prepare-overlay/-/merge_requests/394#note_1735168806"
|
2023-09-23 20:36:50 +02:00
|
|
|
fi
|
2023-02-24 19:03:51 +01:00
|
|
|
}
|