diff options
author | Javier Tiá | 2018-06-25 10:53:09 -0600 |
---|---|---|
committer | Javier Tiá | 2018-06-25 10:56:53 -0600 |
commit | d29bcf0b64e0625e4dcb9aa5b05d41fb43b6bb97 (patch) | |
tree | 62017c8a04ee724fbd0cc667bc1cc056a3bf7fd5 | |
parent | 9f89c75e9ded05513234cc3745289b0548796006 (diff) | |
download | aur-d29bcf0b64e0625e4dcb9aa5b05d41fb43b6bb97.tar.gz |
Bump up include-what-you-use 0.10.0
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | PKGBUILD | 48 | ||||
-rw-r--r-- | fix-clang-6.patch | 251 | ||||
-rw-r--r-- | iwyu.install | 25 |
4 files changed, 318 insertions, 30 deletions
@@ -1,22 +1,22 @@ pkgbase = include-what-you-use pkgdesc = A tool for use with clang to analyze #includes in C and C++ source files - pkgver = 0.9 - pkgrel = 2 + pkgver = 0.10 + pkgrel = 1 epoch = 1 url = http://include-what-you-use.org - arch = i686 + install = iwyu.install arch = x86_64 license = LLVM Release License - makedepends = clang>=5.0 - makedepends = clang<6.0 + makedepends = clang>=6.0 + makedepends = clang<7.0 makedepends = cmake - makedepends = llvm>=5.0 - makedepends = llvm<6.0 - depends = clang>=5.0 - depends = clang<6.0 - optdepends = python2 - source = https://github.com/include-what-you-use/include-what-you-use/archive/clang_5.0.tar.gz - sha512sums = 9d4a9717a3a3f6752f8bdd1392b6d7a5e8b8dc277ef46a50f24185a089360380e1da92a61fd150598843f5c24cff03e74bc674e57579960d977acde755e34c52 + makedepends = llvm>=6.0 + makedepends = llvm<7.0 + depends = clang>=6.0 + depends = clang<7.0 + depends = python2 + source = https://github.com/include-what-you-use/include-what-you-use/archive/clang_6.0.tar.gz + sha512sums = 2bf2593dba252d870074125f976a237e901e969323969f2c8fb030e8376bb230f1d5c2baecc8cd8fad7099e83589c7666c44cd178d2094f6e883cace1e53ad90 pkgname = include-what-you-use @@ -2,37 +2,49 @@ pkgname=include-what-you-use epoch=1 -pkgver=0.9 -pkgrel=2 -_clang_major=5 +pkgver=0.10 +pkgrel=1 +_clang_major=6 _clang_minor=0 -_clang_ver="$_clang_major.$_clang_minor" +_clang_ver="${_clang_major}.${_clang_minor}" pkgdesc="A tool for use with clang to analyze #includes in C and C++ source files" url="http://include-what-you-use.org" license=('LLVM Release License') -source=("https://github.com/include-what-you-use/include-what-you-use/archive/clang_${_clang_ver}.tar.gz") -sha512sums=('9d4a9717a3a3f6752f8bdd1392b6d7a5e8b8dc277ef46a50f24185a089360380e1da92a61fd150598843f5c24cff03e74bc674e57579960d977acde755e34c52') -arch=('i686' 'x86_64') +source=("https://github.com/${pkgname}/${pkgname}/archive/clang_${_clang_ver}.tar.gz") +sha512sums=('2bf2593dba252d870074125f976a237e901e969323969f2c8fb030e8376bb230f1d5c2baecc8cd8fad7099e83589c7666c44cd178d2094f6e883cace1e53ad90') +arch=('x86_64') _min="${_clang_ver}" _max=$((_clang_major+1)).0 -depends=("clang>=$_min" "clang<$_max") -makedepends=("clang>=$_min" "clang<$_max" "cmake" "llvm>=$_min" "llvm<$_max") -optdepends=('python2') +depends=("clang>=${_min}" "clang<${_max}" 'python2') +makedepends=("clang>=${_min}" "clang<${_max}" "cmake" "llvm>=${_min}" "llvm<${_max}") +install=iwyu.install + + +prepare() { + cd "${srcdir}/${pkgname}-clang_${_clang_ver}" + patch -Np1 -i "../../fix-clang-6.patch" +} build() { - cd "$srcdir/$pkgname-clang_${_clang_ver}" + cd "${srcdir}/${pkgname}-clang_${_clang_ver}" - rm -rf build && mkdir build && cd build - cmake -DIWYU_LLVM_ROOT_PATH=/usr/lib -DCMAKE_INSTALL_PREFIX:PATH=/usr .. - make + rm -rf build && mkdir build && cd build + cmake -DCMAKE_PREFIX_PATH=/usr/lib -DCMAKE_INSTALL_PREFIX:PATH=/usr .. + make } package() { - cd "$srcdir/$pkgname-clang_${_clang_ver}/build" + cd "${srcdir}/${pkgname}-clang_${_clang_ver}/build" + + make install DESTDIR=${pkgdir} + + install -Dm755 ../fix_includes.py "${pkgdir}/usr/bin/iwyu-fix-includes" + sed -i "s|^#!/usr/bin/python$|#!/usr/bin/python2|" "${pkgdir}/usr/bin/iwyu-fix-includes" + rm -f "${pkgdir}/usr/bin/fix_includes.py" - make install DESTDIR=$pkgdir - install -Dm755 ../fix_includes.py "${pkgdir}/usr/bin/iwyu-fix_includes.py" - sed -i "s|^#!/usr/bin/python$|#!/usr/bin/python2|" "${pkgdir}/usr/bin/iwyu-fix_includes.py" + install -Dm755 ../iwyu_tool.py "${pkgdir}/usr/bin/iwyu-tool" + sed -i "s|^#!/usr/bin/python$|#!/usr/bin/python2|" "${pkgdir}/usr/bin/iwyu-tool" + rm -f "${pkgdir}/usr/bin/iwyu_tool.py" } # vim:set ts=2 sw=2 et: diff --git a/fix-clang-6.patch b/fix-clang-6.patch new file mode 100644 index 000000000000..eac868145cac --- /dev/null +++ b/fix-clang-6.patch @@ -0,0 +1,251 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 67c4abb..ade19e8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,89 +1,34 @@ + cmake_minimum_required(VERSION 3.4.3) + +-if( POLICY CMP0048 ) ++if (POLICY CMP0048) + # Silence CMP0048 warning about missing project VERSION. + cmake_policy(SET CMP0048 NEW) + endif() + + project(include-what-you-use) + +-if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) +- message(STATUS "IWYU out-of-tree configuration") +- +- if( DEFINED LLVM_PATH ) +- set(IWYU_LLVM_ROOT_PATH ${LLVM_PATH}) +- message(WARNING "LLVM_PATH is deprecated, use IWYU_LLVM_ROOT_PATH instead.") +- endif() +- +- if( DEFINED IWYU_LLVM_INCLUDE_PATH AND DEFINED IWYU_LLVM_LIB_PATH ) +- # User provided include/lib paths, fall through +- elseif ( DEFINED IWYU_LLVM_ROOT_PATH ) +- # Synthesize include/lib relative to a root. +- set(IWYU_LLVM_INCLUDE_PATH ${IWYU_LLVM_ROOT_PATH}/include) +- set(IWYU_LLVM_LIB_PATH ${IWYU_LLVM_ROOT_PATH}/lib) +- else() +- # If none provided, fail. +- message(FATAL_ERROR +- "Don't know how to find LLVM headers/libraries. " +- "Use -DIWYU_LLVM_ROOT_PATH=/xyz or both " +- "-DIWYU_LLVM_INCLUDE_PATH=/xyz/include and -DIWYU_LLVM_LIB_PATH=/xyz/lib") +- endif() +- +- include_directories(${IWYU_LLVM_INCLUDE_PATH}) +- link_directories(${IWYU_LLVM_LIB_PATH}) ++if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) ++ message(STATUS "IWYU: out-of-tree configuration") + +- add_definitions( +- -D__STDC_LIMIT_MACROS +- -D__STDC_CONSTANT_MACROS +- ) +- +- if( MSVC ) +- # Adjust MSVC warning levels. +- add_definitions( +- # Ignore security warnings for standard functions. +- -D_CRT_SECURE_NO_WARNINGS +- -D_SCL_SECURE_NO_WARNINGS +- +- # Disabled warnings. +- -wd4141 # Suppress ''modifier' : used more than once' (because of __forceinline combined with inline) +- -wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned' +- -wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data' +- -wd4267 # Suppress ''var' : conversion from 'size_t' to 'type', possible loss of data' +- -wd4291 # Suppress ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception' +- -wd4345 # Suppress 'behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized' +- -wd4355 # Suppress ''this' : used in base member initializer list' +- -wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destructor is inaccessible' +- -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)' +- +- # Promoted warnings. +- -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning. +- +- # Promoted warnings to errors. +- -we4238 # Promote 'nonstandard extension used : class rvalue used as lvalue' to error. +- ) +- endif() ++ find_package(LLVM CONFIG REQUIRED) ++ find_package(Clang CONFIG REQUIRED) + +- if( APPLE ) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") +- endif() ++ list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR}) ++ include(AddLLVM) ++ include(HandleLLVMOptions) + else() +- message(STATUS "IWYU in-tree configuration") ++ message(STATUS "IWYU: in-tree configuration") + endif() + +-# Pick up Git revision so we can report it in version information. +-include(FindGit) +-if( GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git" ) +- execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- OUTPUT_VARIABLE IWYU_GIT_REV +- OUTPUT_STRIP_TRAILING_WHITESPACE) +-else() +- message(STATUS "Warning: IWYU Git version info not found, DO NOT release " +- "from this build tree!") +-endif() +-add_definitions(-DIWYU_GIT_REV="${IWYU_GIT_REV}") ++message(STATUS "IWYU: configuring for LLVM ${LLVM_VERSION}...") ++ ++add_definitions(${LLVM_DEFINITIONS}) ++include_directories( ++ ${LLVM_INCLUDE_DIRS} ++ ${CLANG_INCLUDE_DIRS} ++ ) + +-add_executable(include-what-you-use ++add_llvm_executable(include-what-you-use + iwyu.cc + iwyu_ast_util.cc + iwyu_cache.cc +@@ -97,19 +42,19 @@ add_executable(include-what-you-use + iwyu_path_util.cc + iwyu_preprocessor.cc + iwyu_verrs.cc +-) ++ ) + +-if( MINGW ) ++if (MINGW) + # Work around 'too many sections' error with MINGW/GCC + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj") + endif() + +-if( MSVC ) ++if (MSVC) + # Disable warnings for IWYU, and disable exceptions in MSVC's STL. + add_definitions( + -wd4722 # Suppress ''destructor'' : destructor never returns, potential memory leak + -D_HAS_EXCEPTIONS=0 +- ) ++ ) + + # Enable bigobj support and sane C++ exception semantics. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /EHsc") +@@ -117,82 +62,54 @@ if( MSVC ) + # Put project in solution folder + set_target_properties(include-what-you-use + PROPERTIES FOLDER "Clang executables" +- ) ++ ) ++endif() ++ ++# Prefer dynamic library if it exists. ++if (TARGET LLVM) ++ message(STATUS "IWYU: Linking LLVM dynamically") ++ set(IWYU_LLVM_LIBS LLVM) + else() +- # Disable RTTI, use C++11 to be compatible with LLVM/Clang libraries. +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -std=c++11") ++ message(STATUS "IWYU: Linking LLVM statically") ++ set(IWYU_LLVM_LIBS ++ LLVMSupport ++ LLVMX86AsmParser ++ ) + endif() + +-# Clang dependencies. + target_link_libraries(include-what-you-use + PRIVATE +- clangFrontend +- clangSerialization +- clangDriver +- clangParse +- clangSema +- clangAnalysis +- clangAST + clangBasic +- clangEdit + clangLex +-) +- +-# LLVM dependencies. +-target_link_libraries(include-what-you-use +- PRIVATE +- LLVMX86AsmParser # MC, MCParser, Support, X86CodeGen, X86Desc, X86Info +- LLVMX86CodeGen # Analysis, AsmPrinter, CodeGen, Core, MC, Support, Target, +- # X86AsmPrinter, X86Desc, X86Info, X86Utils +- LLVMX86Desc # MC, MCDisassembler, Object, Support, X86AsmPrinter, X86Info +- LLVMX86AsmPrinter # MC, Support, X86Utils +- LLVMX86Info # Support +- LLVMX86Utils # Core, Support +- LLVMCodeGen # Analysis, Core, MC, Scalar, Support, Target, TransformUtils +- LLVMipo +- LLVMScalarOpts +- LLVMInstCombine +- LLVMTransformUtils +- LLVMTarget # Analysis, MC, Core, Support +- LLVMAnalysis # Core, Support +- LLVMOption # Support +- LLVMMCDisassembler # MC, Support +- LLVMMCParser # MC, Support +- LLVMMC # Object, Support +- LLVMProfileData # Core, Support, Object +- LLVMObject # BitReader, Core, Support +- LLVMBitReader # Core, Support +- LLVMCore # BinaryFormat, Support +- LLVMBinaryFormat # Support +- LLVMSupport # Demangle +- LLVMDemangle +-) ++ clangAST ++ clangSema ++ clangFrontend ++ clangDriver ++ ${IWYU_LLVM_LIBS} ++ ) + + # Platform dependencies. +-if( WIN32 ) ++if (WIN32) + target_link_libraries(include-what-you-use + PRIVATE +- shlwapi +- version # For clangDriver's MSVCToolchain +- ) +-elseif( UNIX ) +- include(FindCurses) +- include(FindBacktrace) ++ shlwapi # For PathMatchSpecA ++ ) ++endif() + +- target_link_libraries(include-what-you-use +- PRIVATE +- pthread +- z +- ${Backtrace_LIBRARIES} +- ${CURSES_LIBRARIES} +- ${CMAKE_DL_LIBS} +- ) ++# Pick up Git revision so we can report it in version information. ++include(FindGit) ++if (GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") ++ execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD ++ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++ OUTPUT_VARIABLE IWYU_GIT_REV ++ OUTPUT_STRIP_TRAILING_WHITESPACE) + else() +- message(WARNING +- "Unknown system: ${CMAKE_SYSTEM_NAME}. " +- "No platform link-dependencies added.") ++ message(STATUS "Warning: IWYU Git version info not found, DO NOT release " ++ "from this build tree!") + endif() ++add_definitions(-DIWYU_GIT_REV="${IWYU_GIT_REV}") + ++# Install programs + install(TARGETS include-what-you-use RUNTIME DESTINATION bin) + install(PROGRAMS fix_includes.py iwyu_tool.py DESTINATION bin) + diff --git a/iwyu.install b/iwyu.install new file mode 100644 index 000000000000..65f105a3c21a --- /dev/null +++ b/iwyu.install @@ -0,0 +1,25 @@ +msg() { + echo -e "\x1b[94m::\x1b[0m $1" +} + +show-msg() { +echo +msg "To avoid conflict with another packages these files were renamed:" + + cat << EOF + + fix_includes.py -> iwyu-fix-includes + iwyu_tool.py -> iwyu-tool + +EOF +} + +post_install() { + show-msg +} + +post_upgrade() { + show-msg +} + +# vim:set ts=2 sw=2 ft=sh et: |