aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Stöggl <c72578@yahoo.de>2020-07-06 22:40:46 +0200
committerGitHub <noreply@github.com>2020-07-06 13:40:46 -0700
commita05cec95a0eede5b6b0cdce80274e2c96f768f74 (patch)
tree22f851e2ee630291412ef4382da62a43b1e94caa
parent24637886f8cadf89711b9cd48e4092b513be0832 (diff)
downloadvcpkg-a05cec95a0eede5b6b0cdce80274e2c96f768f74.tar.gz
vcpkg-a05cec95a0eede5b6b0cdce80274e2c96f768f74.zip
[libffi] Add pkgconfig file (#12126)
* [libffi] Add pkgconfig file - Configure and add the libffi.pc file. - Furthermore, enable the check for same 32/64bit-ness in libffiConfigVersion.cmake again, which had caused issues in the past with newer versions of glib using meson build, e.g. when building for x86-windows target on an x64-windows host. Now, libffi is found by current glib (e.g. 2.64.3) during meson build using the libffi pkgconfig file. * Check VCPKG_BUILD_TYPE to handle release/debug
-rw-r--r--ports/libffi/CMakeLists.txt2
-rw-r--r--ports/libffi/CONTROL4
-rw-r--r--ports/libffi/portfile.cmake26
3 files changed, 27 insertions, 5 deletions
diff --git a/ports/libffi/CMakeLists.txt b/ports/libffi/CMakeLists.txt
index c85e6382c..d7c741859 100644
--- a/ports/libffi/CMakeLists.txt
+++ b/ports/libffi/CMakeLists.txt
@@ -186,8 +186,6 @@ include(CMakePackageConfigHelpers)
configure_package_config_file(${PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION share/${PROJECT_NAME})
-# Disable check for same 32/64bit-ness in libffiConfigVersion.cmake by setting CMAKE_SIZEOF_VOID_P
-set (CMAKE_SIZEOF_VOID_P "")
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${VERSION}
diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL
index 655f6023c..95dfbeb56 100644
--- a/ports/libffi/CONTROL
+++ b/ports/libffi/CONTROL
@@ -1,4 +1,4 @@
Source: libffi
-Version: 3.3-2
+Version: 3.3-3
Homepage: https://github.com/libffi/libffi
-Description: Portable, high level programming interface to various calling conventions \ No newline at end of file
+Description: Portable, high level programming interface to various calling conventions
diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake
index 7209ce8d6..303331924 100644
--- a/ports/libffi/portfile.cmake
+++ b/ports/libffi/portfile.cmake
@@ -1,3 +1,5 @@
+set(VERSION 3.3)
+
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libffi/libffi
@@ -19,8 +21,30 @@ vcpkg_configure_cmake(
)
vcpkg_install_cmake()
+
+# Create pkgconfig file
+set(PACKAGE_VERSION ${VERSION})
+set(prefix "${CURRENT_INSTALLED_DIR}")
+set(exec_prefix "\${prefix}")
+set(libdir "\${prefix}/lib")
+set(toolexeclibdir "\${libdir}")
+set(includedir "\${prefix}/include")
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libffi.pc" @ONLY)
+endif()
+# debug
+set(prefix "${CURRENT_INSTALLED_DIR}/debug")
+set(exec_prefix "\${prefix}")
+set(libdir "\${prefix}/lib")
+set(toolexeclibdir "\${libdir}")
+set(includedir "\${prefix}/../include")
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libffi.pc" @ONLY)
+endif()
+
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets()
+vcpkg_fixup_pkgconfig()
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/ffi.h
@@ -32,4 +56,4 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
)
endif()
-file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)