Skip to content
Closed
13 changes: 3 additions & 10 deletions ports/atk/CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,7 @@ find_library(GLIB_GOBJECT_LIBRARY gobject-${GLIB_LIB_VERSION})
find_library(GLIB_GMODULE_LIBRARY gmodule-${GLIB_LIB_VERSION})
set(GLIB_LIBRARIES ${GLIB_GLIB_LIBRARY} ${GLIB_GOBJECT_LIBRARY} ${GLIB_GMODULE_LIBRARY})

if (WIN32 OR APPLE)
find_path(LIBINTL_INCLUDE_DIR libintl.h)
find_library(LIBINTL_LIBRARY NAMES libintl intl)
else()
find_package(Intl REQUIRED)
set(LIBINTL_INCLUDE_DIR ${Intl_INCLUDE_DIRS})
set(LIBINTL_LIBRARY ${Intl_LIBRARIES})
endif()
find_package(Intl REQUIRED)

set(ATK_SOURCES
atk/atkaction.c
Expand Down Expand Up @@ -88,8 +81,8 @@ set(ATK_SOURCES

add_library(atk ${ATK_SOURCES})
target_compile_definitions(atk PRIVATE ATK_COMPILATION ${ATK_EXPORT_MACRO} G_DISABLE_SINGLE_INCLUDES ATK_LOCALEDIR="/dummy/share/locale")
target_link_libraries(atk ${LIBINTL_LIBRARY} ${GLIB_LIBRARIES})
target_include_directories(atk PRIVATE ${GLIB_INCLUDE_DIR} ${LIBINTL_INCLUDE_DIR})
target_link_libraries(atk ${GLIB_LIBRARIES} ${Intl_LIBRARIES})
target_include_directories(atk PRIVATE ${GLIB_INCLUDE_DIR} ${Intl_INCLUDE_DIRS})

set_target_properties(atk PROPERTIES
OUTPUT_NAME atk-${ATK_DLL_SUFFIX}
Expand Down
4 changes: 2 additions & 2 deletions ports/atk/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: atk
Version: 2.24.0-5
Port-Version: 1
Version: 2.24.0
Port-Version: 6
Homepage: https://developer.gnome.org/atk/
Description: GNOME Accessibility Toolkit
Build-Depends: glib, gettext
Expand Down
2 changes: 1 addition & 1 deletion ports/exiv2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: exiv2
Version: 0.27.3
Port-Version: 3
Port-Version: 4
Build-Depends: zlib, libiconv, gettext
Description: Image metadata library and tools
Homepage: https://www.exiv2.org
Expand Down
6 changes: 2 additions & 4 deletions ports/exiv2/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
find_package(Iconv REQUIRED)
find_package(Intl REQUIRED)
if(TARGET exiv2lib)
set_property(TARGET exiv2lib APPEND PROPERTY INTERFACE_LINK_LIBRARIES
Iconv::Iconv
)
target_link_libraries(exiv2lib INTERFACE ${Intl_LIBRARIES})
set_property(TARGET exiv2lib APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${Intl_LIBRARIES})
set_property(TARGET exiv2lib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Intl_INCLUDE_DIRS})
endif()
endif()
17 changes: 9 additions & 8 deletions ports/gdk-pixbuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ find_package(unofficial-glib CONFIG REQUIRED)
find_path(GLIB_INCLUDE_DIR glib.h)

find_package(Intl REQUIRED)
find_path(LIBINTL_INCLUDE_DIR libintl.h)


if(WIN32)
configure_file(${CMAKE_SOURCE_DIR}/config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY)
else()
Expand Down Expand Up @@ -62,16 +61,18 @@ if(WIN32)
endif()
add_library(gdk-pixbuf ${SOURCES})

target_include_directories(gdk-pixbuf PRIVATE
${GLIB_INCLUDE_DIR}
target_include_directories(gdk-pixbuf PRIVATE
${GLIB_INCLUDE_DIR}
${Intl_INCLUDE_DIRS}
${PNG_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${Intl_INCLUDE_DIR})
)

set(LIBS
unofficial::glib::gio unofficial::glib::glib unofficial::glib::gmodule unofficial::glib::gobject ${Intl_LIBRARIES}
${ZLIB_LIBRARIES}
${PNG_LIBRARIES}
unofficial::glib::gio unofficial::glib::glib unofficial::glib::gmodule unofficial::glib::gobject
${Intl_LIBRARIES}
${ZLIB_LIBRARIES}
${PNG_LIBRARIES}
)
if(WIN32)
list(APPEND LIBS Gdiplus ole32)
Expand Down
2 changes: 1 addition & 1 deletion ports/gdk-pixbuf/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: gdk-pixbuf
Version: 2.36.9-5
Version: 2.36.9
Port-Version: 6
Homepage: https://developer.gnome.org/gdk-pixbuf/
Description: Image loading library.
Expand Down
1 change: 1 addition & 0 deletions ports/gettext/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: gettext
Version: 0.21
Port-Version: 1
Homepage: https://www.gnu.org/software/gettext/
Description: The GNU gettext utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages. Provides libintl.
Build-Depends: libiconv
8 changes: 8 additions & 0 deletions ports/gettext/Intl-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include(CmakeFindDependencyMacro)
find_dependency(Iconv)

set(Intl_FOUND TRUE)
set(Intl_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../include")
set(Intl_INCLUDE_DIRS ${Intl_INCLUDE_DIR} ${Iconv_INCLUDE_DIRS})
set(Intl_LIBRARY @Intl_LIBRARY@)
set(Intl_LIBRARIES ${Intl_LIBRARY} ${Iconv_LIBRARIES})
31 changes: 14 additions & 17 deletions ports/gettext/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,21 @@ else()
vcpkg_install_make(SUBPATH "/intl")
endif()


# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gettext)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/gettext/COPYING ${CURRENT_PACKAGES_DIR}/share/gettext/copyright)

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin)

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

set(GNU_DLL_PATHS lib/ debug/lib/)
set(GNU_DLL_NAME GNU.Gettext.dll) #C# dll?
foreach(DLL_PATH IN LISTS GNU_DLL_PATHS)
if(EXISTS "${CURRENT_PACKAGES_DIR}/${DLL_PATH}${GNU_DLL_NAME}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/${DLL_PATH}${GNU_DLL_NAME}")
endif()
# These targets are provided for backwards compatibility with previous vcpkg versions
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-gettext TARGET_PATH share/unofficial-gettext)
Comment on lines +62 to +63
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI failed with following errors:

Make Error at scripts/cmake/vcpkg_fixup_cmake_targets.cmake:126 (message):
  'D:/packages/gettext_x64-windows-static/debug/share/unofficial-gettext'
  does not exist.
Call Stack (most recent call first):
  ports/gettext/portfile.cmake:63 (vcpkg_fixup_cmake_targets)
  scripts/ports.cmake:136 (include)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not exists anymore since gettext was changed to native build which is make based

file(GLOB DEBUG_LIBS LIST_DIRECTORIES false RELATIVE "${CURRENT_PACKAGES_DIR}" ${CURRENT_PACKAGES_DIR}/debug/lib/*)
file(GLOB RELEASE_LIBS LIST_DIRECTORIES false RELATIVE "${CURRENT_PACKAGES_DIR}" ${CURRENT_PACKAGES_DIR}/lib/*)
set(Intl_LIBRARY)
foreach(RELEASE_LIB IN LISTS RELEASE_LIBS)
list(APPEND Intl_LIBRARY optimized "\${CMAKE_CURRENT_LIST_DIR}/../../${RELEASE_LIB}")
endforeach()
foreach(DEBUG_LIB IN LISTS DEBUG_LIBS)
list(APPEND Intl_LIBRARY debug "\${CMAKE_CURRENT_LIST_DIR}/../../${DEBUG_LIB}")
endforeach()
configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/gettext/usage @ONLY)
configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/intl/vcpkg-cmake-wrapper.cmake COPYONLY)
configure_file(${CMAKE_CURRENT_LIST_DIR}/Intl-config.cmake ${CURRENT_PACKAGES_DIR}/share/intl/Intl-config.cmake @ONLY)

vcpkg_copy_pdbs()

file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/intl)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
5 changes: 5 additions & 0 deletions ports/gettext/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The package gettext:@TARGET_TRIPLET@ is compatible with built-in CMake targets:

find_package(Intl REQUIRED)
target_link_libraries(main PRIVATE ${Intl_LIBRARIES})
target_include_directories(main PRIVATE ${Intl_INCLUDE_DIRS})
14 changes: 4 additions & 10 deletions ports/gettext/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
_find_package(${ARGS})

if(Intl_FOUND AND Intl_LIBRARIES)
include(SelectLibraryConfigurations)
find_library(Intl_LIBRARY_DEBUG NAMES intl libintl intl-8 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH)
find_library(Intl_LIBRARY_RELEASE NAMES intl libintl intl-8 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH)
unset(Intl_LIBRARIES)
unset(Intl_LIBRARIES CACHE)
select_library_configurations(Intl)
endif()
list(REMOVE_ITEM ARGS "NO_MODULE")
list(REMOVE_ITEM ARGS "CONFIG")
list(REMOVE_ITEM ARGS "MODULE")
_find_package(${ARGS} CONFIG)
11 changes: 4 additions & 7 deletions ports/glib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(PCRE_SUFFIX d)
endif()
find_library(PCRE_LIBRARY NAMES pcre${PCRE_SUFFIX} pcre)
# libiconv
find_package(Iconv REQUIRED)

# libffi
find_path(FFI_INCLUDE_DIR ffi.h)
find_library(FFI_LIBRARY NAMES ffi libffi)
Expand All @@ -43,10 +42,7 @@ if(APPLE)
link_libraries(${CORESERVICES_LIBRARY} ${COREFOUNDATION_LIBRARY} ${FOUNDATION_LIBRARY})
endif()

if(WIN32 OR APPLE)
# libintl(gettext)
find_package(Intl REQUIRED)
endif()
find_package(Intl REQUIRED)

if(WIN32)
set(LIBRESOLV_LIBRARY)
Expand Down Expand Up @@ -135,7 +131,8 @@ if(NOT WIN32)
endif()
add_library(glib ${GLIB_SOURCES})
target_compile_definitions(glib PRIVATE GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR="")
target_link_libraries(glib PRIVATE ${PCRE_LIBRARY} Iconv::Iconv ${Intl_LIBRARIES})
target_link_libraries(glib PRIVATE ${PCRE_LIBRARY} ${Intl_LIBRARIES})

if(WIN32)
target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE)
target_link_libraries(glib PRIVATE ws2_32 winmm advapi32 ole32 shell32)
Expand Down
4 changes: 2 additions & 2 deletions ports/glib/CONTROL
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Source: glib
Version: 2.52.3
Port-Version: 23
Port-Version: 24
Homepage: https://developer.gnome.org/glib/
Description: Portable, general-purpose utility library.
Build-Depends: zlib, pcre, libffi, gettext, libiconv
Build-Depends: zlib, pcre, libffi, gettext
Supports: !uwp

Feature: selinux
Expand Down
5 changes: 2 additions & 3 deletions ports/libcroco/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.11)
project(libcroco C)

find_package(Iconv REQUIRED)
find_package(Intl REQUIRED)

find_package(unofficial-glib CONFIG REQUIRED)
find_package(LibXml2 REQUIRED)
if(NOT WIN32)
Expand Down Expand Up @@ -76,7 +76,7 @@ target_link_libraries(croco-0.6 PRIVATE
unofficial::glib::glib
unofficial::glib::gmodule
unofficial::glib::gobject
${LIBXML2_LIBRARIES} ${Intl_LIBRARIES} Iconv::Iconv
${LIBXML2_LIBRARIES} ${Intl_LIBRARIES}
)

install(TARGETS croco-0.6
Expand Down Expand Up @@ -128,7 +128,6 @@ install(
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-libcroco-config.cmake "
include(CMakeFindDependencyMacro)
find_dependency(Intl)
find_dependency(Iconv)
find_dependency(unofficial-glib CONFIG)
find_dependency(LibXml2)
if(NOT WIN32)
Expand Down
2 changes: 1 addition & 1 deletion ports/libcroco/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: libcroco
Version: 0.6.13
Port-Version: 2
Port-Version: 3
Description: A standalone css2 parsing and manipulation library
Build-Depends: glib, libxml2