Skip to content

Update gperf to v3.2 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ports/gperf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)

project(gperf LANGUAGES C CXX)

include(CheckCXXSourceCompiles)
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$<$<CONFIG:Debug>:Debug>")
endif()

set(LIBGP_SOURCES
lib/getline.cc
lib/getline.h
Expand Down
2 changes: 1 addition & 1 deletion ports/gperf/CONTROL
Original file line number Diff line number Diff line change
@@ -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/

This file was deleted.

19 changes: 9 additions & 10 deletions ports/gperf/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
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})
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
)

Expand Down