mirror of https://github.com/microsoft/vcpkg.git
[gperf] Update to 3.3, upstream build system (#46706)
Co-authored-by: Andrew Tribick <ajtribick@googlemail.com>
This commit is contained in:
parent
c9c17dcea3
commit
53dfeeade5
|
|
@ -1,53 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
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})
|
||||
|
|
@ -1 +0,0 @@
|
|||
#cmakedefine HAVE_DYNAMIC_ARRAY @HAVE_DYNAMIC_ARRAY@
|
||||
|
|
@ -1,30 +1,26 @@
|
|||
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
|
||||
set(VCPKG_BUILD_TYPE release) # tool only
|
||||
|
||||
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
|
||||
URLS
|
||||
"https://ftpmirror.gnu.org/gnu/gperf/gperf-${VERSION}.tar.gz"
|
||||
"https://ftp.gnu.org/pub/gnu/gperf/gperf-${VERSION}.tar.gz"
|
||||
FILENAME gperf-${VERSION}.tar.gz
|
||||
SHA512 246b75b8ce7d77d6a8725cd15f1cf2e68da404812573af1d5bf32dbe6ad4228f48757baefc77bcb1f5597c2397043c04d31d8a04ab507bfa7a80f85e1ab6045f
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
PATCHES
|
||||
remove_register_keyword_cpp17.patch
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS_RELEASE -DCMAKE_INSTALL_BINDIR=tools/gperf
|
||||
vcpkg_make_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTORECONF
|
||||
OPTIONS_RELEASE
|
||||
"--bindir=\\\${prefix}/tools/${PORT}" # legacy from vendored CMake build
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_make_install()
|
||||
|
||||
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()
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/lib/getline.cc b/lib/getline.cc
|
||||
index c57c633..0984a7c 100644
|
||||
--- a/lib/getline.cc
|
||||
+++ b/lib/getline.cc
|
||||
@@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
- register int c = getc (stream);
|
||||
+ int c = getc (stream);
|
||||
|
||||
/* We always want at least one char left in the buffer, since we
|
||||
always (unless we get an error while reading the first char)
|
||||
|
|
@ -1,16 +1,13 @@
|
|||
{
|
||||
"name": "gperf",
|
||||
"version": "3.1",
|
||||
"port-version": 7,
|
||||
"version": "3.3",
|
||||
"description": "GNU perfect hash function generator",
|
||||
"homepage": "https://www.gnu.org/software/gperf/",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"name": "vcpkg-make",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -3377,8 +3377,8 @@
|
|||
"port-version": 2
|
||||
},
|
||||
"gperf": {
|
||||
"baseline": "3.1",
|
||||
"port-version": 7
|
||||
"baseline": "3.3",
|
||||
"port-version": 0
|
||||
},
|
||||
"gperftools": {
|
||||
"baseline": "2.16",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "d5c53333d7745d56f06cb3e014c7c424a66ef4a7",
|
||||
"version": "3.3",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "ce0c8faaa002c19f8d96a64d4929439cab4570f2",
|
||||
"version": "3.1",
|
||||
|
|
|
|||
Loading…
Reference in New Issue