diff --git a/ports/gperf/CMakeLists.txt b/ports/gperf/CMakeLists.txt index d9cad0d..88a8b1c 100644 --- a/ports/gperf/CMakeLists.txt +++ b/ports/gperf/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.15) + project(gperf LANGUAGES C CXX) include(CheckCXXSourceCompiles) @@ -6,6 +7,10 @@ include(GNUInstallDirs) CHECK_CXX_SOURCE_COMPILES("int main(int n) { int dynamic_array[n]; }" HAVE_DYNAMIC_ARRAY) +if(MSVC) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endif() + set(LIBGP_SOURCES lib/getline.cc lib/getline.h diff --git a/ports/gperf/CONTROL b/ports/gperf/CONTROL index 34d19df..a6a02b7 100644 --- a/ports/gperf/CONTROL +++ b/ports/gperf/CONTROL @@ -1,4 +1,4 @@ Source: gperf -Version: 3.1-1 +Version: 3.2 Description: GNU perfect hash function generator Homepage: https://www.gnu.org/software/gperf/ diff --git a/ports/gperf/patches/0001-Support-input-files-with-CR-LF-line-terminators.patch b/ports/gperf/patches/0001-Support-input-files-with-CR-LF-line-terminators.patch deleted file mode 100644 index 47386f6..0000000 --- a/ports/gperf/patches/0001-Support-input-files-with-CR-LF-line-terminators.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 13c9383b10872525688ef2b4daab090037ea3576 Mon Sep 17 00:00:00 2001 -From: Bruno Haible -Date: Tue, 24 Apr 2018 09:25:10 +0200 -Subject: [PATCH] Support input files with CR/LF line terminators. - ---- - ChangeLog | 6 ++++++ - NEWS | 6 ++++++ - src/input.cc | 26 +++++++++++++++++++++++++- - 3 files changed, 37 insertions(+), 1 deletion(-) - -diff --git a/src/input.cc b/src/input.cc -index 67c93b5..fca04e0 100644 ---- a/src/input.cc -+++ b/src/input.cc -@@ -1,5 +1,5 @@ - /* Input routines. -- Copyright (C) 1989-1998, 2002-2004, 2011 Free Software Foundation, Inc. -+ Copyright (C) 1989-1998, 2002-2004, 2011, 2017-2018 Free Software Foundation, Inc. - Written by Douglas C. Schmidt - and Bruno Haible . - -@@ -263,6 +263,30 @@ Input::read_input () - exit (1); - } - -+ /* Convert CR/LF line terminators (Windows) to LF line terminators (Unix). -+ GCC 3.3 and newer support CR/LF line terminators in C sources on Unix, -+ so we do the same. -+ The so-called "text mode" in stdio on Windows translates CR/LF to \n -+ automatically, but here we also need this conversion on Unix. As a side -+ effect, on Windows we also parse CR/CR/LF into a single \n, but this -+ is not a problem. */ -+ { -+ char *p = input; -+ char *p_end = input + input_length; -+ /* Converting the initial segment without CRs is a no-op. */ -+ while (p < p_end && *p != '\r') -+ p++; -+ /* Then start the conversion for real. */ -+ char *q = p; -+ while (p < p_end) -+ { -+ if (p[0] == '\r' && p + 1 < p_end && p[1] == '\n') -+ p++; -+ *q++ = *p++; -+ } -+ input_length = q - input; -+ } -+ - /* We use input_end as a limit, in order to cope with NUL bytes in the - input. But note that one trailing NUL byte has been added after - input_end, for convenience. */ diff --git a/ports/gperf/portfile.cmake b/ports/gperf/portfile.cmake index f9a9bce..2689917 100644 --- a/ports/gperf/portfile.cmake +++ b/ports/gperf/portfile.cmake @@ -1,18 +1,16 @@ +set(VERSION 3.2) + 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( +# There's a 3.2 release but it was never added to the ftp +# Use a GitHub mirror instead +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/patches/0001-Support-input-files-with-CR-LF-line-terminators.patch + REPO rurban/gperf + REF v3.2 + SHA512 9373ddff2b3f631722e7dbc1ad7330466d1322ff552c4876b36b397e75b0ec5f665b3a4437ea1b7163989f8e8864007548938b0970df2b345f8ae324d3f0d91d ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -20,6 +18,7 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DCMAKE_SYSTEM_VERSION=8.1 OPTIONS_RELEASE -DCMAKE_INSTALL_BINDIR=tools )