summary refs log tree commit diff
path: root/pkgs/os-specific/linux/anbox
diff options
context:
space:
mode:
authorSamuel Dionne-Riel <samuel@dionne-riel.com>2021-06-04 20:38:14 -0400
committerrnhmjoj <rnhmjoj@inventati.org>2023-09-04 08:51:54 +0200
commite8a39314fcb623e9191eb2f810e222e93f703de7 (patch)
tree2e926e881c4524d152b0435aaa11512dc6bda78d /pkgs/os-specific/linux/anbox
parent11aa36c61ec21f5a1760ae6399520a868619a7de (diff)
downloadnixpkgs-e8a39314fcb623e9191eb2f810e222e93f703de7.tar
nixpkgs-e8a39314fcb623e9191eb2f810e222e93f703de7.tar.gz
nixpkgs-e8a39314fcb623e9191eb2f810e222e93f703de7.tar.bz2
nixpkgs-e8a39314fcb623e9191eb2f810e222e93f703de7.tar.lz
nixpkgs-e8a39314fcb623e9191eb2f810e222e93f703de7.tar.xz
nixpkgs-e8a39314fcb623e9191eb2f810e222e93f703de7.tar.zst
nixpkgs-e8a39314fcb623e9191eb2f810e222e93f703de7.zip
anbox: ensure .desktop files use a correct `anbox`
This fixes two issues

  - store path is hardcoded in desktop files
  - `.anbox-wrapped` is used in desktop files
Diffstat (limited to 'pkgs/os-specific/linux/anbox')
-rw-r--r--pkgs/os-specific/linux/anbox/0001-NixOS-Use-anbox-from-PATH-in-desktop-files.patch34
-rw-r--r--pkgs/os-specific/linux/anbox/default.nix2
2 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/anbox/0001-NixOS-Use-anbox-from-PATH-in-desktop-files.patch b/pkgs/os-specific/linux/anbox/0001-NixOS-Use-anbox-from-PATH-in-desktop-files.patch
new file mode 100644
index 00000000000..1c3450238c7
--- /dev/null
+++ b/pkgs/os-specific/linux/anbox/0001-NixOS-Use-anbox-from-PATH-in-desktop-files.patch
@@ -0,0 +1,34 @@
+From cb61e856c4357d9787f7a2313bacb1c3b2133d36 Mon Sep 17 00:00:00 2001
+From: Samuel Dionne-Riel <samuel@dionne-riel.com>
+Date: Fri, 4 Jun 2021 19:05:53 -0400
+Subject: [PATCH] [NixOS] Use `anbox` from PATH in desktop files
+
+---
+ src/anbox/application/launcher_storage.cpp | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/anbox/application/launcher_storage.cpp b/src/anbox/application/launcher_storage.cpp
+index d5053cf..a4be719 100644
+--- a/src/anbox/application/launcher_storage.cpp
++++ b/src/anbox/application/launcher_storage.cpp
+@@ -69,9 +69,7 @@ void LauncherStorage::add_or_update(const Database::Item &item) {
+   auto package_name = item.package;
+   std::replace(package_name.begin(), package_name.end(), '.', '-');
+ 
+-  auto exe_path = utils::process_get_exe_path(getpid());
+-  if (utils::get_env_value("SNAP").length() > 0)
+-    exe_path = snap_exe_path;
++  auto exe_path = "anbox";
+ 
+   std::string exec = utils::string_format("%s launch ", exe_path);
+ 
+@@ -121,4 +119,4 @@ void LauncherStorage::remove(const Database::Item &item) {
+     fs::remove(item_icon_path);
+ }
+ 
+-}
+\ No newline at end of file
++}
+-- 
+2.29.2
+
diff --git a/pkgs/os-specific/linux/anbox/default.nix b/pkgs/os-specific/linux/anbox/default.nix
index 991029ce7fd..67419e8d5c5 100644
--- a/pkgs/os-specific/linux/anbox/default.nix
+++ b/pkgs/os-specific/linux/anbox/default.nix
@@ -123,6 +123,8 @@ stdenv.mkDerivation rec {
       url = "https://git.alpinelinux.org/aports/plain/community/anbox/give-more-time-to-start.patch?id=058b56d4b332ef3379551b343bf31e0f2004321a";
       sha256 = "0iiz3c7fgfgl0dvx8sf5hv7a961xqnihwpz6j8r0ib9v8piwxh9a";
     })
+    # Ensures generated desktop files work on store path change
+    ./0001-NixOS-Use-anbox-from-PATH-in-desktop-files.patch
   ];
 
   postInstall = ''