From 08b3a4340c03f8f9ef07e7d78cadce76ca696284 Mon Sep 17 00:00:00 2001 From: HrOokami <4591995+faserg1@users.noreply.github.com> Date: Mon, 7 Dec 2020 19:27:33 +0300 Subject: [PATCH] [ATK] Installing .pc files (#14972) --- ports/atk/{CMakeLists.txt => CMakeLists.txt.in} | 17 ++++++++++++++--- ports/atk/CONTROL | 1 + ports/atk/portfile.cmake | 14 +++++++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) rename ports/atk/{CMakeLists.txt => CMakeLists.txt.in} (87%) diff --git a/ports/atk/CMakeLists.txt b/ports/atk/CMakeLists.txt.in similarity index 87% rename from ports/atk/CMakeLists.txt rename to ports/atk/CMakeLists.txt.in index e26d8649e4..d8b8488236 100644 --- a/ports/atk/CMakeLists.txt +++ b/ports/atk/CMakeLists.txt.in @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.0) project(atk C) -set(ATK_LIB_SUFFIX 1.0) -set(ATK_DLL_SUFFIX 1) -set(GLIB_LIB_VERSION 2.0) +set(ATK_LIB_SUFFIX @ATK_LIB_SUFFIX@) +set(ATK_DLL_SUFFIX @ATK_DLL_SUFFIX@) +set(GLIB_LIB_VERSION @GLIB_LIB_VERSION@) if(BUILD_SHARED_LIBS) set(ATK_EXPORT_MACRO DLL_EXPORT) @@ -142,3 +142,14 @@ message(STATUS " " ${LIBINTL_LIBRARY}) foreach(GL ${GLIB_LIBRARIES}) message(STATUS " " ${GL}) endforeach() + +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(exec_prefix ${CMAKE_INSTALL_PREFIX}) +set(libdir ${CMAKE_INSTALL_PREFIX}/lib) +set(includedir ${CMAKE_INSTALL_PREFIX}/include) +set(ATK_API_VERSION @ATK_API_VERSION@) +set(VERSION @ATK_VERSION@) +set(GLIB_PACKAGES "glib-${GLIB_LIB_VERSION} gobject-${GLIB_LIB_VERSION} gmodule-${GLIB_LIB_VERSION}") + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/atk.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/atk.pc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/atk.pc" DESTINATION lib/pkgconfig) \ No newline at end of file diff --git a/ports/atk/CONTROL b/ports/atk/CONTROL index bcfc01d165..686e7fe6e5 100644 --- a/ports/atk/CONTROL +++ b/ports/atk/CONTROL @@ -1,5 +1,6 @@ Source: atk Version: 2.24.0-5 +Port-Version: 1 Homepage: https://developer.gnome.org/atk/ Description: GNOME Accessibility Toolkit Build-Depends: glib, gettext diff --git a/ports/atk/portfile.cmake b/ports/atk/portfile.cmake index a0d0128596..916b5095bc 100644 --- a/ports/atk/portfile.cmake +++ b/ports/atk/portfile.cmake @@ -15,7 +15,17 @@ vcpkg_extract_source_archive_ex( fix-linux-config.patch ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +# Here are used API version of library, not the version of library itself +set(ATK_LIB_SUFFIX 1.0) +set(ATK_DLL_SUFFIX 1) + +set(GLIB_LIB_VERSION 2.0) +if (WIN32) + set(ATK_API_VERSION ${ATK_LIB_SUFFIX}) +else() + set(ATK_API_VERSION ${ATK_DLL_SUFFIX}) +endif() +configure_file("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in" "${SOURCE_PATH}/CMakeLists.txt" @ONLY) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -30,4 +40,6 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() + file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)