From c5e1adb2435c01dcc2e821e39f98c97d8527acf4 Mon Sep 17 00:00:00 2001 From: JackBoosY <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 18 Sep 2019 02:34:55 +0800 Subject: [PATCH] [atk]Support UNIX. (#7991) * [atk]Support UNIX. * Update fix-encoding.patch --- ports/atk/CMakeLists.txt | 16 +++++++++++++--- ports/atk/CONTROL | 2 +- ports/atk/fix-encoding.patch | 12 ++++++------ ports/atk/fix-linux-config.patch | 22 ++++++++++++++++++++++ ports/atk/portfile.cmake | 11 ++++++++--- 5 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 ports/atk/fix-linux-config.patch diff --git a/ports/atk/CMakeLists.txt b/ports/atk/CMakeLists.txt index 41937fff94..e26d8649e4 100644 --- a/ports/atk/CMakeLists.txt +++ b/ports/atk/CMakeLists.txt @@ -28,7 +28,11 @@ execute_process( OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/atk/atkmarshal.c ) -configure_file(config.h.win32 ${CMAKE_CURRENT_BINARY_DIR}/config.h COPYONLY) +if (WIN32) + configure_file(config.h.win32 ${CMAKE_CURRENT_BINARY_DIR}/config.h COPYONLY) +else() + configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY) +endif() add_definitions(-DHAVE_CONFIG_H) include_directories(. ./atk ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/atk) @@ -38,8 +42,14 @@ 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}) -find_path(LIBINTL_INCLUDE_DIR libintl.h) -find_library(LIBINTL_LIBRARY NAMES libintl intl) +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() set(ATK_SOURCES atk/atkaction.c diff --git a/ports/atk/CONTROL b/ports/atk/CONTROL index 66890b039d..fe09017e74 100644 --- a/ports/atk/CONTROL +++ b/ports/atk/CONTROL @@ -1,5 +1,5 @@ Source: atk -Version: 2.24.0-3 +Version: 2.24.0-4 Homepage: https://developer.gnome.org/atk/ Description: GNOME Accessibility Toolkit Build-Depends: glib, gettext diff --git a/ports/atk/fix-encoding.patch b/ports/atk/fix-encoding.patch index 8bfb38bd0c..c92171a485 100644 --- a/ports/atk/fix-encoding.patch +++ b/ports/atk/fix-encoding.patch @@ -1,13 +1,13 @@ -diff --git a/atkversion.h b/atkversion.h -index 2634b0a..c57db2c 100644 ---- a/atkversion.h -+++ b/atkversion.h +diff --git a/atk/atkversion.h b/atk/atkversion.h +index 2634b0a..7bea2f3 100644 +--- a/atk/atkversion.h ++++ b/atk/atkversion.h @@ -3,7 +3,7 @@ * Copyright (C) 2012 Igalia, S.L. * Copyright (C) 2014 Chun-wei Fan * -- * Author: Alejandro Piñeiro Iglesias -+ * Author: Alejandro Piñeiro Iglesias +- * Author: Alejandro Pi?eiro Iglesias ++ * Author: Alejandro Pineiro Iglesias * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public diff --git a/ports/atk/fix-linux-config.patch b/ports/atk/fix-linux-config.patch new file mode 100644 index 0000000000..ec6a37a8b4 --- /dev/null +++ b/ports/atk/fix-linux-config.patch @@ -0,0 +1,22 @@ +diff --git a/config.h.in b/config.h.in +index b94d23f..a26dac8 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -5,7 +5,7 @@ + #undef ENABLE_NLS + + /* Define the gettext package to be used */ +-#undef GETTEXT_PACKAGE ++#cmakedefine GETTEXT_PACKAGE "@GETTEXT_PACKAGE@" + + /* Define to 1 if you have the `bind_textdomain_codeset' function. */ + #undef HAVE_BIND_TEXTDOMAIN_CODESET +@@ -86,7 +86,7 @@ + #undef STDC_HEADERS + + /* Version number of package */ +-#undef VERSION ++#cmakedefine VERSION @VERSION@ + + /* defines how to decorate public symbols while building */ + #undef _ATK_EXTERN diff --git a/ports/atk/portfile.cmake b/ports/atk/portfile.cmake index c3edfdf74b..60ace410d6 100644 --- a/ports/atk/portfile.cmake +++ b/ports/atk/portfile.cmake @@ -9,10 +9,13 @@ vcpkg_download_distfile(ARCHIVE FILENAME "atk-${ATK_VERSION}.tar.xz" SHA512 3ae0a4d5f28d5619d465135c685161f690732053bcb70a47669c951fbf389b5d2ccc5c7c73d4ee8c5a3b2df14e2f5b082e812a215f10a79b27b412d077f5e962) -vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH}/atk +vcpkg_extract_source_archive_ex( + ARCHIVE ${ARCHIVE} + OUT_SOURCE_PATH SOURCE_PATH PATCHES - ${CMAKE_CURRENT_LIST_DIR}/fix-encoding.patch) + fix-encoding.patch + fix-linux-config.patch +) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -21,6 +24,8 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DCMAKE_PROGRAM_PATH=${CURRENT_INSTALLED_DIR}/tools/glib + -DGETTEXT_PACKAGE=atk10 + -DVERSION=10 OPTIONS_DEBUG -DATK_SKIP_HEADERS=ON)