From 1b00e5af2fdff56affeb1f2c00db5b035c08fdcc Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Sun, 22 Jan 2023 23:47:20 -0500 Subject: [PATCH] waydroid: Add missing ambiant dependencies Fixes #211741 `waydroid first-launch` would fail due to missing gobject introspection bindings for Gtk. ``` ( ) [ ] ERROR: Namespace Gtk not available ( ) [ ] See also: ( ) [ ] Traceback (most recent call last): File "/nix/store/7c0jjr0jid4xhfdsv13jiwp7q4jl9khi-waydroid-1.3.3/lib/waydroid/tools/__init__.py", line 113, in main actions.remote_init_client(args) File "/nix/store/7c0jjr0jid4xhfdsv13jiwp7q4jl9khi-waydroid-1.3.3/lib/waydroid/tools/actions/initializer.py", line 205, in remote_init_client gi.require_version("Gtk", "3.0") File "/nix/store/y09awdg92zm58958q6bc6chacw35pfgm-python3.10-pygobject-3.42.2/lib/python3.10/site-packages/gi/__init__.py", line 126, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Gtk not available ``` These changes add the necessary environment (the currently idiomatic way to solve such problems) to the existing wrapper. The use in `preFixup` is necessary, as the gapps wrapper will not have ran the required hooks before. The addition of `gobject-introspection` is necessary for the wrappers hooks to add GIR repositories to the wrapper args. --- pkgs/os-specific/linux/waydroid/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/os-specific/linux/waydroid/default.nix b/pkgs/os-specific/linux/waydroid/default.nix index efa21cfb26b5..8955bcfa5126 100644 --- a/pkgs/os-specific/linux/waydroid/default.nix +++ b/pkgs/os-specific/linux/waydroid/default.nix @@ -4,12 +4,15 @@ , dnsmasq , gawk , getent +, gobject-introspection +, gtk3 , kmod , lxc , iproute2 , nftables , util-linux , which +, wrapGAppsHook , xclip }: @@ -25,6 +28,15 @@ python3Packages.buildPythonApplication rec { sha256 = "sha256-0GBob9BUwiE5cFGdK8AdwsTjTOdc+AIWqUGN/gFfOqI="; }; + buildInputs = [ + gtk3 + ]; + + nativeBuildInputs = [ + gobject-introspection + wrapGAppsHook + ]; + propagatedBuildInputs = with python3Packages; [ gbinder-python pyclip @@ -35,9 +47,14 @@ python3Packages.buildPythonApplication rec { dontUsePipInstall = true; dontUseSetuptoolsCheck = true; dontWrapPythonPrograms = true; + dontWrapGApps = true; installPhase = '' make install PREFIX=$out USE_SYSTEMD=0 USE_NFTABLES=1 + ''; + + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") wrapProgram $out/lib/waydroid/data/scripts/waydroid-net.sh \ --prefix PATH ":" ${lib.makeBinPath [ dnsmasq getent iproute2 nftables ]}