forked from mirrors/nixpkgs
Bringing over more patches
This commit is contained in:
parent
838dae4188
commit
3405841706
|
@ -34,19 +34,35 @@ let
|
|||
};
|
||||
# clingSrc = /home/tom/tools/cling;
|
||||
|
||||
preConfigure = ''
|
||||
llvmSrc = fetchgit {
|
||||
url = "http://root.cern/git/llvm.git";
|
||||
rev = "cling-v0.9";
|
||||
sha256 = "sha256-jts7DMnXwZF/pzUfWEQeJmj5XlOb51aXn6KExMbmcXg=";
|
||||
};
|
||||
# llvmSrc = /home/tom/tools/llvm;
|
||||
|
||||
prePatch = ''
|
||||
echo "add_llvm_external_project(cling)" >> tools/CMakeLists.txt
|
||||
|
||||
cp -r $clingSrc ./tools/cling
|
||||
chmod -R a+w ./tools/cling
|
||||
|
||||
mkdir ./interpreter
|
||||
cp -r $llvmSrc ./interpreter/llvm
|
||||
chmod -R a+w ./interpreter/llvm
|
||||
'';
|
||||
|
||||
patches = [
|
||||
# Applied to clang src
|
||||
./no-clang-cpp.patch
|
||||
|
||||
# Applied to cling src
|
||||
./use-patched-llvm.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ python3 git cmake llvmPackages_9.llvm.dev ];
|
||||
buildInputs = [ libffi llvmPackages_9.llvm zlib ncurses ];
|
||||
|
||||
patches = [
|
||||
./no-clang-cpp.patch
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
cmakeFlags = [
|
||||
|
|
34
pkgs/development/interpreters/cling/use-patched-llvm.patch
Normal file
34
pkgs/development/interpreters/cling/use-patched-llvm.patch
Normal file
|
@ -0,0 +1,34 @@
|
|||
diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt
|
||||
index 75396717..6a617ab4 100644
|
||||
--- a/lib/Interpreter/CMakeLists.txt
|
||||
+++ b/lib/Interpreter/CMakeLists.txt
|
||||
@@ -344,3 +344,29 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cling-compiledata.h
|
||||
|
||||
add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/CIFactory.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cling-compiledata.h)
|
||||
+
|
||||
+# If LLVM is external, but Clang is builtin, we must use some files
|
||||
+# from patched (builtin) version of LLVM
|
||||
+if ((NOT builtin_llvm) AND builtin_clang)
|
||||
+ set(FixInclude "${CMAKE_SOURCE_DIR}/interpreter/llvm/src/include")
|
||||
+
|
||||
+ get_property(P SOURCE IncrementalJIT.cpp PROPERTY INCLUDE_DIRECTORIES)
|
||||
+ list(INSERT P 0 ${FixInclude})
|
||||
+ set_property(SOURCE IncrementalJIT.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
|
||||
+
|
||||
+ get_property(P SOURCE IncrementalExecutor.cpp PROPERTY INCLUDE_DIRECTORIES)
|
||||
+ list(INSERT P 0 ${FixInclude})
|
||||
+ set_property(SOURCE IncrementalExecutor.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
|
||||
+
|
||||
+ get_property(P SOURCE Interpreter.cpp PROPERTY INCLUDE_DIRECTORIES)
|
||||
+ list(INSERT P 0 ${FixInclude})
|
||||
+ set_property(SOURCE Interpreter.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
|
||||
+
|
||||
+ get_property(P SOURCE Transaction.cpp PROPERTY INCLUDE_DIRECTORIES)
|
||||
+ list(INSERT P 0 ${FixInclude})
|
||||
+ set_property(SOURCE Transaction.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
|
||||
+
|
||||
+ get_property(P SOURCE TransactionUnloader.cpp PROPERTY INCLUDE_DIRECTORIES)
|
||||
+ list(INSERT P 0 ${FixInclude})
|
||||
+ set_property(SOURCE TransactionUnloader.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
|
||||
+endif()
|
Loading…
Reference in a new issue