Merge PR #2072 'Add custom target for pinning busted dependencies'

This commit is contained in:
Thiago de Arruda 2015-02-28 10:43:52 -03:00
commit c6482eb598
4 changed files with 97 additions and 3 deletions

View File

@ -195,6 +195,10 @@ set(LIBTERMKEY_USE_STATIC ON)
find_package(LibTermkey REQUIRED)
include_directories(SYSTEM ${LIBTERMEY_INCLUDE_DIRS})
set(LIBVTERM_USE_STATIC ON)
find_package(LibVterm REQUIRED)
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
find_package(LibIntl)
if(LibIntl_FOUND)
include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS})

48
cmake/FindLibVterm.cmake Normal file
View File

@ -0,0 +1,48 @@
# - Try to find libvterm
# Once done this will define
# LIBVTERM_FOUND - System has libvterm
# LIBVTERM_INCLUDE_DIRS - The libvterm include directories
# LIBVTERM_LIBRARIES - The libraries needed to use libvterm
find_package(PkgConfig)
if(NOT LIBVTERM_USE_BUNDLED)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBVTERM QUIET vterm)
endif()
else()
set(PC_LIBVTERM_INCLUDEDIR)
set(PC_LIBVTERM_INCLUDE_DIRS)
set(PC_LIBVTERM_LIBDIR)
set(PC_LIBVTERM_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
endif()
set(LIBVTERM_DEFINITIONS ${PC_LIBVTERM_CFLAGS_OTHER})
find_path(LIBVTERM_INCLUDE_DIR vterm.h
PATHS ${PC_LIBVTERM_INCLUDEDIR} ${PC_LIBVTERM_INCLUDE_DIRS}
${LIMIT_SEARCH})
# If we're asked to use static linkage, add libuv.a as a preferred library name.
if(LIBVTERM_USE_STATIC)
list(APPEND LIBVTERM_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}vterm${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
list(APPEND LIBVTERM_NAMES vterm)
find_library(LIBVTERM_LIBRARY NAMES ${LIBVTERM_NAMES}
HINTS ${PC_LIBVTERM_LIBDIR} ${PC_LIBVTERM_LIBRARY_DIRS}
${LIMIT_SEARCH})
set(LIBVTERM_LIBRARIES ${LIBVTERM_LIBRARY})
set(LIBVTERM_INCLUDE_DIRS ${LIBVTERM_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBVTERM_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LibVterm DEFAULT_MSG
LIBVTERM_LIBRARY LIBVTERM_INCLUDE_DIR)
mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY)

View File

@ -171,7 +171,7 @@ list(APPEND NVIM_LINK_LIBRARIES
${LIBUV_LIBRARIES}
${MSGPACK_LIBRARIES}
${LUAJIT_LIBRARIES}
${LIBTICKIT_LIBRARIES}
${LIBVTERM_LIBRARIES}
${LIBTERMKEY_LIBRARIES}
${LIBUNIBILIUM_LIBRARIES}
m

View File

@ -12,6 +12,7 @@ option(USE_BUNDLED "Use bundled dependencies." ON)
option(USE_BUNDLED_LIBUNIBILIUM "Use the bundled libunibilium." ${USE_BUNDLED})
option(USE_BUNDLED_LIBTERMKEY "Use the bundled libtermkey." ${USE_BUNDLED})
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
@ -66,6 +67,10 @@ set(LIBUNIBILIUM_SHA1 32c07797f298e5bc722ce14b6b9a2cae68e3c018)
set(LIBTERMKEY_URL https://github.com/neovim/libtermkey/archive/8c0cb7108cc63218ea19aa898968eede19e19603.tar.gz)
set(LIBTERMKEY_SHA1 54e8b6914dab10d4467d2a563f80053a99849fcb)
set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/ec80d6cc2f331263b76ec40acb4e6b2184a969d9.tar.gz)
set(LIBVTERM_SHA1 4e3cf232977bb829baa1746c20e846dd054981c0)
if(USE_BUNDLED_LIBUNIBILIUM)
ExternalProject_Add(libunibilium
PREFIX ${DEPS_BUILD_DIR}
@ -111,6 +116,29 @@ if(USE_BUNDLED_LIBTERMKEY)
add_dependencies(libtermkey libunibilium)
endif()
if(USE_BUNDLED_LIBVTERM)
ExternalProject_Add(libvterm
PREFIX ${DEPS_BUILD_DIR}
URL ${LIBVTERM_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libvterm
-DURL=${LIBVTERM_URL}
-DEXPECTED_SHA1=${LIBVTERM_SHA1}
-DTARGET=libvterm
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND ""
INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS=-fPIC
install)
list(APPEND THIRD_PARTY_DEPS libvterm)
endif()
if(USE_BUNDLED_LIBUV)
ExternalProject_Add(libuv
PREFIX ${DEPS_BUILD_DIR}
@ -211,10 +239,24 @@ if(USE_BUNDLED_LUAROCKS)
add_dependencies(luarocks luajit)
endif()
add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps
COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install lua_cliargs 2.3-3
COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install luafilesystem 1.5.0
COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install dkjson 2.5-1
COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install say 1.2-1
COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install luassert 1.7.2-0
COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install ansicolors 1.0.2-3
COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install penlight 1.0.0-1
COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install mediator_lua 1.1-3
COMMAND touch ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps
DEPENDS luarocks)
add_custom_target(stable-busted-deps
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps)
add_custom_command(OUTPUT ${DEPS_BIN_DIR}/busted
COMMAND ${DEPS_BIN_DIR}/luarocks
ARGS build busted 2.0.rc4 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
DEPENDS luarocks)
DEPENDS stable-busted-deps)
add_custom_target(busted
DEPENDS ${DEPS_BIN_DIR}/busted)
@ -244,7 +286,7 @@ if(USE_BUNDLED_LUAROCKS)
add_custom_target(nvim-client
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client)
list(APPEND THIRD_PARTY_DEPS busted lua-messagepack lpeg nvim-client)
list(APPEND THIRD_PARTY_DEPS stable-busted-deps busted lua-messagepack lpeg nvim-client)
endif()
add_custom_target(third-party ALL