Merge pull request #602 from codicodi/add-atk

add atk
This commit is contained in:
Robert Schumacher 2017-01-30 20:00:10 -08:00 committed by GitHub
commit 846aacdfbf
3 changed files with 161 additions and 0 deletions

129
ports/atk/CMakeLists.txt Normal file
View File

@ -0,0 +1,129 @@
cmake_minimum_required(VERSION 3.0)
project(atk)
set(ATK_LIB_SUFFIX 1.0)
set(ATK_DLL_SUFFIX 1)
set(GLIB_LIB_VERSION 2.0)
if(BUILD_SHARED_LIBS)
set(ATK_EXPORT_MACRO DLL_EXPORT)
endif()
# generate atkmarshal.c and atkmarshal.h source files
# glib-genmarshal should be installed along with glib
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/atk/atkmarshal.h OR NOT EXISTS ${CMAKE_SOURCE_DIR}/atk/atkmarshal.c)
find_program(GLIB_GENMARSHAL glib-genmarshal PATH_SUFFIXES glib)
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal atkmarshal.list --header
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_SOURCE_DIR}/atk/atkmarshal.h)
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal atkmarshal.list --body
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_SOURCE_DIR}/atk/atkmarshal.c)
endif()
configure_file(config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY)
add_definitions(-DHAVE_CONFIG_H)
include_directories(. ./atk)
find_path(GLIB_INCLUDE_DIR glib.h)
find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION})
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)
set(ATK_SOURCES
atk/atkaction.c
atk/atkcomponent.c
atk/atkdocument.c
atk/atkeditabletext.c
atk/atkgobjectaccessible.c
atk/atkhyperlink.c
atk/atkhyperlinkimpl.c
atk/atkhypertext.c
atk/atkimage.c
atk/atknoopobject.c
atk/atknoopobjectfactory.c
atk/atkobject.c
atk/atkobjectfactory.c
atk/atkplug.c
atk/atkprivate.c
atk/atkrange.c
atk/atkregistry.c
atk/atkrelation.c
atk/atkrelationset.c
atk/atkselection.c
atk/atksocket.c
atk/atkstate.c
atk/atkstateset.c
atk/atkstreamablecontent.c
atk/atktable.c
atk/atktablecell.c
atk/atktext.c
atk/atkutil.c
atk/atkmisc.c
atk/atkvalue.c
atk/atkversion.c
atk/atkwindow.c
atk/atk-enum-types.c)
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})
set_target_properties(atk PROPERTIES
OUTPUT_NAME atk-${ATK_DLL_SUFFIX}
ARCHIVE_OUTPUT_NAME atk-${ATK_LIB_SUFFIX})
install(TARGETS atk RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
if(NOT ATK_SKIP_HEADERS)
install(FILES
atk/atk.h
atk/atkaction.h
atk/atkcomponent.h
atk/atkdocument.h
atk/atkeditabletext.h
atk/atkgobjectaccessible.h
atk/atkhyperlink.h
atk/atkhyperlinkimpl.h
atk/atkhypertext.h
atk/atknoopobject.h
atk/atknoopobjectfactory.h
atk/atkobject.h
atk/atkobjectfactory.h
atk/atkplug.h
atk/atkimage.h
atk/atkrange.h
atk/atkregistry.h
atk/atkrelation.h
atk/atkrelationtype.h
atk/atkrelationset.h
atk/atkselection.h
atk/atksocket.h
atk/atkstate.h
atk/atkstateset.h
atk/atkstreamablecontent.h
atk/atktable.h
atk/atktablecell.h
atk/atktext.h
atk/atkutil.h
atk/atkmisc.h
atk/atkvalue.h
atk/atkwindow.h
atk/atkversion.h
atk/atk-enum-types.h
atk/atkversion.h
DESTINATION include/atk)
endif()
message(STATUS "Link-time dependencies:")
message(STATUS " " ${LIBINTL_LIBRARY})
foreach(GL ${GLIB_LIBRARIES})
message(STATUS " " ${GL})
endforeach()

4
ports/atk/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: atk
Version: 2.22.0
Description: GNOME Accessibility Toolkit
Build-Depends: glib, gettext

28
ports/atk/portfile.cmake Normal file
View File

@ -0,0 +1,28 @@
# ATK uses DllMain
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
message(STATUS "Warning: Static building not supported. Building dynamic.")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif()
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/atk-2.22.0)
vcpkg_download_distfile(ARCHIVE
URLS "http://ftp.gnome.org/pub/GNOME/sources/atk/2.22/atk-2.22.0.tar.xz"
FILENAME "atk-2.22.0.tar.xz"
SHA512 af3f6197eb97de869ee706f19564449b02c1444c413e5418323e4bf4c8cf1d98c7c8baa25189f6879d63606d4bc75f33799cb901f4697c087e868bb9a5643cba
)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DCMAKE_PROGRAM_PATH=${CURRENT_INSTALLED_DIR}/tools/glib
OPTIONS_DEBUG
-DATK_SKIP_HEADERS=ON)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/atk)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/atk/COPYING ${CURRENT_PACKAGES_DIR}/share/atk/copyright)