diff --git a/pkgs/by-name/bo/bottles-unwrapped/package.nix b/pkgs/by-name/bo/bottles-unwrapped/package.nix index c6aa927e1c02..62b3b2af8ab5 100644 --- a/pkgs/by-name/bo/bottles-unwrapped/package.nix +++ b/pkgs/by-name/bo/bottles-unwrapped/package.nix @@ -24,21 +24,37 @@ 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 + ./redirect-bugtracker.patch + ./remove-flatpak-check.patch + ./remove-core-tab.patch + ] + ++ ( + if removeWarningPopup then + [ ./remove-unsupported-warning.patch ] + else + [ + ./warn-unsupported.patch + ] + ); # https://github.com/bottlesdevs/Bottles/wiki/Packaging nativeBuildInputs = [ @@ -57,26 +73,29 @@ python3Packages.buildPythonApplication rec { gtk4 gtksourceview5 libadwaita + libportal ]; 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 + pycairo + pygobject3 + charset-normalizer + idna + urllib3 + certifi + pefile ] ++ [ cabextract 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 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 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