Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3f217df9fbf9
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d5a533de9742
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Mar 22, 2019

  1. anbox: cleanup

    Use trivial builders for all the text manipulation and use runtimeShell
    worldofpeace committed Mar 22, 2019
    Copy the full SHA
    1e2b834 View commit details

Commits on Mar 23, 2019

  1. Merge pull request #58143 from worldofpeace/anbox-nits

    anbox: cleanup
    gebner authored Mar 23, 2019
    Copy the full SHA
    d5a533d View commit details
Showing with 39 additions and 25 deletions.
  1. +39 −25 pkgs/os-specific/linux/anbox/default.nix
64 changes: 39 additions & 25 deletions pkgs/os-specific/linux/anbox/default.nix
Original file line number Diff line number Diff line change
@@ -16,11 +16,36 @@
, protobufc
, python
, lxc
, writeText
, writeScript
, runtimeShell
}:

let

dbus-service = writeText "org.anbox.service" ''
[D-BUS Service]
Name=org.anbox
Exec=@out@/libexec/anbox-session-manager
'';

anbox-application-manager = writeScript "anbox-application-manager" ''
#!${runtimeShell}
${systemd}/bin/busctl --user call \
org.freedesktop.DBus \
/org/freedesktop/DBus \
org.freedesktop.DBus \
StartServiceByName "su" org.anbox 0
@out@/bin/anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
'';

in

stdenv.mkDerivation rec {
pname = "anbox";
version = "2019-03-07";
version = "unstable-2019-03-07";

src = fetchFromGitHub {
owner = pname;
@@ -29,10 +54,14 @@ stdenv.mkDerivation rec {
sha256 = "1wfx4bsyxvrjl16dq5pqgial8rnnsnxzbak2ap0waddz847czxwz";
};

nativeBuildInputs = [
makeWrapper
];

buildInputs = [
cmake pkgconfig dbus boost libcap gtest systemd mesa glib
SDL2 SDL2_image protobuf protobufc properties-cpp lxc python
makeWrapper libGL
libGL
];

patchPhase = ''
@@ -68,31 +97,16 @@ stdenv.mkDerivation rec {
--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [libGL libglvnd]} \
--prefix PATH : ${git}/bin
mkdir -p $out/share/dbus-1/services/
cat <<END > $out/share/dbus-1/services/org.anbox.service
[D-BUS Service]
Name=org.anbox
Exec=$out/libexec/anbox-session-manager
END
mkdir -p $out/share/dbus-1/services
substitute ${dbus-service} $out/share/dbus-1/services/org.anbox.service \
--subst-var out
mkdir $out/libexec
cat > $out/libexec/anbox-session-manager <<EOF
#!${stdenv.shell}
exec $out/bin/anbox session-manager
EOF
chmod +x $out/libexec/anbox-session-manager
cat > $out/bin/anbox-application-manager <<EOF
#!${stdenv.shell}
${systemd}/bin/busctl --user call \
org.freedesktop.DBus \
/org/freedesktop/DBus \
org.freedesktop.DBus \
StartServiceByName "su" org.anbox 0
makeWrapper $out/bin/anbox $out/libexec/anbox-session-manager \
--add-flags session-manager
$out/bin/anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
EOF
chmod +x $out/bin/anbox-application-manager
substitute ${anbox-application-manager} $out/bin/anbox-application-manager \
--subst-var out
'';

passthru.image = let
@@ -115,7 +129,7 @@ stdenv.mkDerivation rec {

meta = with stdenv.lib; {
homepage = https://anbox.io;
description = "Android in a box.";
description = "Android in a box";
license = licenses.gpl2;
maintainers = with maintainers; [ edwtjo ];
platforms = [ "armv7l-linux" "aarch64-linux" "x86-64-linux" ];