Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[glib] Use meson build system. #11477

Closed
wants to merge 17 commits into from
22 changes: 8 additions & 14 deletions ports/atk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ endif()

# generate atkmarshal.c and atkmarshal.h source files
# glib-genmarshal should be installed along with glib
find_package (Python COMPONENTS Interpreter)
find_program(GLIB_GENMARSHAL glib-genmarshal PATH_SUFFIXES glib)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/atk)

message("Generating atkmarshal.h: ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --header")
message("Generating atkmarshal.h: ${Python_EXECUTABLE} ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --header")
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --header
COMMAND ${Python_EXECUTABLE} ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --header
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/atk/atkmarshal.h
)

message("Generating atkmarshal.c: ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --body")
message("Generating atkmarshal.c: ${Python_EXECUTABLE} ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --body")
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --body
COMMAND ${Python_EXECUTABLE} ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --body
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/atk/atkmarshal.c
)
Expand All @@ -36,11 +37,7 @@ endif()
add_definitions(-DHAVE_CONFIG_H)
include_directories(. ./atk ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/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_package(unofficial-glib REQUIRED)

if (WIN32 OR APPLE)
find_path(LIBINTL_INCLUDE_DIR libintl.h)
Expand Down Expand Up @@ -88,8 +85,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 ${LIBINTL_LIBRARY} unofficial::glib::glib unofficial::glib::gobject unofficial::glib::gmodule)
target_include_directories(atk PRIVATE ${LIBINTL_INCLUDE_DIR})

set_target_properties(atk PROPERTIES
OUTPUT_NAME atk-${ATK_DLL_SUFFIX}
Expand Down Expand Up @@ -139,6 +136,3 @@ endif()

message(STATUS "Link-time dependencies:")
message(STATUS " " ${LIBINTL_LIBRARY})
foreach(GL ${GLIB_LIBRARIES})
message(STATUS " " ${GL})
endforeach()
4 changes: 4 additions & 0 deletions ports/atk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ vcpkg_extract_source_archive_ex(
fix-linux-config.patch
)

vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON3_DIR}")

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_configure_cmake(
Expand Down
2 changes: 1 addition & 1 deletion ports/atkmm/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: atkmm
Version: 2.24.2-2
Version: 2.24.2-3
Homepage: https://www.gtkmm.org
Description: atkmm is the official C++ interface for the ATK accessibility toolkit library. It may be used, for instance, by user interfaces implemented with gtkmm.
Build-Depends: glib, gettext, atk, glibmm
2 changes: 1 addition & 1 deletion ports/atkmm/fix_properties.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ index 421f5c3..0275e6e 100644
<ItemDefinitionGroup>
<ClCompile>
- <AdditionalIncludeDirectories>.\atkmm;..\atk;$(GlibEtcInstallRoot)\include\glibmm-2.4;$(GlibEtcInstallRoot)\lib\glibmm-2.4\include;$(GlibEtcInstallRoot)\include\sigc++-2.0;$(GlibEtcInstallRoot)\lib\sigc++-2.0\include;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>.\atkmm;..\atk;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>.\atkmm;..\atk;.;$(CurrentInstalledDir)\include\glib-2.0;$(CurrentInstalledDir)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
Expand Down
6 changes: 4 additions & 2 deletions ports/atkmm/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

vcpkg_download_distfile(ARCHIVE
Expand All @@ -26,6 +24,10 @@ vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/MSVC_Net2013/atkmm.sln
TARGET atkmm
PLATFORM ${VS_PLATFORM}
OPTIONS
# Remark: This is a workaround for now. When updating atkmm to a newer version, meson should be used instead
# CurrentInstalledDir is used by fix_properties.patch for glib-2.0 include dirs
/p:CurrentInstalledDir=${CURRENT_INSTALLED_DIR}
USE_VCPKG_INTEGRATION
)

Expand Down
40 changes: 40 additions & 0 deletions ports/fluidsynth/fix-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Index: fluidsynth/CMakeLists.txt
===================================================================
--- fluidsynth.orig/CMakeLists.txt
+++ fluidsynth/CMakeLists.txt
@@ -446,21 +446,8 @@ if ( ASTYLE )
endif(ASTYLE)

if(NOT enable-pkgconfig)
-
- FIND_LIBRARY( GLIB_LIB NAMES glib glib-2.0 PATH GLIB_LIBRARY_DIR )
- FIND_LIBRARY( GTHREAD_LIB NAMES gthread gthread-2.0 PATH GTHREAD_LIBRARY_DIR )
- FIND_PATH( GLIBH_DIR glib.h PATH GLIB_INCLUDE_DIR )
- FIND_PATH( GLIBCONF_DIR glibconfig.h PATH GLIBCONF_INCLUDE_DIR )
-
- IF( GLIB_LIB MATCHES "GLIB_LIB-NOTFOUND" OR
- GTHREAD_LIB MATCHES "GTHREAD_LIB-NOTFOUND" OR
- GLIBH_DIR MATCHES "GLIBH_DIR-NOTFOUND" OR
- GLIBCONF_DIR MATCHES "GLIBCONF_DIR-NOTFOUND")
- message( WARNING "Not sure if I found GLIB, continuing anyway.")
- ENDIF()
-
- SET( GLIB_INCLUDE_DIRS ${GLIBH_DIR} ${GLIBCONF_DIR} )
- SET( GLIB_LIBRARIES ${GLIB_LIB} ${GTHREAD_LIB} )
+ find_package(unofficial-glib REQUIRED)
+ SET( GLIB_LIBRARIES unofficial::glib::glib unofficial::glib::gthread)

message( STATUS "GLIB_INCLUDE_DIRS: " ${GLIB_INCLUDE_DIRS} )
message( STATUS "GLIB_LIBRARIES: " ${GLIB_LIBRARIES} )
Index: fluidsynth/src/CMakeLists.txt
===================================================================
--- fluidsynth.orig/src/CMakeLists.txt
+++ fluidsynth/src/CMakeLists.txt
@@ -288,6 +288,7 @@ add_library ( libfluidsynth-OBJ OBJECT
${public_main_HEADER}
${VersionFilesOutputVariable}
)
+target_link_libraries(libfluidsynth-OBJ unofficial::glib::glib)

if ( LIBFLUID_CPPFLAGS )
set_target_properties ( libfluidsynth-OBJ
1 change: 1 addition & 0 deletions ports/fluidsynth/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
force-x86-gentables.patch
fix-cmakelists.patch
)

vcpkg_configure_cmake(
Expand Down
5 changes: 1 addition & 4 deletions ports/gdk-pixbuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)

find_package(unofficial-glib CONFIG REQUIRED)
find_path(GLIB_INCLUDE_DIR glib.h)

if(WIN32)
find_package(unofficial-gettext CONFIG REQUIRED)
Expand Down Expand Up @@ -62,7 +61,6 @@ endif()
add_library(gdk-pixbuf ${SOURCES})

target_include_directories(gdk-pixbuf PRIVATE
${GLIB_INCLUDE_DIR}
${PNG_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${LIBINTL_INCLUDE_DIR})
Expand Down Expand Up @@ -114,8 +112,7 @@ install(TARGETS gdk-pixbuf

macro(gdk_add_tool TOOL_NAME)
add_executable(${TOOL_NAME} ${ARGN})
target_include_directories(${TOOL_NAME} PRIVATE ${GLIB_INCLUDE_DIR})
target_link_libraries(${TOOL_NAME} gdk-pixbuf ${GLIB_LIBRARIES})
target_link_libraries(${TOOL_NAME} gdk-pixbuf unofficial::glib::glib unofficial::glib::gthread unofficial::glib::gio unofficial::glib::gmodule unofficial::glib::gobject)
install(TARGETS ${TOOL_NAME} RUNTIME DESTINATION tools/gdk-pixbuf)
endmacro()

Expand Down
Loading