diff --git a/pkgs/by-name/wa/waydroid/package.nix b/pkgs/by-name/wa/waydroid/package.nix new file mode 100644 index 0000000000000..8ea14e4b7c377 --- /dev/null +++ b/pkgs/by-name/wa/waydroid/package.nix @@ -0,0 +1,106 @@ +{ + lib, + fetchFromGitHub, + fetchpatch, + python3Packages, + dnsmasq, + gawk, + getent, + gobject-introspection, + gtk3, + kmod, + lxc, + iproute2, + iptables, + util-linux, + wrapGAppsHook3, + wl-clipboard, + runtimeShell, + nix-update-script, +}: + +python3Packages.buildPythonApplication rec { + pname = "waydroid"; + version = "1.4.3"; + format = "other"; + + src = fetchFromGitHub { + owner = "waydroid"; + repo = "waydroid"; + rev = "refs/tags/${version}"; + hash = "sha256-LejyuGYgW46++95XROuWc13Q+w0l+AzGAl9ekfmAIEk="; + }; + + nativeBuildInputs = [ + gobject-introspection + wrapGAppsHook3 + ]; + + buildInputs = [ + gtk3 + ]; + + propagatedBuildInputs = with python3Packages; [ + dbus-python + gbinder-python + pyclip + pygobject3 + ]; + + dontUseSetuptoolsBuild = true; + dontUsePipInstall = true; + dontUseSetuptoolsCheck = true; + dontWrapPythonPrograms = true; + dontWrapGApps = true; + + installFlags = [ + "PREFIX=$(out)" + "USE_SYSTEMD=0" + "SYSCONFDIR=$(out)/etc" + ]; + + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + + patchShebangs --host $out/lib/waydroid/data/scripts + wrapProgram $out/lib/waydroid/data/scripts/waydroid-net.sh \ + --prefix PATH ":" ${ + lib.makeBinPath [ + dnsmasq + getent + iproute2 + iptables + ] + } + + wrapPythonProgramsIn $out/lib/waydroid/ "${ + lib.concatStringsSep " " ( + [ + "$out" + ] + ++ propagatedBuildInputs + ++ [ + gawk + kmod + lxc + util-linux + wl-clipboard + ] + ) + }" + + substituteInPlace $out/lib/waydroid/tools/helpers/*.py \ + --replace '"sh"' '"${runtimeShell}"' + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Container-based approach to boot a full Android system on a regular GNU/Linux system"; + mainProgram = "waydroid"; + homepage = "https://github.com/waydroid/waydroid"; + license = lib.licenses.gpl3Only; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ mcaju ]; + }; +} diff --git a/pkgs/os-specific/linux/waydroid/default.nix b/pkgs/os-specific/linux/waydroid/default.nix deleted file mode 100644 index 5e29b911ca548..0000000000000 --- a/pkgs/os-specific/linux/waydroid/default.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ lib -, fetchFromGitHub -, fetchpatch -, python3Packages -, dnsmasq -, gawk -, getent -, gobject-introspection -, gtk3 -, kmod -, lxc -, iproute2 -, iptables -, util-linux -, wrapGAppsHook3 -, wl-clipboard -, runtimeShell -}: - -python3Packages.buildPythonApplication rec { - pname = "waydroid"; - version = "1.4.2"; - format = "other"; - - src = fetchFromGitHub { - owner = pname; - repo = pname; - rev = version; - sha256 = "sha256-/dFvhiK3nCOOmAtrYkQEB8Ge8Rf1ea5cDO7puTwS5bI="; - }; - - patches = [ - # https://github.com/waydroid/waydroid/pull/1218 - (fetchpatch { - url = "https://github.com/waydroid/waydroid/commit/595e0e5b309a79fedaa07d90b9073ddcb156314c.patch"; - hash = "sha256-A+rUmJbFFhMZ5WpT+QBCTEcn82wJuvmi8Wbcsio41Nk="; - }) - ]; - - nativeBuildInputs = [ - gobject-introspection - wrapGAppsHook3 - ]; - - buildInputs = [ - gtk3 - ]; - - propagatedBuildInputs = with python3Packages; [ - dbus-python - gbinder-python - pyclip - pygobject3 - ]; - - dontUseSetuptoolsBuild = true; - dontUsePipInstall = true; - dontUseSetuptoolsCheck = true; - dontWrapPythonPrograms = true; - dontWrapGApps = true; - - installPhase = '' - make install PREFIX=$out USE_SYSTEMD=0 - ''; - - preFixup = '' - makeWrapperArgs+=("''${gappsWrapperArgs[@]}") - - patchShebangs --host $out/lib/waydroid/data/scripts - wrapProgram $out/lib/waydroid/data/scripts/waydroid-net.sh \ - --prefix PATH ":" ${lib.makeBinPath [ dnsmasq getent iproute2 iptables ]} - - wrapPythonProgramsIn $out/lib/waydroid/ "${lib.concatStringsSep " " ([ - "$out" - ] ++ propagatedBuildInputs ++ [ - gawk - kmod - lxc - util-linux - wl-clipboard - ])}" - - substituteInPlace $out/lib/waydroid/tools/helpers/*.py \ - --replace '"sh"' '"${runtimeShell}"' - ''; - - meta = { - description = "Waydroid is a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu"; - mainProgram = "waydroid"; - homepage = "https://github.com/waydroid/waydroid"; - license = lib.licenses.gpl3; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ mcaju ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ac40c890cd236..489fe0a38e1af 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3824,8 +3824,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Carbon; }; - waydroid = callPackage ../os-specific/linux/waydroid { }; - wgo = callPackage ../development/tools/wgo { }; wiiload = callPackage ../development/tools/wiiload { };