Index: head/devel/Makefile =================================================================== --- head/devel/Makefile +++ head/devel/Makefile @@ -1617,6 +1617,7 @@ SUBDIR += lion SUBDIR += listserialc SUBDIR += liteide + SUBDIR += llbuild SUBDIR += lldb38 SUBDIR += llnextgen SUBDIR += llvm-cheri Index: head/devel/llbuild/Makefile =================================================================== --- head/devel/llbuild/Makefile +++ head/devel/llbuild/Makefile @@ -0,0 +1,35 @@ +# $FreeBSD$ + +PORTNAME= llbuild +DISTVERSIONPREFIX= swift-DEVELOPMENT- +DISTVERSION= SNAPSHOT-2016-11-01 +DISTVERSIONSUFFIX= -a +CATEGORIES= devel + +MAINTAINER= jonathan@FreeBSD.org +COMMENT= Low-level build system, used by the Swift Package Manager + +LICENSE= APACHE20 BSD3CLAUSE NCSA +LICENSE_COMB= multi +LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE.txt + +BUILD_DEPENDS= llvm-lit-devel:devel/llvm-devel +LIB_DEPENDS= libsqlite3.so:databases/sqlite3 + +USES= cmake:outsource + +USE_GITHUB= yes +GH_ACCOUNT= apple +GH_PROJECT= swift-llbuild + +USE_LDCONFIG= yes + +OPTIONS_DEFINE= DOCS + +PORTDOCS= CONTRIBUTING.md README.md + +post-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR} + +.include Index: head/devel/llbuild/distinfo =================================================================== --- head/devel/llbuild/distinfo +++ head/devel/llbuild/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1478217141 +SHA256 (apple-swift-llbuild-swift-DEVELOPMENT-SNAPSHOT-2016-11-01-a_GH0.tar.gz) = 567ae284e388ba399bbe3a0fa129edd06d803b6ab90c3a1ace4549d686f4a9b2 +SIZE (apple-swift-llbuild-swift-DEVELOPMENT-SNAPSHOT-2016-11-01-a_GH0.tar.gz) = 4718056 Index: head/devel/llbuild/files/patch-CMakeLists.txt =================================================================== --- head/devel/llbuild/files/patch-CMakeLists.txt +++ head/devel/llbuild/files/patch-CMakeLists.txt @@ -0,0 +1,27 @@ +--- CMakeLists.txt.orig 2016-10-20 04:49:37 UTC ++++ CMakeLists.txt +@@ -112,6 +112,13 @@ endif() + include_directories(BEFORE + ${CMAKE_SOURCE_DIR}/include) + ++# On FreeBSD, /usr/local/* is not used by default. In order to build LLVM ++# with sqlite3, etc., we must add /usr/local paths. ++if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") ++ include_directories("/usr/local/include") ++ link_directories("/usr/local/lib") ++endif(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") ++ + # Xcode: Use libc++ and c++14 using proper build settings. + if (XCODE) + # Force usage of Clang. +@@ -170,8 +177,8 @@ else () + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor") + endif () + +-# On Linux, always build with PIC. +-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ++# On BSD and Linux, always build with PIC. ++if(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + endif () Index: head/devel/llbuild/files/patch-cmake_modules_FindFileCheck.cmake =================================================================== --- head/devel/llbuild/files/patch-cmake_modules_FindFileCheck.cmake +++ head/devel/llbuild/files/patch-cmake_modules_FindFileCheck.cmake @@ -0,0 +1,17 @@ +--- cmake/modules/FindFileCheck.cmake.orig 2016-11-04 00:07:45 UTC ++++ cmake/modules/FindFileCheck.cmake +@@ -5,12 +5,12 @@ + # FILECHECK_EXECUTABLE + + find_program(FILECHECK_EXECUTABLE +- NAMES FileCheck ++ NAMES FileCheck FileCheck39 + DOC "Path to 'FileCheck' executable") + + # Handle REQUIRED and QUIET arguments, this will also set FILECHECK_FOUND to true + # if FILECHECK_EXECUTABLE exists. + include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(FileCheck ++find_package_handle_standard_args(FileCheck39 + "Failed to locate 'FileCheck' executable" + FILECHECK_EXECUTABLE) Index: head/devel/llbuild/files/patch-cmake_modules_FindLit.cmake =================================================================== --- head/devel/llbuild/files/patch-cmake_modules_FindLit.cmake +++ head/devel/llbuild/files/patch-cmake_modules_FindLit.cmake @@ -0,0 +1,11 @@ +--- cmake/modules/FindLit.cmake.orig 2016-10-20 04:49:37 UTC ++++ cmake/modules/FindLit.cmake +@@ -5,7 +5,7 @@ + # LIT_EXECUTABLE + + find_program(LIT_EXECUTABLE +- NAMES lit ++ NAMES lit llvm-lit llvm-lit-devel + DOC "Path to 'lit' executable") + + # Handle REQUIRED and QUIET arguments, this will also set LIT_FOUND to true Index: head/devel/llbuild/files/patch-lib_Basic_CMakeLists.txt =================================================================== --- head/devel/llbuild/files/patch-lib_Basic_CMakeLists.txt +++ head/devel/llbuild/files/patch-lib_Basic_CMakeLists.txt @@ -0,0 +1,10 @@ +--- lib/Basic/CMakeLists.txt.orig 2016-10-20 04:49:37 UTC ++++ lib/Basic/CMakeLists.txt +@@ -7,6 +7,6 @@ add_llbuild_library(llbuildBasic + ShellUtility.cpp + ) + +-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ++if(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux") + target_link_libraries(llbuildBasic pthread) + endif() Index: head/devel/llbuild/files/patch-lib_Ninja_CMakeLists.txt =================================================================== --- head/devel/llbuild/files/patch-lib_Ninja_CMakeLists.txt +++ head/devel/llbuild/files/patch-lib_Ninja_CMakeLists.txt @@ -0,0 +1,8 @@ +--- lib/Ninja/CMakeLists.txt.orig 2016-10-20 04:49:37 UTC ++++ lib/Ninja/CMakeLists.txt +@@ -4,3 +4,5 @@ add_llbuild_library(llbuildNinja + ManifestLoader.cpp + Parser.cpp + ) ++ ++target_link_libraries(llbuildNinja llvmSupport curses) Index: head/devel/llbuild/files/patch-lib_llvm_Support_CMakeLists.txt =================================================================== --- head/devel/llbuild/files/patch-lib_llvm_Support_CMakeLists.txt +++ head/devel/llbuild/files/patch-lib_llvm_Support_CMakeLists.txt @@ -0,0 +1,13 @@ +--- lib/llvm/Support/CMakeLists.txt.orig 2016-10-20 04:49:37 UTC ++++ lib/llvm/Support/CMakeLists.txt +@@ -38,6 +38,10 @@ circular_raw_ostream.cpp + raw_ostream.cpp + ) + ++if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") ++ target_link_libraries(llvmSupport execinfo pthread) ++endif() ++ + if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + target_link_libraries(llvmSupport pthread dl) + endif() Index: head/devel/llbuild/files/patch-lib_llvm_Support_Unix_Process.inc =================================================================== --- head/devel/llbuild/files/patch-lib_llvm_Support_Unix_Process.inc +++ head/devel/llbuild/files/patch-lib_llvm_Support_Unix_Process.inc @@ -0,0 +1,15 @@ +--- lib/llvm/Support/Unix/Process.inc.orig 2016-10-20 04:49:37 UTC ++++ lib/llvm/Support/Unix/Process.inc +@@ -33,10 +33,10 @@ + #if HAVE_SIGNAL_H + #include + #endif +-// DragonFlyBSD, OpenBSD, and Bitrig have deprecated for ++// DragonFlyBSD, FreeBSD, OpenBSD, and Bitrig have deprecated for + // instead. Unix.h includes this for us already. + #if defined(HAVE_MALLOC_H) && !defined(__DragonFly__) && \ +- !defined(__OpenBSD__) && !defined(__Bitrig__) ++ !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__Bitrig__) + #include + #endif + #if defined(HAVE_MALLCTL) Index: head/devel/llbuild/files/patch-products_llbuild_CMakeLists.txt =================================================================== --- head/devel/llbuild/files/patch-products_llbuild_CMakeLists.txt +++ head/devel/llbuild/files/patch-products_llbuild_CMakeLists.txt @@ -0,0 +1,17 @@ +--- products/llbuild/CMakeLists.txt.orig 2016-10-20 04:49:37 UTC ++++ products/llbuild/CMakeLists.txt +@@ -11,3 +11,14 @@ target_link_libraries(llbuild + sqlite3 + curses + ) ++ ++install(TARGETS llbuild ++ COMPONENT llbuild ++ DESTINATION bin) ++ ++add_custom_target(install-llbuild ++ DEPENDS llbuild ++ COMMENT "Installing llbuild..." ++ COMMAND "${CMAKE_COMMAND}" ++ -DCMAKE_INSTALL_COMPONENT=llbuild ++ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") Index: head/devel/llbuild/pkg-descr =================================================================== --- head/devel/llbuild/pkg-descr +++ head/devel/llbuild/pkg-descr @@ -0,0 +1,9 @@ +llbuild is a set of libraries for building build systems. Unlike most build +system projects which focus on the syntax for describing the build, llbuild +is designed around a reusable, flexible, and scalable general purpose build +engine capable of solving many "build system"-like problems. The project +also includes additional libraries on top of that engine which provide +support for constructing bespoke build systems (like swift build) or for +building from Ninja manifests. + +WWW: https://github.com/apple/swift-llbuild Index: head/devel/llbuild/pkg-plist =================================================================== --- head/devel/llbuild/pkg-plist +++ head/devel/llbuild/pkg-plist @@ -0,0 +1,7 @@ +bin/llbuild +bin/swift-build-tool +include/llbuild/buildsystem.h +include/llbuild/core.h +include/llbuild/llbuild.h +include/llbuild/module.modulemap +lib/libllbuild.so