From 739381f0c1bef136ed822b15dfa7a6587d9da636 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 27 Feb 2021 18:57:20 +0000 Subject: [PATCH 1/2] freetype: patch pkg-config in -config better When we have build == host != target, we don't want to patch in a prefixed pkg-config used for cross compiling. Using `pkgsHostHost` expressses the intent. Then again, per https://github.com/NixOS/nixpkgs/issues/51176 leaving `buildPackages.pkg-config` is arguably also correct, if we do further cross compilation and want to run `freetype-config`. Really, there is no good solution. --- pkgs/development/libraries/freetype/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix index 7b5fff29a286..adda15696e8a 100644 --- a/pkgs/development/libraries/freetype/default.nix +++ b/pkgs/development/libraries/freetype/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl -, buildPackages +, buildPackages, pkgsHostHost , pkg-config, which, makeWrapper , zlib, bzip2, libpng, gnumake, glib @@ -64,7 +64,7 @@ in stdenv.mkDerivation rec { postInstall = glib.flattenInclude + '' substituteInPlace $dev/bin/freetype-config \ - --replace ${buildPackages.pkg-config} ${pkg-config} + --replace ${buildPackages.pkg-config} ${pkgsHostHost.pkg-config} wrapProgram "$dev/bin/freetype-config" \ --set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig" From aee60bef7a615c93de5fb726a1c85aeb45e99aa0 Mon Sep 17 00:00:00 2001 From: s1341 Date: Wed, 10 Feb 2021 20:38:17 +0200 Subject: [PATCH 2/2] android_prebuilt: Fix eval --- pkgs/build-support/bintools-wrapper/default.nix | 3 ++- pkgs/build-support/cc-wrapper/default.nix | 5 ++++- .../mobile/androidenv/compose-android-packages.nix | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 8fef2ca6624c..3243e883e4d5 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -53,7 +53,8 @@ let dynamicLinker = /**/ if libc == null then null else if targetPlatform.libc == "musl" then "${libc_lib}/lib/ld-musl-*" - else if targetPlatform.libc == "bionic" then "/system/bin/linker" + else if (targetPlatform.libc == "bionic" && targetPlatform.is32bit) then "/system/bin/linker" + else if (targetPlatform.libc == "bionic" && targetPlatform.is64bit) then "/system/bin/linker64" else if targetPlatform.libc == "nblibc" then "${libc_lib}/libexec/ld.elf_so" else if targetPlatform.system == "i686-linux" then "${libc_lib}/lib/ld-linux.so.2" else if targetPlatform.system == "x86_64-linux" then "${libc_lib}/lib/ld-linux-x86-64.so.2" diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index c8af8789fccf..65f9791597e8 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -298,7 +298,10 @@ stdenv.mkDerivation { # vs libstdc++, etc.) since Darwin isn't `useLLVM` on all counts. (See # https://clang.llvm.org/docs/Toolchain.html for all the axes one might # break `useLLVM` into.) - + optionalString (isClang && gccForLibs != null && targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + + optionalString (isClang && gccForLibs != null + && targetPlatform.isLinux + && !(stdenv.targetPlatform.useAndroidPrebuilt or false) + && !(stdenv.targetPlatform.useLLVM or false)) '' echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags '' diff --git a/pkgs/development/mobile/androidenv/compose-android-packages.nix b/pkgs/development/mobile/androidenv/compose-android-packages.nix index fd78fa9ac0f8..5db3538563f9 100644 --- a/pkgs/development/mobile/androidenv/compose-android-packages.nix +++ b/pkgs/development/mobile/androidenv/compose-android-packages.nix @@ -24,7 +24,8 @@ }: let - inherit (pkgs) stdenv lib fetchurl makeWrapper unzip; + inherit (pkgs) stdenv lib fetchurl; + inherit (pkgs.buildPackages) makeWrapper unzip; # Determine the Android os identifier from Nix's system identifier os = if stdenv.system == "x86_64-linux" then "linux"