Skip to content
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

[vcpkg] create pkg-config files #7129

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/bzip2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: bzip2
Version: 1.0.6-5
Version: 1.0.6-6
Homepage: http://www.bzip.org/
Description: High-quality data compressor.
1 change: 1 addition & 0 deletions ports/bzip2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/bzip2/LICENSE ${CURRENT_PACKAGES_DIR}/
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

vcpkg_test_cmake(PACKAGE_NAME BZip2 MODULE)
vcpkg_pkgconfig(RELEASE -lbz2 DEBUG -lbz2d)
2 changes: 1 addition & 1 deletion ports/double-conversion/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: double-conversion
Version: 3.1.5
Version: 3.1.5-1
Homepage: https://github.com/google/double-conversion
Description: Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles.
1 change: 1 addition & 0 deletions ports/double-conversion/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Handle copyright
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/double-conversion/copyright COPYONLY)
vcpkg_pkgconfig()
2 changes: 1 addition & 1 deletion ports/expat/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: expat
Version: 2.2.7
Version: 2.2.7-1
Homepage: https://github.com/libexpat/libexpat
Description: XML parser library written in C
Supports: !uwp
1 change: 1 addition & 0 deletions ports/expat/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/expat_external.h "${EXPAT_EXTERNAL_H}")

file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/expat)
vcpkg_pkgconfig()
2 changes: 1 addition & 1 deletion ports/fontconfig/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: fontconfig
Version: 2.12.4-10
Version: 2.12.4-11
Homepage: https://www.freedesktop.org/software/fontconfig/front.html
Description: Library for configuring and customizing font access.
Build-Depends: freetype, expat, libiconv, dirent
1 change: 1 addition & 0 deletions ports/fontconfig/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontc
file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright)

vcpkg_test_cmake(PACKAGE_NAME unofficial-fontconfig)
vcpkg_pkgconfig(REQUIRES expat freetype2)
2 changes: 1 addition & 1 deletion ports/freetype/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: freetype
Version: 2.10.1-6
Version: 2.10.1-7
Build-Depends: zlib
Homepage: https://www.freetype.org/
Description: A library to render fonts.
Expand Down
1 change: 1 addition & 0 deletions ports/freetype/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")

configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/freetype/vcpkg-cmake-wrapper.cmake @ONLY)
endif()
vcpkg_pkgconfig(NAME freetype2 RELEASE -lfreetype DEBUG -lfreetyped)
2 changes: 1 addition & 1 deletion ports/glib/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: glib
Version: 2.52.3-14-6
Version: 2.52.3-15
Homepage: https://developer.gnome.org/glib/
Description: Portable, general-purpose utility library.
Build-Depends: zlib, pcre, libffi, gettext, libiconv
Expand Down
10 changes: 10 additions & 0 deletions ports/glib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,13 @@ vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
if(VCPKG_LIBRARY_LINKAGE STREQUAL STATIC)
set(_p0 ".0")
else()
set(_p0)
endif()
vcpkg_pkgconfig(NAME glib-2.0 COMMON -lglib-2${_p0} REQUIRES zlib libpcre)
vcpkg_pkgconfig(NAME gmodule-2.0 COMMON -lgmodule-2${_p0} REQUIRES glib-2.0)
vcpkg_pkgconfig(NAME gobject-2.0 COMMON -lgobject-2${_p0} REQUIRES glib-2.0 libffi)
vcpkg_pkgconfig(NAME gthread-2.0 COMMON -lgthread-2${_p0} REQUIRES glib-2.0)
vcpkg_pkgconfig(NAME gio-2.0 COMMON -lgio-2${_p0} REQUIRES gobject-2.0 gmodule-2.0)
1 change: 1 addition & 0 deletions ports/harfbuzz/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ endif()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_pkgconfig(REQUIRES freetype2)
2 changes: 1 addition & 1 deletion ports/icu/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: icu
Version: 67.1
Version: 67.1-1
Homepage: http://icu-project.org/apiref/icu4c/
Description: Mature and widely used Unicode and localization library.
Supports: !(arm|uwp)
2 changes: 2 additions & 0 deletions ports/icu/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,5 @@ vcpkg_copy_pdbs()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_pkgconfig(NAME icu-uc COMMON -licuuc -licudata -lpthread -pthread -ldl -lm)
vcpkg_pkgconfig(NAME icu-i18n COMMON -licui18n REQUIRES icu-uc)
2 changes: 1 addition & 1 deletion ports/libffi/CONTROL
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion ports/libffi/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
)
endif()

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_pkgconfig()
2 changes: 1 addition & 1 deletion ports/libjpeg-turbo/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libjpeg-turbo
Version: 2.0.4
Version: 2.0.4-1
Homepage: https://github.com/libjpeg-turbo/libjpeg-turbo
Description: libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems.
2 changes: 2 additions & 0 deletions ports/libjpeg-turbo/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo/LICENSE.md ${CURRENT_PAC
vcpkg_copy_pdbs()

vcpkg_test_cmake(PACKAGE_NAME JPEG MODULE)
vcpkg_pkgconfig(NAME libjpeg COMMON -ljpeg)
vcpkg_pkgconfig(NAME libturbojpeg COMMON -lturbojpeg)
2 changes: 1 addition & 1 deletion ports/liblzma/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: liblzma
Version: 5.2.4-5
Version: 5.2.4-6
Homepage: https://github.com/xz-mirror/xz
Description: Compression library with an API similar to that of zlib.
3 changes: 2 additions & 1 deletion ports/liblzma/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ endif()

file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma)

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma RENAME copyright)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma RENAME copyright)
vcpkg_pkgconfig(RELEASE -llzma DEBUG -llzmad)
2 changes: 1 addition & 1 deletion ports/libpng/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: libpng
Version: 1.6.37-9
Version: 1.6.37-10
Build-Depends: zlib
Homepage: https://github.com/glennrp/libpng
Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files.
Expand Down
1 change: 1 addition & 0 deletions ports/libpng/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/libpng)
vcpkg_copy_pdbs()

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_pkgconfig(COMMON -lpng)
2 changes: 1 addition & 1 deletion ports/openssl-unix/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: openssl-unix
Version: 1.1.1d-3
Version: 1.1.1d-4
Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.
Supports: !(windows|uwp)
3 changes: 3 additions & 0 deletions ports/openssl-unix/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
endif()

vcpkg_test_cmake(PACKAGE_NAME OpenSSL MODULE)
vcpkg_pkgconfig(NAME libcrypto COMMON -lcrypto -ldl REQUIRES zlib)
vcpkg_pkgconfig(NAME libssl COMMON -lssl REQUIRES libcrypto)
vcpkg_pkgconfig(NAME openssl COMMON -lssl REQUIRES libcrypto)
2 changes: 1 addition & 1 deletion ports/pcre/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: pcre
Version: 8.44
Version: 8.44-1
Homepage: https://www.pcre.org/
Description: Perl Compatible Regular Expressions
5 changes: 5 additions & 0 deletions ports/pcre/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

vcpkg_copy_pdbs()
vcpkg_pkgconfig(NAME libpcre COMMON -lpcre -lpthread -pthread)
vcpkg_pkgconfig(NAME libpcre-16 COMMON -lpcre-16 -pthread)
vcpkg_pkgconfig(NAME libpcre-32 COMMON -lpcre-32 -pthread)
vcpkg_pkgconfig(NAME libpcre-cpp COMMON -lpcre-cpp REQUIRES libpcre-8)
vcpkg_pkgconfig(NAME libpcre-posix COMMON -lpcre-posix REQUIRES libpcre-8)
2 changes: 1 addition & 1 deletion ports/pcre2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: pcre2
Version: 10.30-7
Version: 10.30-8
Homepage: https://pcre.org/
Description: PCRE2 is a re-working of the original Perl Compatible Regular Expressions library
4 changes: 4 additions & 0 deletions ports/pcre2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_pkgconfig(NAME libpcre2-8 COMMON -lpcre2-8)
vcpkg_pkgconfig(NAME libpcre2-16 COMMON -lpcre2-16)
vcpkg_pkgconfig(NAME libpcre2-32 COMMON -lpcre2-32)
vcpkg_pkgconfig(NAME libpcre2-posix COMMON -lpcre2-posix REQUIRES libpcre2-8)
2 changes: 1 addition & 1 deletion ports/sqlite3/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: sqlite3
Version: 3.32.0-0
Version: 3.32.0-1
Homepage: https://sqlite.org/
Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.

Expand Down
99 changes: 51 additions & 48 deletions ports/sqlite3/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,48 +1,51 @@
set(SQLITE_VERSION 3320000)
set(SQLITE_HASH cf176859dfe5b6b92f02c8408faf3389fba0bd441308dea058085e031c45ab28377ce5ae519c48efe0ae51a16d4242e8d00461229ed099ee5cc2741a0f32ecd4 )

vcpkg_download_distfile(ARCHIVE
URLS "https://sqlite.org/2020/sqlite-amalgamation-${SQLITE_VERSION}.zip"
FILENAME "sqlite-amalgamation-${SQLITE_VERSION}.zip"
SHA512 ${SQLITE_HASH}
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${SQLITE_VERSION}
PATCHES fix-arm-uwp.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
INVERTED_FEATURES
tool SQLITE3_SKIP_TOOLS
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DSQLITE3_SKIP_TOOLS=ON
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

if(NOT SQLITE3_SKIP_TOOLS AND EXISTS ${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX})
file(RENAME ${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/sqlite3${VCPKG_HOST_EXECUTABLE_SUFFIX})
endif()

configure_file(
${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake
${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3-config.cmake
@ONLY
)

file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")
vcpkg_copy_pdbs()
set(SQLITE_VERSION 3320000)
set(SQLITE_HASH cf176859dfe5b6b92f02c8408faf3389fba0bd441308dea058085e031c45ab28377ce5ae519c48efe0ae51a16d4242e8d00461229ed099ee5cc2741a0f32ecd4 )

vcpkg_download_distfile(ARCHIVE
URLS "https://sqlite.org/2020/sqlite-amalgamation-${SQLITE_VERSION}.zip"
FILENAME "sqlite-amalgamation-${SQLITE_VERSION}.zip"
SHA512 ${SQLITE_HASH}
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${SQLITE_VERSION}
PATCHES fix-arm-uwp.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
INVERTED_FEATURES
tool SQLITE3_SKIP_TOOLS
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DSQLITE3_SKIP_TOOLS=ON
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

if(NOT SQLITE3_SKIP_TOOLS AND EXISTS ${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX})
file(RENAME ${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/sqlite3${VCPKG_HOST_EXECUTABLE_SUFFIX})
endif()

configure_file(
${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake
${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3-config.cmake
@ONLY
)

file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")
vcpkg_copy_pdbs()

vcpkg_pkgconfig(COMMON -lsqlite3 -ldl -lpthread -pthread)

2 changes: 1 addition & 1 deletion ports/zlib/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: zlib
Version: 1.2.11-6
Version: 1.2.11-7
Homepage: https://www.zlib.net/
Description: A compression library
1 change: 1 addition & 0 deletions ports/zlib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ vcpkg_copy_pdbs()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

vcpkg_test_cmake(PACKAGE_NAME ZLIB MODULE)
vcpkg_pkgconfig(COMMON -lz)
1 change: 1 addition & 0 deletions scripts/cmake/vcpkg_common_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ include(vcpkg_get_windows_sdk)
include(vcpkg_replace_string)
include(vcpkg_from_git)
include(vcpkg_test_cmake)
include(vcpkg_pkgconfig)
include(vcpkg_prettify_command)
include(vcpkg_buildpath_length_warning)
2 changes: 0 additions & 2 deletions scripts/cmake/vcpkg_fixup_cmake_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,3 @@ function(vcpkg_fixup_cmake_targets)
file(WRITE ${CMAKE_FILE} "${_contents}")
endforeach()
endfunction()