diff options
| author | Matwey V. Kornilov <matwey.kornilov@gmail.com> | 2019-12-30 14:04:32 +0300 |
|---|---|---|
| committer | Nicole Mazzuca <mazzucan@outlook.com> | 2020-01-15 12:37:04 -0800 |
| commit | d989ad416b923a9f895c4bddc446d1ef370a3af8 (patch) | |
| tree | 6f29520e75f91fb6228194a9975c42f4bdd74747 | |
| parent | ed76c7eef2573e785eaf46bb019ac5a08a02e55f (diff) | |
| download | vcpkg-d989ad416b923a9f895c4bddc446d1ef370a3af8.tar.gz vcpkg-d989ad416b923a9f895c4bddc446d1ef370a3af8.zip | |
[gperf] Initial implementation (#9505)
| -rw-r--r-- | ports/gperf/CMakeLists.txt | 53 | ||||
| -rw-r--r-- | ports/gperf/CONTROL | 4 | ||||
| -rw-r--r-- | ports/gperf/config.h.in | 1 | ||||
| -rw-r--r-- | ports/gperf/portfile.cmake | 30 | ||||
| -rw-r--r-- | scripts/ci.baseline.txt | 2 |
5 files changed, 90 insertions, 0 deletions
diff --git a/ports/gperf/CMakeLists.txt b/ports/gperf/CMakeLists.txt new file mode 100644 index 000000000..d9cad0d89 --- /dev/null +++ b/ports/gperf/CMakeLists.txt @@ -0,0 +1,53 @@ +cmake_minimum_required(VERSION 3.0) +project(gperf LANGUAGES C CXX) + +include(CheckCXXSourceCompiles) +include(GNUInstallDirs) + +CHECK_CXX_SOURCE_COMPILES("int main(int n) { int dynamic_array[n]; }" HAVE_DYNAMIC_ARRAY) + +set(LIBGP_SOURCES + lib/getline.cc + lib/getline.h + lib/getopt.c + lib/getopt.h + lib/getopt1.c + lib/hash.cc + lib/hash.h) +add_library(gp STATIC ${LIBGP_SOURCES}) +target_include_directories(gp PUBLIC "${CMAKE_SOURCE_DIR}/lib") + +set(GPERF_SOURCES + src/bool-array.cc + src/bool-array.h + src/bool-array.icc + src/hash-table.cc + src/hash-table.h + src/input.cc + src/input.h + src/keyword-list.cc + src/keyword-list.h + src/keyword-list.icc + src/keyword.cc + src/keyword.h + src/keyword.icc + src/main.cc + src/options.cc + src/options.h + src/options.icc + src/output.cc + src/output.h + src/positions.cc + src/positions.h + src/positions.icc + src/search.cc + src/search.h + src/version.cc + src/version.h) +add_executable(gperf ${GPERF_SOURCES}) +target_link_libraries(gperf gp) +target_include_directories(gperf PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") + +configure_file(config.h.in config.h @ONLY) + +install(TARGETS gperf RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/ports/gperf/CONTROL b/ports/gperf/CONTROL new file mode 100644 index 000000000..34d19df80 --- /dev/null +++ b/ports/gperf/CONTROL @@ -0,0 +1,4 @@ +Source: gperf +Version: 3.1-1 +Description: GNU perfect hash function generator +Homepage: https://www.gnu.org/software/gperf/ diff --git a/ports/gperf/config.h.in b/ports/gperf/config.h.in new file mode 100644 index 000000000..f1f643d7b --- /dev/null +++ b/ports/gperf/config.h.in @@ -0,0 +1 @@ +#cmakedefine HAVE_DYNAMIC_ARRAY @HAVE_DYNAMIC_ARRAY@ diff --git a/ports/gperf/portfile.cmake b/ports/gperf/portfile.cmake new file mode 100644 index 000000000..8531426fc --- /dev/null +++ b/ports/gperf/portfile.cmake @@ -0,0 +1,30 @@ +vcpkg_fail_port_install(ON_TARGET "UWP") + +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) + +vcpkg_download_distfile(ARCHIVE + URLS http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz + FILENAME gperf-3.1.tar.gz + SHA512 855ebce5ff36753238a44f14c95be7afdc3990b085960345ca2caf1a2db884f7db74d406ce9eec2f4a52abb8a063d4ed000a36b317c9a353ef4e25e2cca9a3f4 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_RELEASE -DCMAKE_INSTALL_BINDIR=tools +) + +vcpkg_install_cmake() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index bc83397a0..2067b2983 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -554,6 +554,8 @@ googleapis:x64-uwp=fail google-cloud-cpp:x64-linux=ignore
google-cloud-cpp-spanner:x86-windows=fail
gppanel:x64-osx=fail
+gperf:x64-uwp=fail
+gperf:arm-uwp=fail
graphicsmagick:arm64-windows=fail
graphicsmagick:arm-uwp=fail
graphicsmagick:x64-uwp=fail
|
