From e8c67e70a0cb745243ff750a07619c2e3e0862ac Mon Sep 17 00:00:00 2001
From: Gliczy <129636582+Gliczy@users.noreply.github.com>
Date: Fri, 20 Dec 2024 03:57:26 +0100
Subject: [PATCH 1/5] bottles: 51.15 -> 51.17
---
pkgs/by-name/bo/bottles-unwrapped/package.nix | 23 ++++++++--
.../remove-flatpak-check.patch | 17 ++++++++
.../remove-unsupported-warning.patch | 40 ++++++++++++++++++
.../bottles-unwrapped/warn-unsupported.patch | 42 +++++++++++++++++++
pkgs/by-name/bo/bottles/package.nix | 3 +-
5 files changed, 120 insertions(+), 5 deletions(-)
create mode 100644 pkgs/by-name/bo/bottles-unwrapped/remove-flatpak-check.patch
create mode 100644 pkgs/by-name/bo/bottles-unwrapped/remove-unsupported-warning.patch
create mode 100644 pkgs/by-name/bo/bottles-unwrapped/warn-unsupported.patch
diff --git a/pkgs/by-name/bo/bottles-unwrapped/package.nix b/pkgs/by-name/bo/bottles-unwrapped/package.nix
index c6aa927e1c02..c1ac15836939 100644
--- a/pkgs/by-name/bo/bottles-unwrapped/package.nix
+++ b/pkgs/by-name/bo/bottles-unwrapped/package.nix
@@ -24,21 +24,35 @@
mangohud,
vkbasalt-cli,
vmtouch,
+ libportal,
nix-update-script,
+ removeWarningPopup ? false, # Final reminder to report any issues on nixpkgs' bugtracker
}:
python3Packages.buildPythonApplication rec {
pname = "bottles-unwrapped";
- version = "51.15";
+ version = "51.17";
src = fetchFromGitHub {
owner = "bottlesdevs";
repo = "bottles";
- rev = "refs/tags/${version}";
- hash = "sha256-HjGAeIh9s7xWBy35Oj66tCtgKCd/DpHg1sMPsdjWKDs=";
+ tag = version;
+ hash = "sha256-m4ATWpAZxIBp1X0cNeyNGmt6aIBo/cHH+DpOMkLia0E=";
};
- patches = [ ./vulkan_icd.patch ];
+ patches =
+ [
+ ./vulkan_icd.patch
+ ./remove-flatpak-check.patch
+ ]
+ ++ (
+ if removeWarningPopup then
+ [ ./remove-unsupported-warning.patch ]
+ else
+ [
+ ./warn-unsupported.patch
+ ]
+ );
# https://github.com/bottlesdevs/Bottles/wiki/Packaging
nativeBuildInputs = [
@@ -57,6 +71,7 @@ python3Packages.buildPythonApplication rec {
gtk4
gtksourceview5
libadwaita
+ libportal
];
propagatedBuildInputs =
diff --git a/pkgs/by-name/bo/bottles-unwrapped/remove-flatpak-check.patch b/pkgs/by-name/bo/bottles-unwrapped/remove-flatpak-check.patch
new file mode 100644
index 000000000000..ddce9a0df8ee
--- /dev/null
+++ b/pkgs/by-name/bo/bottles-unwrapped/remove-flatpak-check.patch
@@ -0,0 +1,17 @@
+diff --git a/bottles/frontend/meson.build b/bottles/frontend/meson.build
+index 6ff7c011..c26ea0b9 100644
+--- 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',
diff --git a/pkgs/by-name/bo/bottles-unwrapped/remove-unsupported-warning.patch b/pkgs/by-name/bo/bottles-unwrapped/remove-unsupported-warning.patch
new file mode 100644
index 000000000000..ed0ba631d3a7
--- /dev/null
+++ b/pkgs/by-name/bo/bottles-unwrapped/remove-unsupported-warning.patch
@@ -0,0 +1,40 @@
+diff --git a/bottles/frontend/windows/main_window.py b/bottles/frontend/windows/main_window.py
+index 79bf0d72..e37ca43e 100644
+--- a/bottles/frontend/windows/main_window.py
+index 79bf0d72..e37ca43e 100644
+--- a/bottles/frontend/windows/main_window.py
++++ b/bottles/frontend/windows/main_window.py
+@@ -104,29 +104,15 @@ class MainWindow(Adw.ApplicationWindow):
+
+ def response(dialog, response, *args):
+ if response == "close":
+- quit(1)
++ return
+
+- 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} {download_url}.",
+- )
+-
+- error_dialog.add_response("close", _("Close"))
+- error_dialog.set_body_use_markup(True)
+- error_dialog.connect("response", response)
+- error_dialog.present(self)
+- logging.error(
++ logging.warn(
+ _(
+ "Bottles is only supported within a sandboxed format. Official sources of Bottles are available at:"
+ )
+ )
+- logging.error("https://usebottles.com/download/")
+- return
++ logging.warn("https://usebottles.com/download/")
++ logging.warn("Please report any issues at: https://github.com/NixOS/nixpkgs/issues")
+
+ # Loading view
+ self.page_loading = LoadingView()
diff --git a/pkgs/by-name/bo/bottles-unwrapped/warn-unsupported.patch b/pkgs/by-name/bo/bottles-unwrapped/warn-unsupported.patch
new file mode 100644
index 000000000000..192986ae725d
--- /dev/null
+++ b/pkgs/by-name/bo/bottles-unwrapped/warn-unsupported.patch
@@ -0,0 +1,42 @@
+diff --git a/bottles/frontend/windows/main_window.py b/bottles/frontend/windows/main_window.py
+index 79bf0d72..e3a15cb5 100644
+--- a/bottles/frontend/windows/main_window.py
++++ b/bottles/frontend/windows/main_window.py
+@@ -104,29 +104,29 @@ class MainWindow(Adw.ApplicationWindow):
+
+ def response(dialog, response, *args):
+ if response == "close":
+- quit(1)
++ return
+
+ body = _(
+- "Bottles is only supported within a sandboxed environment. Official sources of Bottles are available at"
++ "Bottles is only supported within a sandboxed environment. Please report any issues at:"
+ )
+- download_url = "usebottles.com/download"
++ bugtracker_url = "github.com/NixOS/nixpkgs/issues"
+
+ error_dialog = Adw.AlertDialog.new(
+ _("Unsupported Environment"),
+- f"{body} {download_url}.",
++ f"{body} {bugtracker_url}.",
+ )
+
+- error_dialog.add_response("close", _("Close"))
++ error_dialog.add_response("close", _("Understood"))
+ error_dialog.set_body_use_markup(True)
+ error_dialog.connect("response", response)
+ error_dialog.present(self)
+- logging.error(
++ logging.warn(
+ _(
+ "Bottles is only supported within a sandboxed format. Official sources of Bottles are available at:"
+ )
+ )
+- logging.error("https://usebottles.com/download/")
+- return
++ logging.warn("https://usebottles.com/download/")
++ logging.warn("Please report any issues at: https://github.com/NixOS/nixpkgs/issues")
+
+ # Loading view
+ self.page_loading = LoadingView()
diff --git a/pkgs/by-name/bo/bottles/package.nix b/pkgs/by-name/bo/bottles/package.nix
index d9a4543ebde2..26e448ddffbc 100644
--- a/pkgs/by-name/bo/bottles/package.nix
+++ b/pkgs/by-name/bo/bottles/package.nix
@@ -4,6 +4,7 @@
bottles-unwrapped,
extraPkgs ? pkgs: [ ],
extraLibraries ? pkgs: [ ],
+ removeWarningPopup ? false,
}:
let
@@ -16,7 +17,7 @@ let
pkgs:
with pkgs;
[
- bottles-unwrapped
+ (bottles-unwrapped.override { inherit removeWarningPopup; })
# This only allows to enable the toggle, vkBasalt won't work if not installed with environment.systemPackages (or nix-env)
# See https://github.com/bottlesdevs/Bottles/issues/2401
vkbasalt
From 89e894e71452a23e655654b2ed948f27fc1ddde8 Mon Sep 17 00:00:00 2001
From: Gliczy <129636582+Gliczy@users.noreply.github.com>
Date: Fri, 20 Dec 2024 03:58:47 +0100
Subject: [PATCH 2/5] bottles: remove "Core" tab
---
pkgs/by-name/bo/bottles-unwrapped/package.nix | 1 +
.../bottles-unwrapped/remove-core-tab.patch | 76 +++++++++++++++++++
2 files changed, 77 insertions(+)
create mode 100644 pkgs/by-name/bo/bottles-unwrapped/remove-core-tab.patch
diff --git a/pkgs/by-name/bo/bottles-unwrapped/package.nix b/pkgs/by-name/bo/bottles-unwrapped/package.nix
index c1ac15836939..f8c738bd1452 100644
--- a/pkgs/by-name/bo/bottles-unwrapped/package.nix
+++ b/pkgs/by-name/bo/bottles-unwrapped/package.nix
@@ -44,6 +44,7 @@ python3Packages.buildPythonApplication rec {
[
./vulkan_icd.patch
./remove-flatpak-check.patch
+ ./remove-core-tab.patch
]
++ (
if removeWarningPopup then
diff --git a/pkgs/by-name/bo/bottles-unwrapped/remove-core-tab.patch b/pkgs/by-name/bo/bottles-unwrapped/remove-core-tab.patch
new file mode 100644
index 000000000000..79e88db7dc5f
--- /dev/null
+++ b/pkgs/by-name/bo/bottles-unwrapped/remove-core-tab.patch
@@ -0,0 +1,76 @@
+diff --git a/bottles/frontend/ui/preferences.blp b/bottles/frontend/ui/preferences.blp
+index 9dd12a16..c1fcf649 100644
+--- a/bottles/frontend/ui/preferences.blp
++++ b/bottles/frontend/ui/preferences.blp
+@@ -284,20 +284,6 @@ template $PreferencesWindow: Adw.PreferencesWindow {
+ }
+ }
+
+- Adw.PreferencesPage pref_core {
+- icon-name: "application-x-addon-symbolic";
+- title: _("Core");
+- visible: false;
+-
+- Adw.PreferencesGroup list_runtimes {
+- title: _("Runtime");
+- }
+-
+- Adw.PreferencesGroup list_winebridge {
+- title: _("WineBridge");
+- }
+- }
+-
+ Adw.PreferencesPage {
+ icon-name: "applications-science-symbolic";
+ title: _("Experiments");
+diff --git a/bottles/frontend/views/preferences.py b/bottles/frontend/views/preferences.py
+index ce7ec958..f46c6e5b 100644
+--- a/bottles/frontend/views/preferences.py
++++ b/bottles/frontend/views/preferences.py
+@@ -53,8 +53,6 @@ class PreferencesWindow(Adw.PreferencesWindow):
+ switch_steam_programs = Gtk.Template.Child()
+ switch_epic_games = Gtk.Template.Child()
+ switch_ubisoft_connect = Gtk.Template.Child()
+- list_winebridge = Gtk.Template.Child()
+- list_runtimes = Gtk.Template.Child()
+ list_runners = Gtk.Template.Child()
+ list_dxvk = Gtk.Template.Child()
+ list_vkd3d = Gtk.Template.Child()
+@@ -66,7 +64,6 @@ class PreferencesWindow(Adw.PreferencesWindow):
+ btn_bottles_path_reset = Gtk.Template.Child()
+ label_bottles_path = Gtk.Template.Child()
+ btn_steam_proton_doc = Gtk.Template.Child()
+- pref_core = Gtk.Template.Child()
+
+ # endregion
+
+@@ -170,10 +167,6 @@ class PreferencesWindow(Adw.PreferencesWindow):
+ self.installers_stack.set_visible_child_name("installers_offline")
+ self.dlls_stack.set_visible_child_name("dlls_offline")
+
+- # populate components lists
+- self.populate_runtimes_list()
+- self.populate_winebridge_list()
+-
+ RunAsync(self.ui_update)
+
+ # connect signals
+@@ -319,18 +312,6 @@ class PreferencesWindow(Adw.PreferencesWindow):
+ list_component.add(_entry)
+ self.__registry.append(_entry)
+
+- def populate_runtimes_list(self):
+- for runtime in self.manager.supported_runtimes.items():
+- self.list_runtimes.add(
+- ComponentEntry(self.window, runtime, "runtime", is_upgradable=True)
+- )
+-
+- def populate_winebridge_list(self):
+- for bridge in self.manager.supported_winebridge.items():
+- self.list_winebridge.add(
+- ComponentEntry(self.window, bridge, "winebridge", is_upgradable=True)
+- )
+-
+ def populate_dxvk_list(self):
+ self.__populate_component_list(
+ "dxvk", self.manager.supported_dxvk, self.list_dxvk
From d528192e741079873f999f6bd68d4bf070ea95f3 Mon Sep 17 00:00:00 2001
From: Gliczy <129636582+Gliczy@users.noreply.github.com>
Date: Fri, 20 Dec 2024 03:59:46 +0100
Subject: [PATCH 3/5] bottles: redirect bugtracker to nixpkgs
---
pkgs/by-name/bo/bottles-unwrapped/package.nix | 1 +
.../bo/bottles-unwrapped/redirect-bugtracker.patch | 13 +++++++++++++
2 files changed, 14 insertions(+)
create mode 100644 pkgs/by-name/bo/bottles-unwrapped/redirect-bugtracker.patch
diff --git a/pkgs/by-name/bo/bottles-unwrapped/package.nix b/pkgs/by-name/bo/bottles-unwrapped/package.nix
index f8c738bd1452..2046ceea2b0b 100644
--- a/pkgs/by-name/bo/bottles-unwrapped/package.nix
+++ b/pkgs/by-name/bo/bottles-unwrapped/package.nix
@@ -43,6 +43,7 @@ python3Packages.buildPythonApplication rec {
patches =
[
./vulkan_icd.patch
+ ./redirect-bugtracker.patch
./remove-flatpak-check.patch
./remove-core-tab.patch
]
diff --git a/pkgs/by-name/bo/bottles-unwrapped/redirect-bugtracker.patch b/pkgs/by-name/bo/bottles-unwrapped/redirect-bugtracker.patch
new file mode 100644
index 000000000000..e345d0de18b3
--- /dev/null
+++ b/pkgs/by-name/bo/bottles-unwrapped/redirect-bugtracker.patch
@@ -0,0 +1,13 @@
+diff --git a/data/com.usebottles.bottles.metainfo.xml.in.in b/data/com.usebottles.bottles.metainfo.xml.in.in
+index bdda5c6e..9292df50 100644
+--- a/data/com.usebottles.bottles.metainfo.xml.in.in
++++ b/data/com.usebottles.bottles.metainfo.xml.in.in
+@@ -52,7 +52,7 @@
+ @APP_ID@
+
+ https://usebottles.com
+- https://github.com/bottlesdevs/Bottles/issues
++ https://github.com/NixOS/nixpkgs/issues
+ https://docs.usebottles.com
+ https://usebottles.com/funding
+ https://hosted.weblate.org/engage/bottles
From 3bb81bf81259ad6c0e128ad38a4703de6c838c43 Mon Sep 17 00:00:00 2001
From: Gliczy <129636582+Gliczy@users.noreply.github.com>
Date: Fri, 20 Dec 2024 04:01:09 +0100
Subject: [PATCH 4/5] bottles: re-order `propagatedBuildInputs`
---
pkgs/by-name/bo/bottles-unwrapped/package.nix | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/pkgs/by-name/bo/bottles-unwrapped/package.nix b/pkgs/by-name/bo/bottles-unwrapped/package.nix
index 2046ceea2b0b..bf5714391514 100644
--- a/pkgs/by-name/bo/bottles-unwrapped/package.nix
+++ b/pkgs/by-name/bo/bottles-unwrapped/package.nix
@@ -79,21 +79,21 @@ python3Packages.buildPythonApplication rec {
propagatedBuildInputs =
with python3Packages;
[
- pathvalidate
- pycurl
pyyaml
- requests
- pygobject3
- patool
- markdown
- fvs
- pefile
- urllib3
+ pycurl
chardet
- certifi
- idna
- orjson
+ requests
+ markdown
icoextract
+ patool
+ pathvalidate
+ fvs
+ orjson
+ pygobject3
+ idna
+ urllib3
+ certifi
+ pefile
]
++ [
cabextract
From 1efb60481406c20e857d8c66aab447932b7dfb5a Mon Sep 17 00:00:00 2001
From: Gliczy <129636582+Gliczy@users.noreply.github.com>
Date: Fri, 20 Dec 2024 04:03:27 +0100
Subject: [PATCH 5/5] bottles: follow upstream deps in propagatedBuildIn puts
---
pkgs/by-name/bo/bottles-unwrapped/package.nix | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pkgs/by-name/bo/bottles-unwrapped/package.nix b/pkgs/by-name/bo/bottles-unwrapped/package.nix
index bf5714391514..62b3b2af8ab5 100644
--- a/pkgs/by-name/bo/bottles-unwrapped/package.nix
+++ b/pkgs/by-name/bo/bottles-unwrapped/package.nix
@@ -89,7 +89,9 @@ python3Packages.buildPythonApplication rec {
pathvalidate
fvs
orjson
+ pycairo
pygobject3
+ charset-normalizer
idna
urllib3
certifi