[zopfli] Fix x64-linux-dynamic build (#25824)

Co-authored-by: Osyotr <8740768+Osyotr@users.noreply.github.com>
This commit is contained in:
Osyotr 2022-07-18 23:10:46 +03:00 committed by GitHub
parent d2dbf99615
commit 5a7c56f934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 36 deletions

View File

@ -6,64 +6,57 @@ vcpkg_from_github(
HEAD_REF master HEAD_REF master
) )
vcpkg_configure_cmake( vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH "${SOURCE_PATH}"
PREFER_NINJA
OPTIONS OPTIONS
-DZOPFLI_BUILD_INSTALL=ON -DZOPFLI_BUILD_INSTALL=ON
) )
vcpkg_install_cmake() vcpkg_cmake_install()
vcpkg_copy_pdbs() vcpkg_copy_pdbs()
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(EXECUTABLE_SUFFIX ".exe")
else()
set(EXECUTABLE_SUFFIX "")
endif()
# Install tools # Install tools
file(COPY ${CURRENT_PACKAGES_DIR}/bin/zopfli${EXECUTABLE_SUFFIX} file(COPY "${CURRENT_PACKAGES_DIR}/bin/zopfli${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(COPY ${CURRENT_PACKAGES_DIR}/bin/zopflipng${EXECUTABLE_SUFFIX} file(COPY "${CURRENT_PACKAGES_DIR}/bin/zopflipng${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) "${CURRENT_PACKAGES_DIR}/bin/zopfli${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
else() "${CURRENT_PACKAGES_DIR}/bin/zopflipng${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/zopfli${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
${CURRENT_PACKAGES_DIR}/bin/zopfli${EXECUTABLE_SUFFIX} "${CURRENT_PACKAGES_DIR}/debug/bin/zopflipng${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
${CURRENT_PACKAGES_DIR}/bin/zopflipng${EXECUTABLE_SUFFIX} )
${CURRENT_PACKAGES_DIR}/debug/bin/zopfli${EXECUTABLE_SUFFIX}
${CURRENT_PACKAGES_DIR}/debug/bin/zopflipng${EXECUTABLE_SUFFIX} if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif() endif()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Zopfli) vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/Zopfli")
# vcpkg_fixup_cmake_targets can not handles this on UNIX currently. # vcpkg_cmake_config_fixup can not handles this on UNIX currently.
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-debug.cmake vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-debug.cmake"
"\"\${_IMPORT_PREFIX}/debug/bin/zopfli\"" "\"\${_IMPORT_PREFIX}/debug/bin/zopfli\""
"\"\${_IMPORT_PREFIX}/tools/zopfli/zopfli\"" "\"\${_IMPORT_PREFIX}/tools/zopfli/zopfli\""
) )
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-debug.cmake vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-debug.cmake"
"\"\${_IMPORT_PREFIX}/debug/bin/zopflipng\"" "\"\${_IMPORT_PREFIX}/debug/bin/zopflipng\""
"\"\${_IMPORT_PREFIX}/tools/zopfli/zopflipng\"" "\"\${_IMPORT_PREFIX}/tools/zopfli/zopflipng\""
) )
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-release.cmake vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-release.cmake"
"\"\${_IMPORT_PREFIX}/bin/zopfli\"" "\"\${_IMPORT_PREFIX}/bin/zopfli\""
"\"\${_IMPORT_PREFIX}/tools/zopfli/zopfli\"" "\"\${_IMPORT_PREFIX}/tools/zopfli/zopfli\""
) )
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-release.cmake vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-release.cmake"
"\"\${_IMPORT_PREFIX}/bin/zopflipng\"" "\"\${_IMPORT_PREFIX}/bin/zopflipng\""
"\"\${_IMPORT_PREFIX}/tools/zopfli/zopflipng\"" "\"\${_IMPORT_PREFIX}/tools/zopfli/zopflipng\""
) )
endif() endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

View File

@ -1,7 +1,18 @@
{ {
"name": "zopfli", "name": "zopfli",
"version-string": "1.0.3", "version": "1.0.3",
"port-version": 1, "port-version": 2,
"description": "Zopfli Compression Algorithm compression library programmed in C", "description": "Zopfli Compression Algorithm compression library programmed in C",
"homepage": "https://github.com/google/zopfli" "homepage": "https://github.com/google/zopfli",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
} }

View File

@ -7846,7 +7846,7 @@
}, },
"zopfli": { "zopfli": {
"baseline": "1.0.3", "baseline": "1.0.3",
"port-version": 1 "port-version": 2
}, },
"zpp-bits": { "zpp-bits": {
"baseline": "4.4.4", "baseline": "4.4.4",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "a0451fdd88ef4beba9c0f572d219c0148ac28a25",
"version": "1.0.3",
"port-version": 2
},
{ {
"git-tree": "e80818813d5dfa5b563c84485d4a0030ce90906a", "git-tree": "e80818813d5dfa5b563c84485d4a0030ce90906a",
"version-string": "1.0.3", "version-string": "1.0.3",