From a47e3409552a3948d77aa569af8cc182a11541f9 Mon Sep 17 00:00:00 2001 From: Simon Hollingshead Date: Fri, 23 Feb 2024 12:45:02 +0000 Subject: [PATCH] anbox: Make android-emugl compile with C++14. This is suggested in https://github.com/anbox/anbox/issues/2119 to support newer versions of gtest. --- .../0002-NixOS-Build-android-emugl-with-cpp-14.patch | 11 +++++++++++ pkgs/os-specific/linux/anbox/default.nix | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 pkgs/os-specific/linux/anbox/0002-NixOS-Build-android-emugl-with-cpp-14.patch diff --git a/pkgs/os-specific/linux/anbox/0002-NixOS-Build-android-emugl-with-cpp-14.patch b/pkgs/os-specific/linux/anbox/0002-NixOS-Build-android-emugl-with-cpp-14.patch new file mode 100644 index 000000000000..bf8750282684 --- /dev/null +++ b/pkgs/os-specific/linux/anbox/0002-NixOS-Build-android-emugl-with-cpp-14.patch @@ -0,0 +1,11 @@ +--- a/external/android-emugl/CMakeLists.txt ++++ b/external/android-emugl/CMakeLists.txt +@@ -1,7 +1,7 @@ + # Don't treat any warnings as error as we take the source directly from + # upstream and just compile it. + set(CMAKE_C_FLAGS "-Wall") +-set(CMAKE_CXX_FLAGS "-std=c++11 -Wall") ++set(CMAKE_CXX_FLAGS "-std=c++14 -Wall") + + # Ensure -fPIC + set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/pkgs/os-specific/linux/anbox/default.nix b/pkgs/os-specific/linux/anbox/default.nix index ad03ba1aefb2..a3724c792482 100644 --- a/pkgs/os-specific/linux/anbox/default.nix +++ b/pkgs/os-specific/linux/anbox/default.nix @@ -130,6 +130,8 @@ stdenv.mkDerivation rec { }) # Ensures generated desktop files work on store path change ./0001-NixOS-Use-anbox-from-PATH-in-desktop-files.patch + # Allows android-emugl to build with gtest 1.13+ + ./0002-NixOS-Build-android-emugl-with-cpp-14.patch # Provide window icons (fetchpatch { url = "https://github.com/samueldr/anbox/commit/2387f4fcffc0e19e52e58fb6f8264fbe87aafe4d.patch";