summary refs log tree commit diff
path: root/pkgs/development/compilers/swift/patches
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/swift/patches')
-rw-r--r--pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch16
-rw-r--r--pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch20
-rw-r--r--pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch10
-rw-r--r--pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch16
-rw-r--r--pkgs/development/compilers/swift/patches/glibc-arch-headers.patch2
-rw-r--r--pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch13
-rw-r--r--pkgs/development/compilers/swift/patches/llvm-include-dirs.patch13
-rw-r--r--pkgs/development/compilers/swift/patches/llvm-toolchain-dir.patch24
8 files changed, 38 insertions, 76 deletions
diff --git a/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch b/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch
index 79482ac10e6..60b2996b340 100644
--- a/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch
+++ b/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch
@@ -1,17 +1,8 @@
-From 1fc49285c7a198de14005803dfde64bda17f4120 Mon Sep 17 00:00:00 2001
-From: Will Dietz <w@wdtz.org>
-Date: Tue, 28 Mar 2017 15:01:16 -0500
-Subject: [PATCH 1/4] build-presets: (linux) don't require using Ninja
+Don't build Ninja, we use our own.
 
----
- utils/build-presets.ini | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/utils/build-presets.ini b/utils/build-presets.ini
-index 7ee57ad2df..e6b0af3581 100644
 --- a/utils/build-presets.ini
 +++ b/utils/build-presets.ini
-@@ -721,7 +721,7 @@ swiftpm
+@@ -745,7 +745,7 @@ swiftpm
  
  dash-dash
  
@@ -20,6 +11,3 @@ index 7ee57ad2df..e6b0af3581 100644
  install-swift
  install-lldb
  install-llbuild
--- 
-2.12.2
-
diff --git a/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch b/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch
index 5c1927acb7f..5ca6bf1354d 100644
--- a/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch
+++ b/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch
@@ -1,25 +1,13 @@
-From fca6624b7a0ad670157105336a737cc95f9ce9fb Mon Sep 17 00:00:00 2001
-From: Will Dietz <w@wdtz.org>
-Date: Tue, 28 Mar 2017 15:01:40 -0500
-Subject: [PATCH 2/4] build-presets: (linux) allow custom install prefix
+allow custom install prefix
 
----
- utils/build-presets.ini | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/utils/build-presets.ini b/utils/build-presets.ini
-index e6b0af3581..1095cbaab7 100644
 --- a/utils/build-presets.ini	2019-04-11 14:51:40.060259462 +0200
 +++ b/utils/build-presets.ini	2019-04-11 15:16:17.471137969 +0200
-@@ -728,7 +728,7 @@
+@@ -752,7 +752,7 @@
  install-swiftpm
  install-xctest
  install-libicu
 -install-prefix=/usr
 +install-prefix=%(install_prefix)s
- swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc
- llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt
  install-libcxx
--- 
-2.12.2
-
+ install-sourcekit-lsp
+ build-swift-static-stdlib
diff --git a/pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch b/pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch
index 5d766bc2590..0a66af9e513 100644
--- a/pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch
+++ b/pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch
@@ -1,6 +1,8 @@
+Disable targets, where we use Nix packages.
+
 --- a/utils/build-presets.ini	2019-04-11 15:19:57.845178834 +0200
 +++ b/utils/build-presets.ini	2019-04-11 15:27:42.041297057 +0200
-@@ -716,8 +716,6 @@
+@@ -740,8 +740,6 @@
  llbuild
  swiftpm
  xctest
@@ -9,15 +11,13 @@
  
  dash-dash
  
-@@ -727,11 +725,9 @@
+@@ -751,9 +749,7 @@
  install-llbuild
  install-swiftpm
  install-xctest
 -install-libicu
  install-prefix=%(install_prefix)s
- swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc
- llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt
 -install-libcxx
+ install-sourcekit-lsp
  build-swift-static-stdlib
  build-swift-static-sdk-overlay
- build-swift-stdlib-unittest-extra
diff --git a/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch b/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch
index 1d0a6a9577a..304b53a1dbf 100644
--- a/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch
+++ b/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch
@@ -1,17 +1,8 @@
-From 4a46b12f580d0a9779937d07c4f1fd347570c4ef Mon Sep 17 00:00:00 2001
-From: Will Dietz <w@wdtz.org>
-Date: Tue, 28 Mar 2017 15:02:37 -0500
-Subject: [PATCH 4/4] build-presets: (linux) plumb extra-cmake-options
+plumb extra-cmake-options
 
----
- utils/build-presets.ini | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/utils/build-presets.ini b/utils/build-presets.ini
-index 1739e91dc2..0608fed9c1 100644
 --- a/utils/build-presets.ini
 +++ b/utils/build-presets.ini
-@@ -743,6 +743,8 @@ install-destdir=%(install_destdir)s
+@@ -766,6 +766,8 @@ install-destdir=%(install_destdir)s
  # Path to the .tar.gz package we would create.
  installable-package=%(installable_package)s
  
@@ -20,6 +11,3 @@ index 1739e91dc2..0608fed9c1 100644
  [preset: buildbot_linux]
  mixin-preset=mixin_linux_installation
  build-subdir=buildbot_linux
--- 
-2.12.2
-
diff --git a/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch b/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch
index df906f9c84c..c05db520801 100644
--- a/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch
+++ b/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch
@@ -2,7 +2,7 @@ The Nix glibc headers do not use include/x86_64-linux-gnu subdirectories.
 
 --- swift/stdlib/public/Platform/CMakeLists.txt	2019-04-09 20:14:44.493801403 +0200
 +++ swift/stdlib/public/Platform/CMakeLists.txt	2019-04-09 20:14:44.577800593 +0200
-@@ -68,7 +68,7 @@
+@@ -77,7 +77,7 @@
      endif()
  
      set(GLIBC_INCLUDE_PATH "${GLIBC_SYSROOT_RELATIVE_INCLUDE_PATH}")
diff --git a/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch b/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch
deleted file mode 100644
index d23a308d68f..00000000000
--- a/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Nix compiles with _FORTIFY_SOURCE enabled. Fix error due to -Werror and an unused return value warning.
-
---- swift-corelibs-libdispatch/src/internal.h	2019-04-26 09:33:38.287289099 +0200
-+++ swift-corelibs-libdispatch/src/internal.h	2019-04-26 15:31:10.485334128 +0200
-@@ -1053,7 +1053,7 @@
- #else
- #define _dispatch_client_assert_fail(fmt, ...)  do { \
- 		char *_msg = NULL; \
--		asprintf(&_msg, "%s" fmt, DISPATCH_ASSERTION_FAILED_MESSAGE, \
-+		(void)asprintf(&_msg, "%s" fmt, DISPATCH_ASSERTION_FAILED_MESSAGE, \
- 				##__VA_ARGS__); \
- 		_dispatch_assert_crash(_msg); \
- 		free(_msg); \
diff --git a/pkgs/development/compilers/swift/patches/llvm-include-dirs.patch b/pkgs/development/compilers/swift/patches/llvm-include-dirs.patch
deleted file mode 100644
index 789c0be7e7a..00000000000
--- a/pkgs/development/compilers/swift/patches/llvm-include-dirs.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Only use the Nix include dirs when no sysroot is configured.
-
---- clang/lib/Driver/ToolChains/Linux.cpp	2018-10-05 18:01:15.731109551 +0200
-+++ clang/lib/Driver/ToolChains/Linux.cpp	2018-10-05 18:00:27.959509924 +0200
-@@ -641,7 +641,7 @@
- 
-   // Check for configure-time C include directories.
-   StringRef CIncludeDirs(C_INCLUDE_DIRS);
--  if (CIncludeDirs != "") {
-+  if (CIncludeDirs != "" && (SysRoot.empty() || SysRoot == "/")) {
-     SmallVector<StringRef, 5> dirs;
-     CIncludeDirs.split(dirs, ":");
-     for (StringRef dir : dirs) {
diff --git a/pkgs/development/compilers/swift/patches/llvm-toolchain-dir.patch b/pkgs/development/compilers/swift/patches/llvm-toolchain-dir.patch
new file mode 100644
index 00000000000..c22b5c820c8
--- /dev/null
+++ b/pkgs/development/compilers/swift/patches/llvm-toolchain-dir.patch
@@ -0,0 +1,24 @@
+Use the Nix include dirs and gcc runtime dir, when no sysroot is configured.
+
+--- clang/lib/Driver/ToolChains/Linux.cpp	2018-10-05 18:01:15.731109551 +0200
++++ clang/lib/Driver/ToolChains/Linux.cpp	2018-10-05 18:00:27.959509924 +0200
+@@ -665,7 +665,7 @@
+ 
+   // Check for configure-time C include directories.
+   StringRef CIncludeDirs(C_INCLUDE_DIRS);
+-  if (CIncludeDirs != "") {
++  if (CIncludeDirs != "" && (SysRoot.empty() || SysRoot == "/")) {
+     SmallVector<StringRef, 5> dirs;
+     CIncludeDirs.split(dirs, ":");
+     for (StringRef dir : dirs) {
+--- clang/lib/Driver/ToolChains/Gnu.cpp	2019-10-26 09:49:27.003752743 +0200
++++ clang/lib/Driver/ToolChains/Gnu.cpp	2019-10-26 09:50:49.067236497 +0200
+@@ -1743,7 +1743,7 @@
+   // If we have a SysRoot, ignore GCC_INSTALL_PREFIX.
+   // GCC_INSTALL_PREFIX specifies the gcc installation for the default
+   // sysroot and is likely not valid with a different sysroot.
+-  if (!SysRoot.empty())
++  if (!(SysRoot.empty() || SysRoot == "/"))
+     return "";
+ 
+   return GCC_INSTALL_PREFIX;