swift: Fix build for glibc 2.30

This commit is contained in:
Silvan Mosberger
2020-02-21 10:10:07 +01:00
parent 1ddb140d95
commit 7d8a33125f
2 changed files with 35 additions and 0 deletions
@@ -26,6 +26,7 @@
, git
, libgit2
, fetchFromGitHub
, fetchpatch
, findutils
, makeWrapper
, gnumake
@@ -224,6 +225,15 @@ stdenv.mkDerivation {
# uuid.h is not part of glibc, but of libuuid
sed -i 's|''${GLIBC_INCLUDE_PATH}/uuid/uuid.h|${libuuid.dev}/include/uuid/uuid.h|' swift/stdlib/public/Platform/glibc.modulemap.gyb
# Compatibility with glibc 2.30
# Adapted from https://github.com/apple/swift-package-manager/pull/2408
patch -p1 -d swiftpm -i ${./patches/swift-package-manager-glibc-2.30.patch}
# https://github.com/apple/swift/pull/27288
patch -p1 -d swift -i ${fetchpatch {
url = "https://github.com/apple/swift/commit/f968f4282d53f487b29cf456415df46f9adf8748.patch";
sha256 = "1aa7l66wlgip63i4r0zvi9072392bnj03s4cn12p706hbpq0k37c";
}}
PREFIX=''${out/#\/}
substituteInPlace indexstore-db/Utilities/build-script-helper.py \
--replace usr "$PREFIX"