grim/guifications2

replace cmake with meson
draft
2021-04-07, Gary Kramlich
5a4e68fcaf32
Parents 4fa307ed7dcd
Children 680bed833e7e
replace cmake with meson
--- a/CMakeLists.txt Wed Apr 07 02:03:29 2021 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
-
-project(guifications2 C)
-
-
-set(GUIFICATIONS_MAJOR_VERSION 2)
-set(GUIFICATIONS_MINOR_VERSION 17)
-set(GUIFICATIONS_MICRO_VERSION 0)
-set(GUIFICATIONS_EXTRA_VERSION dev)
-
-set(GUIFICATIONS_VERSION ${GUIFICATIONS_MAJOR_VERSION}.${GUIFICATIONS_MINOR_VERSION}.${GUIFICATIONS_MICRO_VERSION}${GUIFICATIONS_EXTRA_VERSION})
-
-###############################################################################
-# Dependencies
-###############################################################################
-find_package(PkgConfig)
-
-pkg_check_modules(GLIB REQUIRED glib-2.0>=2.28.0)
-pkg_check_modules(GTK3 REQUIRED gtk+-3.0 gdk-3.0)
-pkg_check_modules(PURPLE REQUIRED purple-3)
-pkg_check_modules(PIDGIN REQUIRED pidgin-3)
-pkg_check_modules(CAIRO REQUIRED cairo)
-pkg_check_modules(PANGOFT2 REQUIRED pangoft2>=1.1.0)
-
-###############################################################################
-# Options
-###############################################################################
-option(
- INSTALL_TO_PIDGIN
- "Install to the pidgin directory"
- "Yes"
-)
-
-option(
- NLS
- "Install translation files"
- "Yes"
-)
-
-###############################################################################
-# Build Info
-###############################################################################
-if(INSTALL_TO_PIDGIN)
- execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=libdir pidgin
- OUTPUT_VARIABLE PIDGIN_LIBDIR)
- string(STRIP ${PIDGIN_LIBDIR} PIDGIN_LIBDIR)
- execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=datadir pidgin
- OUTPUT_VARIABLE PIDGIN_DATADIR)
- string(STRIP ${PIDGIN_DATADIR} PIDGIN_DATADIR)
-
- set(LOCALE_DIR ${PIDGIN_DATADIR}/locale)
-else(INSTALL_TO_PIDGIN)
- set(PIDGIN_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pidgin)
- set(PIDGIN_DATADIR ${CMAKE_INSTALL_PREFIX}/share/pidgin)
- set(LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/locale)
-endif(INSTALL_TO_PIDGIN)
-
-include_directories(
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_BINARY_DIR}
- ${GLIB_INCLUDE_DIRS}
- ${GTK3_INCLUDE_DIRS}
- ${PURPLE_INCLUDE_DIRS}
- ${PIDGIN_INCLUDE_DIRS}
- ${CAIRO_INCLUDE_DIRS}
- ${PANGOFT2_INCLUDE_DIRS}
-)
-
-link_directories(
- ${GLIB_LIBRARY_DIRS}
- ${GTK3_LIBRARY_DIRS}
- ${PURPLE_LIBRARY_DIRS}
- ${PIDGIN_LIBRARY_DIRS}
- ${CAIRO_LIBRARY_DIRS}
- ${PANGOFT2_LIBRARY_DIRS}
-)
-
-add_definitions(
- -g -g3 -Wall
-)
-
-###############################################################################
-# i18n
-###############################################################################
-set(GETTEXT_PACKAGE guifications)
-
-if(NLS)
- include(Gettextize)
-endif(NLS)
-
-###############################################################################
-# Subdirectories
-###############################################################################
-add_subdirectory(src)
-add_subdirectory(po)
-
--- a/VERSION Wed Apr 07 02:03:29 2021 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-2.17dev
--- a/VERSION.in Wed Apr 07 02:03:29 2021 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-@VERSION@
--- a/cmake/Gettextize.cmake Wed Apr 07 02:03:29 2021 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-include(CMakeParseArguments)
-
-###############################################################################
-# Dependencies
-###############################################################################
-find_program(XGETTEXT_EXECUTABLE xgettext)
-if(NOT XGETTEXT_EXECUTABLE)
- message(FATAL_ERROR "Failed to find xgettext")
-endif(NOT XGETTEXT_EXECUTABLE)
-
-find_program(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
-if(NOT GETTEXT_MSGFMT_EXECUTABLE)
- message(FATAL_ERROR "Failed to find msgfmt")
-endif(NOT GETTEXT_MSGFMT_EXECUTABLE)
-
-find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
-if(NOT GETTEXT_MSGMERGE_EXECUTABLE)
- message(FATAL_ERROR "Failed to find msgmerge")
-endif(NOT GETTEXT_MSGMERGE_EXECUTABLE)
-
-set(DEFAULT_XGETTEXT_OPTIONS
- --package-name=${PROJECT_NAME}
- --package-version=${VERSION}
-)
-
-if(NOT DEFINED LOCALE_DIR)
- set(LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/share/locale/)
- message(AUTHOR_WARNING "LOCALE_DIR is not set, using ${LOCALE_DIR}")
-endif(NOT DEFINED LOCALE_DIR)
-
-if(NOT DEFINED GETTEXT_PACKAGE)
- set(GETTEXT_PACKAGE ${PROJECT_NAME})
- message(AUTHOR_WARNING "GETTEXT_PACKAGE is not set, using ${GETTEXT_PACKAGE}")
-endif(NOT DEFINED GETTEXT_PACKAGE)
-
-###############################################################################
-# Functions
-###############################################################################
-function(GETTEXTIZE_POT_FILE _FIRST_ARG)
- set(options SORT NO_DEFAULT_KEYWORDS NO_ESCAPE NO_COMMENTS)
- set(oneValueArgs FILENAME LANGUAGES)
- set(multiValueArgs SOURCES BUILT_SOURCES KEYWORDS)
-
- cmake_parse_arguments(
- POT "${options}" "${oneValueArgs}" "${multiValueArgs}"
- ${_FIRST_ARG} ${ARGN}
- )
-
- if(POT_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keys given to pot_file(): "
- "\"${POT_UNPARSED_ARGUMENTS}\"")
- endif(POT_UNPARSED_ARGUMENTS)
-
- if(NOT POT_FILENAME)
- set(POT_FILENAME ${GETTEXT_PACKAGE}.pot)
- message(AUTHOR_WARNING "No filename specified, using ${POT_FILENAME}")
- endif(NOT POT_FILENAME)
-
- if(NOT POT_SOURCES)
- message(FATAL_ERROR "No sources specified")
- endif(NOT POT_SOURCES)
-
- if(NOT POT_NO_ESCAPE)
- set(POT_ESCAPE --escape)
- endif(NOT POT_NO_ESCAPE)
-
- if(POT_COMMENTS)
- set(POT_COMMENTS "--add-comments=${POT_COMMENTS}")
- endif(POT_COMMENTS)
-
- if(POT_SORT)
- set(POT_SORT -s)
- endif(POT_SORT)
-
- # handle keywords
- if(NOT POT_NO_DEFAULT_KEYWORDS)
- list(INSERT POT_KEYWORDS 0 _ N_ C_:1c,2 NC_:1c,2)
- endif(NOT POT_NO_DEFAULT_KEYWORDS)
-
- if(POT_KEYWORDS)
- set(_keywords)
-
- foreach(_kw ${POT_KEYWORDS})
- list(APPEND _keywords "--keyword=${_kw}")
- endforeach(_kw)
- set(POT_KEYWORDS ${_keywords})
- endif(POT_KEYWORDS)
-
- # handle languages
- if(POT_LANGUAGES)
- set(_languages)
-
- foreach(_lang in ${POT_LANGUAGES})
- list(APPEND _languages "--language=${_lang}")
- endforeach(_lang)
- set(POT_LANGUAGES ${_languages})
- endif(POT_LANGUAGES)
-
- # now tweak the sources
- set(POT_REAL_BUILT_SOURCES)
- if(POT_BUILT_SOURCES)
- foreach(_item ${POT_BUILT_SOURCES})
- get_source_file_property(_location ${_item} LOCATION)
- list(APPEND POT_REAL_BUILT_SOURCES "${_location}")
- endforeach(ITEM)
- endif(POT_BUILT_SOURCES)
-
- add_custom_command(
- OUTPUT ${POT_FILENAME}
- COMMAND ${XGETTEXT_EXECUTABLE}
- ${POT_SORT} ${POT_KEYWORDS} ${POT_LANGUAGES} ${POT_ESCAPE}
- ${POT_COMMENTS}
- -o ${CMAKE_CURRENT_BINARY_DIR}/${POT_FILENAME}
- ${POT_SOURCES} ${POT_REAL_BUILT_SOURCES}
- DEPENDS ${POT_SOURCES} ${POT_BUILT_SOURCES}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- VERBATIM
- )
-
- add_custom_target("${POT_FILENAME} potfile" ALL DEPENDS ${POT_FILENAME})
-endfunction(GETTEXTIZE_POT_FILE)
-
-function(GETTEXTIZE_TRANSLATIONS)
- set(options UPDATE)
- set(oneValueArgs)
- set(multiValueArgs)
-
- CMAKE_PARSE_ARGUMENTS(
- PO "${options}" "${oneValueArgs}" "${multiValueArgs}"
- ${ARGV1} ${ARGN}
- )
-
- if(PO_UNPARSED_ARGUMENTS)
- message(
- FATAL_ERROR "Unknown keys given to GETTEXTIZE_TRANSLATIONS(): "
- "\"${PO_UNPARSED_ARGUMENTS}\""
- )
- endif(PO_UNPARSED_ARGUMENTS)
-
- file(GLOB _pos *.po)
- set(_gmos)
-
- foreach(_po ${_pos})
- set(_update)
- if(PO_UPDATE)
- set(_update COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_po} ${_po})
- endif(PO_UPDATE)
-
- get_filename_component(_base ${_po} NAME_WE)
-
- set(_install_dir ${LOCALE_DIR}/${_base}/LC_MESSAGES/)
- set(_install_file ${GETTEXT_DOMAIN}.mo)
-
- set(_gmo ${_base}.gmo)
- list(APPEND _gmos ${_gmo})
-
- add_custom_command(
- OUTPUT ${_gmo}
- ${_update}
- COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmo} ${_po}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${_po}
- )
-
- install(
- FILES ${CMAKE_CURRENT_BINARY_DIR}/${_gmo}
- DESTINATION ${_install_dir}
- RENAME ${_install_file}
- )
- endforeach(_po)
-
- add_custom_target("translations" ALL DEPENDS ${_gmos})
-endfunction(GETTEXTIZE_TRANSLATIONS)
-
--- a/meson.build Wed Apr 07 02:03:29 2021 -0500
+++ b/meson.build Wed Apr 07 02:12:16 2021 -0500
@@ -77,8 +77,10 @@
###############################################################################
# Subdirectories
###############################################################################
+subdir('pixmaps')
+subdir('po')
subdir('src')
-subdir('po')
+subdir('themes')
###############################################################################
# Install stuff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pixmaps/meson.build Wed Apr 07 02:12:16 2021 -0500
@@ -0,0 +1,32 @@
+PIXMAPS = [
+ 'item_icon_size_big.png',
+ 'item_icon_size_huge.png',
+ 'item_icon_size_large.png',
+ 'item_icon_size_little.png',
+ 'item_icon_size_normal.png',
+ 'item_icon_size_small.png',
+ 'item_icon_size_tiny.png',
+ 'item_position_center.png',
+ 'item_position_east.png',
+ 'item_position_north_east.png',
+ 'item_position_north.png',
+ 'item_position_north_west.png',
+ 'item_position_south_east.png',
+ 'item_position_south.png',
+ 'item_position_south_west.png',
+ 'item_position_west.png',
+ 'item_text_clipping_ellipsis_end.png',
+ 'item_text_clipping_ellipsis_middle.png',
+ 'item_text_clipping_ellipsis_start.png',
+ 'item_text_clipping_truncate.png',
+ 'window_position_north_east.png',
+ 'window_position_north_west.png',
+ 'window_position_south_east.png',
+ 'window_position_south_west.png',
+]
+
+install_data(
+ PIXMAPS,
+ install_dir : get_option('datadir') / 'pixmaps/pidgin/guifications/conf/'
+)
+
--- a/po/CMakeLists.txt Wed Apr 07 02:03:29 2021 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-if(NLS)
- GETTEXTIZE_TRANSLATIONS(UPDATE)
-endif(NLS)
-
-
--- a/src/CMakeLists.txt Wed Apr 07 02:03:29 2021 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-set(HEADERS
- gf_action.h
- gf_blist.h
- gf_display.h
- gf_event.h
- gf_event_info.h
- gf_file.h
- gf_gtk_utils.h
- gf_internal.h
- gf_item.h
- gf_item_icon.h
- gf_item_image.h
- gf_item_offset.h
- gf_item_text.h
- gf_menu.h
- gf_notification.h
- gf_preferences.h
- gf_stock.h
- gf_theme.h
- gf_theme_editor.h
- gf_theme_info.h
- gf_theme_ops.h
- gf_utils.h
-)
-
-set(SOURCES
- gf_action.c
- gf_blist.c
- gf_display.c
- gf_event.c
- gf_event_info.c
- gf_file.c
- gf_gtk_utils.c
- gf_item.c
- gf_item_icon.c
- gf_item_image.c
- gf_item_offset.c
- gf_item_text.c
- gf_menu.c
- gf_notification.c
- gf_preferences.c
- gf_stock.c
- gf_theme.c
- gf_theme_editor.c
- gf_theme_info.c
- gf_theme_ops.c
- gf_utils.c
- guifications.c
-)
-
-if(WIN32)
- list(APPEND SOURCES gf_win32_display.c)
-else(WIN32)
- list(APPEND SOURCES gf_x11_display.c)
-endif(WIN32)
-
-add_library(guifications MODULE
- ${HEADERS}
- ${SOURCES}
-)
-set_target_properties(guifications PROPERTIES PREFIX "")
-
-add_definitions(
- -DGETTEXT_PACKAGE="guifications"
-)
-
-target_link_libraries(guifications
- ${GLIB_LIBRARIES}
- ${GTK3_LIBRARIES}
- ${PURPLE_LIBRARIES}
- ${PIDGIN_LIBRARIES}
- ${CAIRO_LIBRARIES}
- ${PANGOFT2_LIBRARIES}
-)
-
-gettextize_pot_file(
- SORT
- LANGUAGES C
- SOURCES ${SOURCES}
- FILENAME guifications.pot
-)
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/themes/meson.build Wed Apr 07 02:12:16 2021 -0500
@@ -0,0 +1,9 @@
+THEMES = ['default', 'hbons', 'mini', 'Penguins']
+
+foreach theme : THEMES
+ install_subdir(
+ theme,
+ install_dir : get_option('datadir') / 'pixmaps/pidgin/guifications/themes'
+ )
+endforeach
+