games-util/bottles: new package, add 64.1

Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
This commit is contained in:
Pavel Sobolev
2026-06-26 20:42:46 +03:00
parent dd688cc6f3
commit e6004e8db4
6 changed files with 290 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST bottles-64.1.tar.gz 2758708 BLAKE2B 77b8dd6c4164b832bf1a5c073f2262c96c1877b01b9e6e69212201fac58a0c427559c3b3929ae6b6c1e3bb2952245cd11f9ca89c75d80d85371b248b33dc4652 SHA512 a5a4e5d0f06eadd9461901b29a168be91627fae014dc8f6f99210d0882301e9e34cbeaf5193107e77f4b01cdf8f5d50afa692e5916889e829f080b37c9d7a2c1

View File

@@ -0,0 +1,121 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=no
DISTUTILS_SINGLE_IMPL=1
PYTHON_COMPAT=( python3_{12..14} )
inherit distutils-r1 gnome2-utils meson optfeature xdg
DESCRIPTION="Run Windows software and games on Linux"
HOMEPAGE="
https://usebottles.com
https://github.com/bottlesdevs/Bottles
"
SRC_URI="https://github.com/bottlesdevs/Bottles/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/Bottles-${PV}"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
RDEPEND="
dev-libs/glib:2
dev-libs/libportal
gui-libs/gtk:4
gui-libs/gtksourceview:5
gui-libs/libadwaita:1
dev-vcs/fvs2
$(python_gen_cond_dep '
app-arch/patool[${PYTHON_USEDEP}]
dev-python/certifi[${PYTHON_USEDEP}]
dev-python/chardet[${PYTHON_USEDEP}]
dev-python/charset-normalizer[${PYTHON_USEDEP}]
dev-python/icoextract[${PYTHON_USEDEP}]
dev-python/idna[${PYTHON_USEDEP}]
dev-python/markdown[${PYTHON_USEDEP}]
dev-python/orjson[${PYTHON_USEDEP}]
dev-python/pathvalidate[${PYTHON_USEDEP}]
dev-python/pefile[${PYTHON_USEDEP}]
dev-python/pycairo[${PYTHON_USEDEP}]
dev-python/pycurl[${PYTHON_USEDEP}]
dev-python/pygobject[${PYTHON_USEDEP}]
dev-python/pyxdg[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}]
dev-python/urllib3[${PYTHON_USEDEP}]
dev-python/wheel[${PYTHON_USEDEP}]
dev-python/yara-python[${PYTHON_USEDEP}]
media-gfx/vkbasalt-cli[${PYTHON_USEDEP}]
')
"
DEPEND="${RDEPEND}"
BDEPEND="
dev-libs/appstream-glib
dev-libs/glib:2
dev-util/blueprint-compiler
dev-util/desktop-file-utils
dev-util/gtk-update-icon-cache
sys-devel/gettext
test? (
$(python_gen_cond_dep '
dev-python/freezegun[${PYTHON_USEDEP}]
')
)
"
PATCHES=(
"${FILESDIR}/${PN}-64.1-dont-stub-gi.repository.patch"
"${FILESDIR}/${PN}-64.1-relax-AppStream-file-validation.patch"
"${FILESDIR}/${PN}-64.1-remove-Flatpak-related-checks.patch"
)
EPYTEST_DESELECT=(
bottles/tests/backend/integration/playtime/test_disabled_tracking.py::test_disabled_tracking_smoke
bottles/tests/backend/integration/playtime/test_wine_executor_playtime.py::test_wine_executor_emits_and_updates_totals
bottles/tests/backend/manager/test_manager.py::test_manager_cli_skips_connection_check
bottles/tests/backend/manager/test_playtime.py::test_disable_tracking_method
bottles/tests/backend/manager/test_playtime.py::test_disabled_tracker_is_noop
bottles/tests/backend/wine/test_executor.py::test_run_program_substitutes_placeholders
)
EPYTEST_PLUGINS=( pytest-mock )
distutils_enable_tests pytest
src_test() {
meson_src_test
distutils-r1_src_test
}
src_install() {
meson_src_install
python_fix_shebang "${ED}/usr/bin"
}
pkg_postinst() {
xdg_pkg_postinst
gnome2_schemas_update
optfeature "extracting files from .cab files" app-arch/cabextract
optfeature "7-Zip archiver support" app-arch/p7zip
optfeature "Vulkan support" dev-util/vulkan-tools
optfeature "icon/image convertion" media-gfx/imagemagick
optfeature "display information support" x11-apps/xdpyinfo
optfeature "preloading game files into memory" dev-util/vmtouch
optfeature "optimizing Linux system performance on demand" games-util/gamemode
optfeature "an efficient micro-compositor for running games" gui-wm/gamescope
optfeature "monitoring FPS, temperatures, CPU/GPU load and more" games-util/mangohud
}
pkg_postrm() {
xdg_pkg_postrm
gnome2_schemas_update
}

View File

@@ -0,0 +1,23 @@
From: Pavel Sobolev <contact@paveloom.dev>
Subject: [PATCH] Don't stub `gi.repository`
Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
--- a/bottles/tests/backend/integration/playtime/conftest.py
+++ b/bottles/tests/backend/integration/playtime/conftest.py
@@ -6,15 +6,6 @@ import contextlib
import sqlite3
import pytest
-_glib_stub = types.SimpleNamespace(
- SOURCE_REMOVE=False,
- idle_add=lambda func, *args, **kwargs: func(),
- timeout_add=lambda *_a, **_k: 0,
-)
-_gi_repository = types.SimpleNamespace(GLib=_glib_stub)
-sys.modules.setdefault("gi", types.SimpleNamespace(repository=_gi_repository))
-sys.modules.setdefault("gi.repository", _gi_repository)
-
class _FVSRepoStub:
def __init__(self, *args, **kwargs):
self.active_state_id = 0

View File

@@ -0,0 +1,16 @@
From: Pavel Sobolev <contact@paveloom.dev>
Subject: [PATCH] Relax AppStream file validation
Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
--- a/data/meson.build
+++ b/data/meson.build
@@ -51,7 +51,7 @@ gnome.compile_resources('data',
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test('Validate appstream file', appstream_util,
- args: ['validate', appstream_file]
+ args: ['validate-relax', '--nonet', appstream_file]
)
endif

View File

@@ -0,0 +1,117 @@
From: Pavel Sobolev <contact@paveloom.dev>
Subject: [PATCH] Remove Flatpak-related checks
Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
--- a/bottles/frontend/meson.build
+++ b/bottles/frontend/meson.build
@@ -23,12 +23,6 @@ params_file = configure_file(
configuration: conf
)
-fs = import('fs')
-
-if not fs.is_file('/' + '.flatpak-info')
- error('file does not exist')
-endif
-
bottles_sources = [
'__init__.py',
'main.py',
--- a/bottles/frontend/views/bottle_details.py
+++ b/bottles/frontend/views/bottle_details.py
@@ -692,22 +692,7 @@ class BottleView(Adw.PreferencesPage):
dialog.connect("response", execute)
dialog.show()
- if Xdp.Portal.running_under_sandbox():
- if self.window.settings.get_boolean("show-sandbox-warning"):
- dialog = Adw.MessageDialog.new(
- self.window,
- _("Be Aware of Sandbox"),
- _(
- "Bottles is running in a sandbox, a restricted permission environment needed to keep you safe. If the program won't run, consider moving inside the bottle (3 dots icon on the top), then launch from there."
- ),
- )
- dialog.add_response("dismiss", _("_Dismiss"))
- dialog.connect("response", lambda *args: show_chooser())
- dialog.present()
- else:
- show_chooser()
- else:
- show_chooser()
+ show_chooser()
def analyze_with_eagle(self, path):
"""Open the Eagle analysis view and scan the given executable."""
--- a/bottles/frontend/views/bottle_preferences.py
+++ b/bottles/frontend/views/bottle_preferences.py
@@ -141,7 +141,7 @@ class PreferencesView(Adw.PreferencesPage):
self.queue = details.queue
self.details = details
- if not gamemode_available or not Xdp.Portal.running_under_sandbox():
+ if not gamemode_available:
return
_not_available = _("This feature is unavailable on your system.")
--- a/bottles/frontend/views/list.py
+++ b/bottles/frontend/views/list.py
@@ -83,9 +83,6 @@ class BottlesBottleRow(Adw.ActionRow):
def run_executable(self, *_args):
"""Display file dialog for executable"""
- if not Xdp.Portal.running_under_sandbox():
- return
-
def set_path(_dialog, response):
if response != Gtk.ResponseType.ACCEPT:
return
--- a/bottles/frontend/views/new_bottle_dialog.py
+++ b/bottles/frontend/views/new_bottle_dialog.py
@@ -86,7 +86,7 @@ class BottlesNewBottleDialog(Adw.Dialog):
super().__init__(**kwargs)
# common variables and references
self.window = GtkUtils.get_parent_window()
- if not self.window or not Xdp.Portal.running_under_sandbox():
+ if not self.window:
return
self.app = self.window.get_application()
--- a/bottles/frontend/windows/window.py
+++ b/bottles/frontend/windows/window.py
@@ -125,35 +125,6 @@ class BottlesWindow(Adw.ApplicationWindow):
manager = Adw.StyleManager.get_default()
manager.set_color_scheme(Adw.ColorScheme.FORCE_DARK)
- # Be VERY explicit that non-sandboxed environments are unsupported
- if not Xdp.Portal.running_under_sandbox():
-
- def response(dialog, response, *args):
- if response == "close":
- quit(1)
-
- body = _(
- "Bottles is only supported within a sandboxed environment. Official sources of Bottles are available at"
- )
- download_url = "usebottles.com/download"
-
- error_dialog = Adw.AlertDialog.new(
- _("Unsupported Environment"),
- f"{body} <a href='https://{download_url}' title='https://{download_url}'>{download_url}.</a>",
- )
-
- error_dialog.add_response("close", _("Close"))
- error_dialog.set_body_use_markup(True)
- error_dialog.connect("response", response)
- error_dialog.present(self)
- logging.error(
- _(
- "Bottles is only supported within a sandboxed format. Official sources of Bottles are available at:"
- )
- )
- logging.error("https://usebottles.com/download/")
- return
-
# Loading view
self.page_loading = LoadingView()

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<name>Pavel Sobolev</name>
<email>contact@paveloom.dev</email>
</maintainer>
<upstream>
<bugs-to>https://github.com/bottlesdevs/Bottles/issues</bugs-to>
<remote-id type="github">bottlesdevs/Bottles</remote-id>
</upstream>
</pkgmetadata>