summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2017-05-25 15:07:00 -0500
committerWill Dietz <w@wdtz.org>2017-05-27 14:10:01 -0500
commit5e659e94a6061c9acd983ad0b5c26206b83f5735 (patch)
tree0a4c1e51cf823d7ed24212d7160e58990f1a0071 /pkgs/development/compilers
parent80918692e1d865e75cb2286705d392f12829f728 (diff)
downloadnixpkgs-5e659e94a6061c9acd983ad0b5c26206b83f5735.tar
nixpkgs-5e659e94a6061c9acd983ad0b5c26206b83f5735.tar.gz
nixpkgs-5e659e94a6061c9acd983ad0b5c26206b83f5735.tar.bz2
nixpkgs-5e659e94a6061c9acd983ad0b5c26206b83f5735.tar.lz
nixpkgs-5e659e94a6061c9acd983ad0b5c26206b83f5735.tar.xz
nixpkgs-5e659e94a6061c9acd983ad0b5c26206b83f5735.tar.zst
nixpkgs-5e659e94a6061c9acd983ad0b5c26206b83f5735.zip
lldb-4: Patch to fix libedit usage on Linux
Idea from:
https://bugs.llvm.org//show_bug.cgi?id=28898#c7

Fixes ability to use arrow keys.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/llvm/4/lldb-libedit.patch30
-rw-r--r--pkgs/development/compilers/llvm/4/lldb.nix7
2 files changed, 32 insertions, 5 deletions
diff --git a/pkgs/development/compilers/llvm/4/lldb-libedit.patch b/pkgs/development/compilers/llvm/4/lldb-libedit.patch
new file mode 100644
index 00000000000..73459ce6c86
--- /dev/null
+++ b/pkgs/development/compilers/llvm/4/lldb-libedit.patch
@@ -0,0 +1,30 @@
+From 94764369222a8e6c65420a6981d7f179a18a5417 Mon Sep 17 00:00:00 2001
+From: Will Dietz <w@wdtz.org>
+Date: Thu, 25 May 2017 15:03:42 -0500
+Subject: [PATCH] EditLine.h: libedit supports wide chars on NixOS
+
+---
+ include/lldb/Host/Editline.h | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/include/lldb/Host/Editline.h b/include/lldb/Host/Editline.h
+index faed373bc..b248cdee1 100644
+--- a/include/lldb/Host/Editline.h
++++ b/include/lldb/Host/Editline.h
+@@ -43,12 +43,9 @@
+ // will only be
+ // used in cases where this is true.  This is a compile time dependecy, for now
+ // selected per target Platform
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
++// (libedit on NixOS is always wide-char capable)
+ #define LLDB_EDITLINE_USE_WCHAR 1
+ #include <codecvt>
+-#else
+-#define LLDB_EDITLINE_USE_WCHAR 0
+-#endif
+ 
+ #include "lldb/Host/ConnectionFileDescriptor.h"
+ #include "lldb/lldb-private.h"
+-- 
+2.13.0
+
diff --git a/pkgs/development/compilers/llvm/4/lldb.nix b/pkgs/development/compilers/llvm/4/lldb.nix
index 6e6fdf012dd..953755ab6ee 100644
--- a/pkgs/development/compilers/llvm/4/lldb.nix
+++ b/pkgs/development/compilers/llvm/4/lldb.nix
@@ -19,7 +19,8 @@ stdenv.mkDerivation {
 
   src = fetch "lldb" "0g83hbw1r4gd0z8hlph9i34xs6dlcc69vz3h2bqwkhb2qq2qzg9d";
 
-  patchPhase = ''
+  patches = [ ./lldb-libedit.patch ];
+  postPatch = ''
     # Fix up various paths that assume llvm and clang are installed in the same place
     sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \
       cmake/modules/LLDBStandalone.cmake
@@ -35,10 +36,6 @@ stdenv.mkDerivation {
   CXXFLAGS = "-fno-rtti";
   hardeningDisable = [ "format" ];
 
-  cmakeFlags = [
-    "-DLLDB_DISABLE_LIBEDIT=ON"
-  ];
-
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {