commit
d5a533de97
|
@ -16,11 +16,36 @@
|
||||||
, protobufc
|
, protobufc
|
||||||
, python
|
, python
|
||||||
, lxc
|
, 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 {
|
stdenv.mkDerivation rec {
|
||||||
pname = "anbox";
|
pname = "anbox";
|
||||||
version = "2019-03-07";
|
version = "unstable-2019-03-07";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = pname;
|
owner = pname;
|
||||||
|
@ -29,10 +54,14 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "1wfx4bsyxvrjl16dq5pqgial8rnnsnxzbak2ap0waddz847czxwz";
|
sha256 = "1wfx4bsyxvrjl16dq5pqgial8rnnsnxzbak2ap0waddz847czxwz";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
makeWrapper
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
cmake pkgconfig dbus boost libcap gtest systemd mesa glib
|
cmake pkgconfig dbus boost libcap gtest systemd mesa glib
|
||||||
SDL2 SDL2_image protobuf protobufc properties-cpp lxc python
|
SDL2 SDL2_image protobuf protobufc properties-cpp lxc python
|
||||||
makeWrapper libGL
|
libGL
|
||||||
];
|
];
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
|
@ -68,31 +97,16 @@ stdenv.mkDerivation rec {
|
||||||
--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [libGL libglvnd]} \
|
--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [libGL libglvnd]} \
|
||||||
--prefix PATH : ${git}/bin
|
--prefix PATH : ${git}/bin
|
||||||
|
|
||||||
mkdir -p $out/share/dbus-1/services/
|
mkdir -p $out/share/dbus-1/services
|
||||||
cat <<END > $out/share/dbus-1/services/org.anbox.service
|
substitute ${dbus-service} $out/share/dbus-1/services/org.anbox.service \
|
||||||
[D-BUS Service]
|
--subst-var out
|
||||||
Name=org.anbox
|
|
||||||
Exec=$out/libexec/anbox-session-manager
|
|
||||||
END
|
|
||||||
|
|
||||||
mkdir $out/libexec
|
mkdir $out/libexec
|
||||||
cat > $out/libexec/anbox-session-manager <<EOF
|
makeWrapper $out/bin/anbox $out/libexec/anbox-session-manager \
|
||||||
#!${stdenv.shell}
|
--add-flags session-manager
|
||||||
exec $out/bin/anbox session-manager
|
|
||||||
EOF
|
|
||||||
chmod +x $out/libexec/anbox-session-manager
|
|
||||||
|
|
||||||
cat > $out/bin/anbox-application-manager <<EOF
|
substitute ${anbox-application-manager} $out/bin/anbox-application-manager \
|
||||||
#!${stdenv.shell}
|
--subst-var out
|
||||||
${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
|
|
||||||
EOF
|
|
||||||
chmod +x $out/bin/anbox-application-manager
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.image = let
|
passthru.image = let
|
||||||
|
@ -115,7 +129,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = https://anbox.io;
|
homepage = https://anbox.io;
|
||||||
description = "Android in a box.";
|
description = "Android in a box";
|
||||||
license = licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
maintainers = with maintainers; [ edwtjo ];
|
maintainers = with maintainers; [ edwtjo ];
|
||||||
platforms = [ "armv7l-linux" "aarch64-linux" "x86-64-linux" ];
|
platforms = [ "armv7l-linux" "aarch64-linux" "x86-64-linux" ];
|
||||||
|
|
Loading…
Reference in New Issue