diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-04-10 20:43:08 +0200 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-04-10 20:43:08 +0200 |
commit | 69bfdf2484041b9d242840c4e5017b4703383bb0 (patch) | |
tree | d8bdaa69e7990d7d6f09b594b3c425f742acd2d0 /nixpkgs/pkgs/development/libraries/gfxstream | |
parent | c8aee4b4363b6bf905a521b05b7476960e8286c8 (diff) | |
parent | d8fe5e6c92d0d190646fb9f1056741a229980089 (diff) | |
download | nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.gz nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.bz2 nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.lz nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.xz nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.zst nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.zip |
Merge commit 'd8fe5e6c'
Conflicts: nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gfxstream')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/gfxstream/default.nix | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gfxstream/default.nix b/nixpkgs/pkgs/development/libraries/gfxstream/default.nix index 196bca7cdc5f..e3164c95a4c6 100644 --- a/nixpkgs/pkgs/development/libraries/gfxstream/default.nix +++ b/nixpkgs/pkgs/development/libraries/gfxstream/default.nix @@ -1,5 +1,5 @@ -{ lib, stdenv, fetchFromGitiles, meson, ninja, pkg-config, python3 -, aemu, libdrm, libglvnd, vulkan-headers, vulkan-loader, xorg +{ lib, stdenv, fetchFromGitiles, fetchpatch, meson, ninja, pkg-config, python3 +, aemu, darwin, libdrm, libglvnd, vulkan-headers, vulkan-loader, xorg }: stdenv.mkDerivation { @@ -12,14 +12,45 @@ stdenv.mkDerivation { hash = "sha256-IYXkaHZPEYIE9KW731GN6x6yRS+FYtP1zyHcaSofhIM="; }; + patches = [ + # Make libdrm an optional dependency, which is required to build on Darwin. + (fetchpatch { + url = "https://android.googlesource.com/platform/hardware/google/gfxstream/+/a8df2a3eb099b419a7b3638e68ea30b4cffb751b%5E%21/?format=TEXT"; + decode = "base64 -d"; + hash = "sha256-shjeNuxtQokscCGBKEUbOPKOWRELBAnHFNj3Y5w87Nw="; + }) + ]; + + # Ensure that meson can find an Objective-C compiler on Darwin. + postPatch = lib.optionalString stdenv.isDarwin '' + substituteInPlace meson.build \ + --replace-fail "project('gfxstream_backend', 'cpp', 'c'" "project('gfxstream_backend', 'cpp', 'c', 'objc'" + ''; + nativeBuildInputs = [ meson ninja pkg-config python3 ]; buildInputs = [ aemu libglvnd vulkan-headers vulkan-loader xorg.libX11 ] - ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform libdrm) libdrm; + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libdrm) [ libdrm ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Cocoa + darwin.apple_sdk.frameworks.CoreGraphics + darwin.apple_sdk.frameworks.IOKit + darwin.apple_sdk.frameworks.IOSurface + darwin.apple_sdk.frameworks.OpenGL + darwin.apple_sdk.frameworks.QuartzCore + ]; + + env = lib.optionalAttrs stdenv.isDarwin { + NIX_LDFLAGS = toString [ + "-framework Cocoa" + "-framework IOKit" + "-framework IOSurface" + "-framework OpenGL" + "-framework QuartzCore" + "-needed-lvulkan" + ]; + }; # dlopens libvulkan. - # - # XXX: Unsure if this is required on Darwin. If it is, it probably - # needs to be done using install_name_tool. preConfigure = lib.optionalString (!stdenv.isDarwin) '' mesonFlagsArray=(-Dcpp_link_args="-Wl,--push-state -Wl,--no-as-needed -lvulkan -Wl,--pop-state") ''; |