Merge pull request #280627 from NickCao/aemu

aemu: restrict to supported platforms
This commit is contained in:
Nick Cao 2024-01-15 20:44:57 -05:00 committed by GitHub
commit b99d3d9b77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 7 deletions

View file

@ -23,7 +23,7 @@
, cephSupport ? false, ceph , cephSupport ? false, ceph
, glusterfsSupport ? false, glusterfs, libuuid , glusterfsSupport ? false, glusterfs, libuuid
, openGLSupport ? sdlSupport, mesa, libepoxy, libdrm , openGLSupport ? sdlSupport, mesa, libepoxy, libdrm
, rutabagaSupport ? openGLSupport && !toolsOnly, rutabaga_gfx , rutabagaSupport ? openGLSupport && !toolsOnly && lib.meta.availableOn stdenv.hostPlatform rutabaga_gfx, rutabaga_gfx
, virglSupport ? openGLSupport, virglrenderer , virglSupport ? openGLSupport, virglrenderer
, libiscsiSupport ? !toolsOnly, libiscsi , libiscsiSupport ? !toolsOnly, libiscsi
, smbdSupport ? false, samba , smbdSupport ? false, samba

View file

@ -28,6 +28,7 @@ stdenv.mkDerivation {
# The BSD license comes from host-common/VpxFrameParser.cpp, which # The BSD license comes from host-common/VpxFrameParser.cpp, which
# incorporates some code from libvpx, which uses the 3-clause BSD license. # incorporates some code from libvpx, which uses the 3-clause BSD license.
license = with licenses; [ asl20 mit bsd3 ]; license = with licenses; [ asl20 mit bsd3 ];
platforms = platforms.darwin ++ platforms.linux; # See base/include/aemu/base/synchronization/Lock.h
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
}; };
} }

View file

@ -29,6 +29,6 @@ stdenv.mkDerivation {
description = "Graphics Streaming Kit"; description = "Graphics Streaming Kit";
license = licenses.free; # https://android.googlesource.com/platform/hardware/google/gfxstream/+/refs/heads/main/LICENSE license = licenses.free; # https://android.googlesource.com/platform/hardware/google/gfxstream/+/refs/heads/main/LICENSE
maintainers = with maintainers; [ qyliss ]; maintainers = with maintainers; [ qyliss ];
platforms = platforms.darwin ++ platforms.linux; platforms = aemu.meta.platforms;
}; };
} }

View file

@ -1,5 +1,13 @@
{ lib, stdenv, fetchgit, cargo, pkg-config, rustPlatform { lib
, aemu, gfxstream, libcap, libdrm, minijail , stdenv
, fetchgit
, fetchpatch
, cargo
, pkg-config
, rustPlatform
, aemu
, gfxstream
, libdrm
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
@ -13,9 +21,23 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-0RJDKzeU7U6hc6CLKks8QcRs3fxN+/LYUbB0t6W790M="; hash = "sha256-0RJDKzeU7U6hc6CLKks8QcRs3fxN+/LYUbB0t6W790M=";
}; };
patches = [
# Make gfxstream optional
# https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4860836
(fetchpatch {
url = "https://chromium.googlesource.com/crosvm/crosvm/+/c3ad0e43eb12cbf737a6049e0134d483e337363f%5E%21/?format=TEXT";
decode = "base64 -d";
hash = "sha256-Ji1bK7jnRlg0OpDfCLcTHfPSiz3zYcdgsWL4n3EoIYI=";
})
];
nativeBuildInputs = [ cargo pkg-config rustPlatform.cargoSetupHook ]; nativeBuildInputs = [ cargo pkg-config rustPlatform.cargoSetupHook ];
buildInputs = [ aemu gfxstream ] buildInputs = lib.optionals (lib.meta.availableOn stdenv.hostPlatform gfxstream) ([
++ lib.optional (lib.meta.availableOn stdenv.hostPlatform libdrm) libdrm; aemu
gfxstream
] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libdrm) [
libdrm
]);
cargoDeps = rustPlatform.fetchCargoTarball { cargoDeps = rustPlatform.fetchCargoTarball {
inherit (finalAttrs) src; inherit (finalAttrs) src;