summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorMichael Roitzsch <reactorcontrol@icloud.com>2019-12-10 15:14:42 +0100
committerMichael Roitzsch <reactorcontrol@icloud.com>2020-01-15 13:23:50 +0100
commitb82d44383687094ecaf0544006726b26c65a6268 (patch)
tree101e3a6f6e9387fe40cc2b5df34d6b597ee61811 /pkgs/development/compilers
parentb472f4a2de06d1ef8d4feeec30a72cce82bbc7e6 (diff)
downloadnixpkgs-b82d44383687094ecaf0544006726b26c65a6268.tar
nixpkgs-b82d44383687094ecaf0544006726b26c65a6268.tar.gz
nixpkgs-b82d44383687094ecaf0544006726b26c65a6268.tar.bz2
nixpkgs-b82d44383687094ecaf0544006726b26c65a6268.tar.lz
nixpkgs-b82d44383687094ecaf0544006726b26c65a6268.tar.xz
nixpkgs-b82d44383687094ecaf0544006726b26c65a6268.tar.zst
nixpkgs-b82d44383687094ecaf0544006726b26c65a6268.zip
swift: fix UUID module and enable tests
* fix UUID compilation error
  This was pointed out by Swift’s test suite.
* enable tests after build
  Two broken tests disabled for now.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/swift/default.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix
index 5a61e775a9c..77bc3cc5b73 100644
--- a/pkgs/development/compilers/swift/default.nix
+++ b/pkgs/development/compilers/swift/default.nix
@@ -221,6 +221,8 @@ stdenv.mkDerivation {
 
     # Workaround hardcoded dep on "libcurses" (vs "libncurses"):
     sed -i 's/curses/ncurses/' llbuild/*/*/CMakeLists.txt
+    # 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
 
     PREFIX=''${out/#\/}
     substituteInPlace indexstore-db/Utilities/build-script-helper.py \
@@ -265,15 +267,20 @@ stdenv.mkDerivation {
       extra_cmake_options="${stdenv.lib.concatStringsSep "," cmakeFlags}"
   '';
 
-  doCheck = false;
+  doCheck = true;
 
   checkInputs = [ file ];
 
-  # TODO: investigate the non-working tests
   checkPhase = ''
+    # FIXME: disable non-working tests
+    rm $SWIFT_SOURCE_ROOT/swift/test/Driver/static-stdlib-linux.swift  # static linkage of libatomic.a complains about missing PIC
+    rm $SWIFT_SOURCE_ROOT/swift/validation-test/Python/build_swift.swift  # install_prefix not passed properly
+
+    # match the swift wrapper in the install phase
+    export LIBRARY_PATH=${icu}/lib:${libuuid.out}/lib
+
     checkTarget=check-swift-all
     ninjaFlags='-C buildbot_linux/swift-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}'
-
     ninjaCheckPhase
   '';
 
@@ -292,7 +299,7 @@ stdenv.mkDerivation {
     wrapProgram $out/bin/swift \
       --suffix C_INCLUDE_PATH : $out/lib/swift/clang/include \
       --suffix CPLUS_INCLUDE_PATH : $out/lib/swift/clang/include \
-      --suffix LIBRARY_PATH : $icu/lib
+      --suffix LIBRARY_PATH : ${icu}/lib:${libuuid.out}/lib
   '';
 
   # Hack to avoid build and install directories in RPATHs.