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

[brotli] add pkgconfig / [freetype] depend on brotli #12405

Merged
merged 23 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
750ca3f
[brotli] add pkgconfig
Neumann-A Jul 17, 2020
4fa1623
[freetype] add pkgconfig and add dependency on brotli
Neumann-A Jul 17, 2020
463b06d
[qt5-base] add new freetype dependency to brotli and zstd
Neumann-A Jul 17, 2020
56f12a8
Merge remote-tracking branch 'upstream/master' into brotli_update
Neumann-A Jul 26, 2020
d44f148
Merge remote-tracking branch 'upstream/master' into brotli_update
Neumann-A Aug 1, 2020
82e8534
[freetype] fix cmake paths
Neumann-A Aug 2, 2020
4625d19
[freetype] removed renaming of include dir and unnecessary cmake fixes
Neumann-A Aug 2, 2020
575ff59
[freetype-gl] fix glew include dir
Neumann-A Aug 2, 2020
bc10fb0
[podofo] fix freetype search.
Neumann-A Aug 2, 2020
632235e
Merge remote-tracking branch 'upstream/master' into brotli_update
Neumann-A Aug 2, 2020
3440fe1
fixing wrong freetype stuff due to vcpkg owned wrong CMakeLists.txt .…
Neumann-A Aug 2, 2020
b932141
fixing more freetype hidden issues.
Neumann-A Aug 2, 2020
3581280
[sfml] fix missing include
Neumann-A Aug 2, 2020
cba8021
fix typo
Neumann-A Aug 2, 2020
b79e6c5
[freetype] uncomment previous renaming of include folders
Neumann-A Aug 3, 2020
9df2e4a
fix brotli linkage in static builds
Neumann-A Aug 3, 2020
8e86c40
remove added alias to avoid problems.
Neumann-A Aug 3, 2020
28c4cb3
[freetype] add brotli to the wrapper
Neumann-A Aug 3, 2020
e0d2d1e
Merge remote-tracking branch 'upstream/master' into brotli_update
Neumann-A Aug 5, 2020
95f4ceb
[lzokay] format manifest
strega-nil Aug 5, 2020
8dd339e
Merge remote-tracking branch 'nil/fix-lzokay-formatting' into brotli_…
Neumann-A Aug 6, 2020
fac86e3
Merge remote-tracking branch 'upstream/master' into brotli_update
Neumann-A Aug 6, 2020
325ffe0
Merge remote-tracking branch 'upstream/master' into brotli_update
Neumann-A Aug 6, 2020
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
3 changes: 2 additions & 1 deletion ports/brotli/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Source: brotli
Version: 1.0.7-1
Version: 1.0.7
Port-Version: 3
Homepage: https://github.com/google/brotli
Description: a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling.
73 changes: 73 additions & 0 deletions ports/brotli/pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c4b757f9..eed560c1d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -351,7 +351,7 @@ function(generate_pkg_config_path outvar path)
set("${outvar}" "${${outvar}}" PARENT_SCOPE)
endfunction(generate_pkg_config_path)

-function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION)
+function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION SHARED_TARGET STATIC_TARGET)
file(READ ${INPUT_FILE} TEXT)

set(PREFIX "${CMAKE_INSTALL_PREFIX}")
@@ -366,14 +366,21 @@ function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION)

string(REGEX REPLACE "@PACKAGE_VERSION@" "${VERSION}" TEXT ${TEXT})

+ if(BUILD_SHARED_LIBS)
+ set(LIB_NAME "${SHARED_TARGET}")
+ else()
+ set(LIB_NAME "${STATIC_TARGET}")
+ endif()
+ string(REGEX REPLACE "@lib_name@" "${LIB_NAME}" TEXT ${TEXT})
+
file(WRITE ${OUTPUT_FILE} ${TEXT})
endfunction()

-transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}")
+transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}" brotlicommon brotlicommon-static)

-transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}")
+transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}" brotlidec brotlidec-static)

-transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}")
+transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}" brotlienc brotlienc-static)

if(NOT BROTLI_BUNDLED_MODE)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc"
diff --git a/scripts/libbrotlicommon.pc.in b/scripts/libbrotlicommon.pc.in
index 2a8cf7a35..464a21292 100644
--- a/scripts/libbrotlicommon.pc.in
+++ b/scripts/libbrotlicommon.pc.in
@@ -7,5 +7,5 @@ Name: libbrotlicommon
URL: https://github.com/google/brotli
Description: Brotli common dictionary library
Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lbrotlicommon
+Libs: -L${libdir} -l@lib_name@
Cflags: -I${includedir}
diff --git a/scripts/libbrotlidec.pc.in b/scripts/libbrotlidec.pc.in
index 6f8ef2e41..f87d3f65f 100644
--- a/scripts/libbrotlidec.pc.in
+++ b/scripts/libbrotlidec.pc.in
@@ -7,6 +7,6 @@ Name: libbrotlidec
URL: https://github.com/google/brotli
Description: Brotli decoder library
Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lbrotlidec
+Libs: -L${libdir} -l@lib_name@
Requires.private: libbrotlicommon >= 1.0.2
Cflags: -I${includedir}
diff --git a/scripts/libbrotlienc.pc.in b/scripts/libbrotlienc.pc.in
index 2098afe2c..7b6371bcb 100644
--- a/scripts/libbrotlienc.pc.in
+++ b/scripts/libbrotlienc.pc.in
@@ -7,6 +7,6 @@ Name: libbrotlienc
URL: https://github.com/google/brotli
Description: Brotli encoder library
Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lbrotlienc
+Libs: -L${libdir} -l@lib_name@
Requires.private: libbrotlicommon >= 1.0.2
Cflags: -I${includedir}
3 changes: 3 additions & 0 deletions ports/brotli/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ vcpkg_from_github(
PATCHES
install.patch
fix-arm-uwp.patch
pkgconfig.patch
)

vcpkg_configure_cmake(
Expand All @@ -21,6 +22,8 @@ vcpkg_copy_pdbs()

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/brotli)
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-brotli TARGET_PATH share/unofficial-brotli)
vcpkg_fixup_pkgconfig()


file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-brotli)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
22 changes: 0 additions & 22 deletions ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch

This file was deleted.

4 changes: 2 additions & 2 deletions ports/freetype/CONTROL
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Source: freetype
Version: 2.10.2
Port-Version: 1
Build-Depends: zlib
Port-Version: 2
Build-Depends: zlib, brotli
Homepage: https://www.freetype.org/
Description: A library to render fonts.
Default-Features: bzip2, png
Expand Down
20 changes: 20 additions & 0 deletions ports/freetype/pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 65839ac58..54f2ce8ec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -517,7 +517,6 @@ endif ()

if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
# Generate the pkg-config file
- if (UNIX)
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN)

string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}")
@@ -551,7 +550,6 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
FILES ${PROJECT_BINARY_DIR}/freetype2.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT pkgconfig)
- endif ()

install(
TARGETS freetype
45 changes: 19 additions & 26 deletions ports/freetype/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ vcpkg_extract_source_archive_ex(
REF ${FT_VERSION}
PATCHES
0001-Fix-install-command.patch
0002-Add-CONFIG_INSTALL_PATH-option.patch
0003-Fix-UWP.patch
pkgconfig.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand All @@ -28,41 +28,34 @@ vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DCONFIG_INSTALL_PATH=share/freetype
-DFT_WITH_ZLIB=ON # Force system zlib.
${FEATURE_OPTIONS}
-DFT_WITH_BROTLI=ON
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=ON
${FEATURE_OPTIONS}
${OPTIONS}
)

vcpkg_install_cmake()

file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/freetype ${CURRENT_PACKAGES_DIR}/include/freetype)
file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/ft2build.h ${CURRENT_PACKAGES_DIR}/include/ft2build.h)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/freetype2)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config-debug.cmake DEBUG_MODULE)
string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}")
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" DEBUG_MODULE "${DEBUG_MODULE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-debug.cmake "${DEBUG_MODULE}")
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/freetype)
find_library(FREETYPE_DEBUG NAMES freetyped PATHS "${CURRENT_PACKAGES_DIR}/debug/lib/" NO_DEFAULT_PATH)
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" AND FREETYPE_DEBUG)
file(READ "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" _contents)
string(REPLACE "-lfreetype" "-lfreetyped" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" "${_contents}")
endif()
vcpkg_fixup_pkgconfig()

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake RELEASE_MODULE)
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" RELEASE_MODULE "${RELEASE_MODULE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake "${RELEASE_MODULE}")
endif()
#file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/freetype ${CURRENT_PACKAGES_DIR}/include/freetype)
#file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/ft2build.h ${CURRENT_PACKAGES_DIR}/include/ft2build.h)
Neumann-A marked this conversation as resolved.
Show resolved Hide resolved
#file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/freetype2)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Fix the include dir [freetype2 -> freetype]
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config.cmake CONFIG_MODULE)
else() #if(VCPKG_BUILD_TYPE STREQUAL "release")
file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE)
endif()
string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include;\${_IMPORT_PREFIX}/include/freetype" CONFIG_MODULE "${CONFIG_MODULE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}")
#file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE)
#string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include;\${_IMPORT_PREFIX}/include/freetype" CONFIG_MODULE "${CONFIG_MODULE}")
#file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}")

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

file(COPY
Expand Down
2 changes: 1 addition & 1 deletion ports/qt5-base/CONTROL
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Version: 5.15.0
Port-Version: 1
Homepage: https://www.qt.io/
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows)
Build-Depends: zlib, zstd, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows)

Feature: latest
Description: Build latest qt version (5.15.0) instead of LTS (latest and LTS are currently the same)
11 changes: 9 additions & 2 deletions ports/qt5-base/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ find_library(HARFBUZZ_DEBUG NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/debug
find_library(SQLITE_RELEASE NAMES sqlite3 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) # Depends on openssl and zlib(linux)
find_library(SQLITE_DEBUG NAMES sqlite3 sqlite3d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)

find_library(BROTLI_COMMON_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(BROTLI_COMMON_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(BROTLI_DEC_RELEASE NAMES brotlidec brotlidec-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(BROTLI_DEC_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(BROTLI_ENC_RELEASE NAMES brotlienc brotlienc-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(BROTLI_ENC_DEBUG NAMES brotlienc brotlienc-static brotliencd brotlienc-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)

find_library(ICUUC_RELEASE NAMES icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(ICUUC_DEBUG NAMES icuucd libicuucd icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(ICUTU_RELEASE NAMES icutu libicutu PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
Expand Down Expand Up @@ -166,8 +173,8 @@ find_library(SSL_DEBUG ssl ssleay32 ssld ssleay32d PATHS "${CURRENT_INSTALLED_DI
find_library(EAY_RELEASE libeay32 crypto libcrypto PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(EAY_DEBUG libeay32 crypto libcrypto libeay32d cryptod libcryptod PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)

set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE}")
set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG}")
set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE} ${BROTLI_ENC_RELEASE} ${BROTLI_DEC_RELEASE} ${BROTLI_COMMON_RELEASE}")
set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG} ${BROTLI_ENC_DEBUG} ${BROTLI_DEC_DEBUG} ${BROTLI_COMMON_RELEASE}")

# If HarfBuzz is built with GLib enabled, it must be statically link
set(GLIB_LIB_VERSION 2.0)
Expand Down