uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
74
pkgs/os-specific/darwin/libtapi/default.nix
Normal file
74
pkgs/os-specific/darwin/libtapi/default.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{ lib, stdenv, fetchFromGitHub, pkgsBuildBuild, cmake, python3, ncurses }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libtapi";
|
||||
version = "1100.0.11"; # determined by looking at VERSION.txt
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tpoechtrager";
|
||||
repo = "apple-libtapi";
|
||||
rev = "664b8414f89612f2dfd35a9b679c345aa5389026";
|
||||
sha256 = "1y1yl46msabfy14z0rln333a06087bk14f5h7q1cdawn8nmvbdbr";
|
||||
};
|
||||
|
||||
sourceRoot = "source/src/llvm";
|
||||
|
||||
# Backported from newer llvm, fixes configure error when cross compiling.
|
||||
# Also means we don't have to manually fix the result with install_name_tool.
|
||||
patches = [
|
||||
./disable-rpath.patch
|
||||
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
# TODO: make unconditional and rebuild the world
|
||||
# TODO: send upstream
|
||||
./native-clang-tblgen.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake python3 ];
|
||||
|
||||
# ncurses is required here to avoid a reference to bootstrap-tools, which is
|
||||
# not allowed for the stdenv.
|
||||
buildInputs = [ ncurses ];
|
||||
|
||||
cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=OFF" ]
|
||||
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) [
|
||||
"-DCMAKE_CROSSCOMPILING=True"
|
||||
# This package could probably have a llvm_6 llvm-tblgen and clang-tblgen
|
||||
# provided to reduce some building. This package seems intended to
|
||||
# include all of its dependencies, including enough of LLVM to build the
|
||||
# required tablegens.
|
||||
(
|
||||
let
|
||||
nativeCC = pkgsBuildBuild.stdenv.cc;
|
||||
nativeBintools = nativeCC.bintools.bintools;
|
||||
nativeToolchainFlags = [
|
||||
"-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc"
|
||||
"-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++"
|
||||
"-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar"
|
||||
"-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip"
|
||||
"-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib"
|
||||
];
|
||||
in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}"
|
||||
)
|
||||
];
|
||||
|
||||
# fixes: fatal error: 'clang/Basic/Diagnostic.h' file not found
|
||||
# adapted from upstream
|
||||
# https://github.com/tpoechtrager/apple-libtapi/blob/3cb307764cc5f1856c8a23bbdf3eb49dfc6bea48/build.sh#L58-L60
|
||||
preConfigure = ''
|
||||
INCLUDE_FIX="-I $PWD/projects/clang/include"
|
||||
INCLUDE_FIX+=" -I $PWD/build/projects/clang/include"
|
||||
|
||||
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="$INCLUDE_FIX")
|
||||
'';
|
||||
|
||||
buildFlags = [ "clangBasic" "libtapi" "tapi" ];
|
||||
|
||||
installTargets = [ "install-libtapi" "install-tapi-headers" "install-tapi" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Replaces the Mach-O Dynamic Library Stub files in Apple's SDKs to reduce the size";
|
||||
homepage = "https://github.com/tpoechtrager/apple-libtapi";
|
||||
license = licenses.apsl20;
|
||||
maintainers = with maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
14
pkgs/os-specific/darwin/libtapi/disable-rpath.patch
Normal file
14
pkgs/os-specific/darwin/libtapi/disable-rpath.patch
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
diff --git a/src/llvm/cmake/modules/AddLLVM.cmake b/src/llvm/cmake/modules/AddLLVM.cmake
|
||||
index a53016eb0..b65e608a4 100644
|
||||
--- a/cmake/modules/AddLLVM.cmake
|
||||
+++ b/cmake/modules/AddLLVM.cmake
|
||||
@@ -1683,8 +1683,7 @@ function(llvm_setup_rpath name)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
- set(_install_name_dir INSTALL_NAME_DIR "@rpath")
|
||||
- set(_install_rpath "@loader_path/../lib" ${extra_libdir})
|
||||
+ set(_install_name_dir)
|
||||
elseif(UNIX)
|
||||
set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
|
||||
21
pkgs/os-specific/darwin/libtapi/native-clang-tblgen.patch
Normal file
21
pkgs/os-specific/darwin/libtapi/native-clang-tblgen.patch
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
diffprojects/libtapi/CMakeLists.txt b/src/llvm/projects/libtapi/CMakeLists.txt
|
||||
index 8ee6d8138..8277be147 100644
|
||||
--- a/projects/libtapi/CMakeLists.txt
|
||||
+++ b/projects/libtapi/CMakeLists.txt
|
||||
@@ -193,7 +193,15 @@ if (NOT DEFINED CLANG_VERSION)
|
||||
set(CLANG_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
|
||||
endif ()
|
||||
if (NOT DEFINED CLANG_TABLEGEN_EXE)
|
||||
- set(CLANG_TABLEGEN_EXE "${LLVM_TOOLS_BINARY_DIR}/clang-tblgen")
|
||||
+ if(LLVM_USE_HOST_TOOLS)
|
||||
+ if (NOT CMAKE_CONFIGURATION_TYPES)
|
||||
+ set(CLANG_TABLEGEN_EXE "${LLVM_NATIVE_BUILD}/bin/clang-tblgen")
|
||||
+ else()
|
||||
+ set(CLANG_TABLEGEN_EXE "${LLVM_NATIVE_BUILD}/Release/bin/clang-tblgen")
|
||||
+ endif()
|
||||
+ else()
|
||||
+ set(CLANG_TABLEGEN_EXE "${LLVM_TOOLS_BINARY_DIR}/clang-tblgen")
|
||||
+ endif ()
|
||||
endif ()
|
||||
|
||||
# Include must go first.
|
||||
Loading…
Add table
Add a link
Reference in a new issue