From 1f399bac821f11dda374c86ccded9d199bab9f01 Mon Sep 17 00:00:00 2001 From: s1341 Date: Thu, 14 Apr 2022 07:28:12 +0300 Subject: [PATCH] bionic_prebuilt: add x86_64 support --- .../linux/bionic-prebuilt/default.nix | 52 +++++++++++++------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/pkgs/os-specific/linux/bionic-prebuilt/default.nix b/pkgs/os-specific/linux/bionic-prebuilt/default.nix index 8fa17036c4ad..fc8b7d68bbc0 100644 --- a/pkgs/os-specific/linux/bionic-prebuilt/default.nix +++ b/pkgs/os-specific/linux/bionic-prebuilt/default.nix @@ -4,23 +4,44 @@ }: let - prebuilt_crt = fetchzip { - url = "https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+archive/98dce673ad97a9640c5d90bbb1c718e75c21e071/lib/gcc/aarch64-linux-android/4.9.x.tar.gz"; - sha256 = "sha256-LLD2OJi78sNN5NulOsJZl7Ei4F1EUYItGG6eUsKWULc="; - stripRoot = false; - }; + prebuilt_crt = { + aarch64 = fetchzip { + url = "https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+archive/98dce673ad97a9640c5d90bbb1c718e75c21e071/lib/gcc/aarch64-linux-android/4.9.x.tar.gz"; + sha256 = "sha256-LLD2OJi78sNN5NulOsJZl7Ei4F1EUYItGG6eUsKWULc="; + stripRoot = false; + }; + x86_64 = fetchzip { + url = "https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/+archive/7e8507d2a2d4df3bced561b894576de70f065be4/lib/gcc/x86_64-linux-android/4.9.x.tar.gz"; + sha256 = "sha256-y7CFLF76pTlj+oYev9taBnL2nlT3+Tx8c6wmicWmKEw="; + stripRoot = false; + }; + }.${stdenv.targetPlatform.parsed.cpu.name}; - prebuilt_libs = fetchzip { - url = "https://android.googlesource.com/platform/prebuilts/ndk/+archive/f2c77d8ba8a7f5c2d91771e31164f29be0b8ff98/platform/platforms/android-30/arch-arm64/usr/lib.tar.gz"; - sha256 = "sha256-TZBV7+D1QvKOCEi+VNGT5SStkgj0xRbyWoLH65zSrjw="; - stripRoot = false; - }; + prebuilt_libs = { + aarch64 = fetchzip { + url = "https://android.googlesource.com/platform/prebuilts/ndk/+archive/f2c77d8ba8a7f5c2d91771e31164f29be0b8ff98/platform/platforms/android-30/arch-arm64/usr/lib.tar.gz"; + sha256 = "sha256-TZBV7+D1QvKOCEi+VNGT5SStkgj0xRbyWoLH65zSrjw="; + stripRoot = false; + }; + x86_64 = fetchzip { + url = "https://android.googlesource.com/platform/prebuilts/ndk/+archive/f2c77d8ba8a7f5c2d91771e31164f29be0b8ff98/platform/platforms/android-30/arch-x86_64/usr/lib64.tar.gz"; + sha256 = "sha256-n2EuOKy3RGKmEYofNlm+vDDBuiQRuAJEJT6wq6NEJQs="; + stripRoot = false; + }; + }.${stdenv.targetPlatform.parsed.cpu.name}; - prebuilt_ndk_crt = fetchzip { - url = "https://android.googlesource.com/toolchain/prebuilts/ndk/r23/+archive/6c5fa4c0d3999b9ee932f6acbd430eb2f31f3151/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/30.tar.gz"; - sha256 = "sha256-KHw+cCwAwlm+5Nwp1o8WONqdi4BBDhFaVVr+7GxQ5uE="; - stripRoot = false; - }; + prebuilt_ndk_crt = { + aarch64 = fetchzip { + url = "https://android.googlesource.com/toolchain/prebuilts/ndk/r23/+archive/6c5fa4c0d3999b9ee932f6acbd430eb2f31f3151/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/30.tar.gz"; + sha256 = "sha256-KHw+cCwAwlm+5Nwp1o8WONqdi4BBDhFaVVr+7GxQ5uE="; + stripRoot = false; + }; + x86_64 = fetchzip { + url = "https://android.googlesource.com/toolchain/prebuilts/ndk/r23/+archive/6c5fa4c0d3999b9ee932f6acbd430eb2f31f3151/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/30.tar.gz"; + sha256 = "sha256-XEd7L3cBzn+1pKfji40V92G/uZhHSMMuZcRZaiKkLnk="; + stripRoot = false; + }; + }.${stdenv.targetPlatform.parsed.cpu.name}; ndk_support_headers = fetchzip { url ="https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/0e7f808fa26cce046f444c9616d9167dafbfb272/clang-r416183b/include/c++/v1/support.tar.gz"; @@ -41,6 +62,7 @@ in stdenvNoCC.mkDerivation rec { pname = "bionic-prebuilt"; version = "ndk-release-r23"; + name = "${stdenv.targetPlatform.parsed.cpu.name}-${pname}-${version}"; src = fetchzip { url = "https://android.googlesource.com/platform/bionic/+archive/00e8ce1142d8823b0d2fc8a98b40119b0f1f02cd.tar.gz";