diff --git a/.gitignore b/.gitignore index 6b69c8a..61fc2db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ +/results_* +/*.src.rpm + /granite-0.4.0.1.tar.xz /granite-0.4.1.tar.gz /granite-0.5.tar.gz /granite-5.0.tar.gz /granite-5.1.0.tar.gz +/granite-5.2.2.tar.gz diff --git a/00-meson-port.patch b/00-meson-port.patch new file mode 100644 index 0000000..567486a --- /dev/null +++ b/00-meson-port.patch @@ -0,0 +1,2660 @@ +From 2066b377226cf327cb2d5399b6b40a2d36d47b11 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Mon, 17 Dec 2018 15:53:10 +0100 +Subject: [PATCH] Switch from CMake to Meson build system (#240) + +--- + .travis.yml | 4 +- + CMakeLists.txt | 73 ------- + README.md | 47 ++-- + cmake/COPYING-CMAKE-SCRIPTS | 22 -- + cmake/FindGObjectIntrospection.cmake | 61 ------ + cmake/FindVala.cmake | 65 ------ + cmake/GObjectIntrospectionMacros.cmake | 22 -- + cmake/GSettings.cmake | 42 ---- + cmake/Makefile | 286 ------------------------- + cmake/ParseArguments.cmake | 36 ---- + cmake/README | 10 - + cmake/README.Vala.rst | 173 --------------- + cmake/Translations.cmake | 225 ------------------- + cmake/ValaPrecompile.cmake | 213 ------------------ + cmake/ValaVersion.cmake | 96 --------- + demo/CMakeLists.txt | 45 ---- + demo/meson.build | 40 ++++ + doc/CMakeLists.txt | 52 ----- + doc/meson.build | 58 +++++ + icons/CMakeLists.txt | 8 - + icons/meson.build | 33 +++ + lib/CMakeLists.txt | 131 ----------- + lib/Widgets/AboutDialog.vala | 2 +- + lib/Widgets/AlertView.vala | 2 +- + lib/Widgets/CellRendererBadge.vala | 2 +- + lib/Widgets/DynamicNotebook.vala | 2 +- + lib/Widgets/MessageDialog.vala | 2 +- + lib/Widgets/ModeButton.vala | 2 +- + lib/Widgets/OverlayBar.vala | 7 +- + lib/Widgets/SeekBar.vala | 2 +- + lib/Widgets/StorageBar.vala | 2 +- + lib/Widgets/Toast.vala | 2 +- + lib/Widgets/Welcome.vala | 2 +- + lib/config.h.cmake | 7 - + lib/config.vapi | 4 - + lib/granite.pc.cmake | 12 -- + lib/meson.build | 130 +++++++++++ + meson.build | 72 +++++++ + meson/post_install.py | 16 ++ + meson_options.txt | 1 + + po/CMakeLists.txt | 3 - + po/LINGUAS | 196 +++++++++++++++++ + po/meson.build | 6 + + 43 files changed, 593 insertions(+), 1623 deletions(-) + delete mode 100644 CMakeLists.txt + delete mode 100644 cmake/COPYING-CMAKE-SCRIPTS + delete mode 100644 cmake/FindGObjectIntrospection.cmake + delete mode 100644 cmake/FindVala.cmake + delete mode 100644 cmake/GObjectIntrospectionMacros.cmake + delete mode 100644 cmake/GSettings.cmake + delete mode 100644 cmake/Makefile + delete mode 100644 cmake/ParseArguments.cmake + delete mode 100644 cmake/README + delete mode 100644 cmake/README.Vala.rst + delete mode 100644 cmake/Translations.cmake + delete mode 100644 cmake/ValaPrecompile.cmake + delete mode 100644 cmake/ValaVersion.cmake + delete mode 100644 demo/CMakeLists.txt + create mode 100644 demo/meson.build + delete mode 100644 doc/CMakeLists.txt + create mode 100644 doc/meson.build + delete mode 100644 icons/CMakeLists.txt + create mode 100644 icons/meson.build + delete mode 100644 lib/CMakeLists.txt + delete mode 100644 lib/config.h.cmake + delete mode 100644 lib/config.vapi + delete mode 100644 lib/granite.pc.cmake + create mode 100644 lib/meson.build + create mode 100644 meson.build + create mode 100755 meson/post_install.py + create mode 100644 meson_options.txt + delete mode 100644 po/CMakeLists.txt + create mode 100644 po/LINGUAS + create mode 100644 po/meson.build + +diff --git a/.travis.yml b/.travis.yml +index c74e1269..ee2fb22e 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -4,11 +4,11 @@ services: + - docker + + env: +- - DEPENDENCY_PACKAGES="cmake gobject-introspection libgee-0.8-dev libgirepository1.0-dev libgtk-3-dev valac" ++ - DEPENDENCY_PACKAGES="meson gobject-introspection libgee-0.8-dev libgirepository1.0-dev libgtk-3-dev valac" + + install: + - docker pull elementary/docker:juno-unstable +- - docker run -v "$PWD":/tmp/build-dir elementary/docker:juno-unstable /bin/sh -c "apt-get update && apt-get -y install $DEPENDENCY_PACKAGES && cd /tmp/build-dir && cmake . && env CTEST_OUTPUT_ON_FAILURE=true make" ++ - docker run -v "$PWD":/tmp/build-dir elementary/docker:juno-unstable /bin/sh -c "apt-get update && apt-get -y install $DEPENDENCY_PACKAGES && cd /tmp/build-dir && meson build && cd build && ninja" + + script: + - echo BUILDS PASSED +diff --git a/CMakeLists.txt b/CMakeLists.txt +deleted file mode 100644 +index 9a6d8e3f..00000000 +--- a/CMakeLists.txt ++++ /dev/null +@@ -1,73 +0,0 @@ +-# Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation +- +-cmake_minimum_required (VERSION 2.8) +-cmake_policy (VERSION 2.8) +-project (granite C) +- +-set (PKG_NAME ${CMAKE_PROJECT_NAME}) +-set (PKG_VERSION 5.2.2) +-set (API_VERSION 1.0) +- +-# Used to create GObject introspection files +-set (PKG_GIR_NAME Granite-${API_VERSION}) +- +-list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) +- +-set (RESOURCES_DIR ${CMAKE_INSTALL_PREFIX}/share/${PKG_NAME}/) +-set (GETTEXT_PACKAGE ${PKG_NAME}) +- +-find_package (Vala REQUIRED) +-include (ValaVersion) +-include (ValaPrecompile) +- +-ensure_vala_version ("0.40" MINIMUM) +- +-# +-# Packages in PKG_DEPS are used with the vala compiler and other related tools (not versioned.) +-# Packages in PKG_DEPS_CHECK are used with PKG-Config and for linking, etc. They can contain versions. +-# +-# Both should contain *the same packages*, except for those whose VAPI file has a different name. In +-# such case, PKG_DEPS would use the name of the VAPI, and PKG_DEPS_CHECK would use the name of the +-# package known by pkg-config. +-# +-set (PKG_DEPS +- gtk+-3.0 +- gio-unix-2.0 +- posix +- gee-0.8) +- +-set (PKG_DEPS_CHECK +- gtk+-3.0>=3.22 +- gio-unix-2.0 +- gthread-2.0 +- gee-0.8) +- +-# GI dependencies +-set (GI_PKG_DEPS Gtk-3.0 Gee-0.8) +- +-# Check for the deps +-find_package (PkgConfig) +-pkg_check_modules (DEPS REQUIRED ${PKG_DEPS_CHECK}) +- +-set (VALAC_OPTIONS +- --abi-stability +- --hide-internal +- --target-glib=2.50) +- +-if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +- set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=LINUX) +-elseif (${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") +- set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=DRAGON_FLY) +-elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") +- set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=FFREE_BSD) +-elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") +- set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=NET_BSD) +-elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") +- set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=OPEN_BSD) +-endif () +- +-add_subdirectory (lib) +-add_subdirectory (demo) +-add_subdirectory (doc) +-add_subdirectory (po) +-add_subdirectory (icons) +diff --git a/README.md b/README.md +index 0647dba8..c5008610 100644 +--- a/README.md ++++ b/README.md +@@ -1,49 +1,52 @@ + # Granite +-Granite is a companion library for GTK+ and GLib. Among other things, it provides complex widgets and convenience functions designed for use in apps built for elementary OS. ++Granite is a companion library for GTK+ and GLib. Among other things, it ++provides complex widgets and convenience functions designed for use in apps ++built for elementary OS. + + [![Packaging status](https://repology.org/badge/tiny-repos/granite.svg)](https://repology.org/metapackage/granite) + [![Translation status](https://l10n.elementary.io/widgets/desktop/granite/svg-badge.svg)](https://l10n.elementary.io/projects/desktop/granite/?utm_source=widget) + ++ + ## Building, Testing, and Installation + + You'll need the following dependencies: +-* cmake ++* meson + * gobject-introspection + * libgee-0.8-dev + * libgirepository1.0-dev + * libgtk-3-dev + * valac + +-It's recommended to create a clean build environment ++Run `meson build` to configure the build environment: + +- mkdir build +- cd build/ +- +-Run `cmake` to configure the build environment and then `make all test` to build ++ meson build --prefix=/usr + +- cmake -DCMAKE_INSTALL_PREFIX=/usr .. +- make +- +-To install, use `make install` ++This command creates a `build` directory. For all following commands, change to ++the build directory before running them. + +- sudo make install ++To build granite, use `ninja`: + +-To see a demo app of Granite's widgets, use 'granite-demo' ++ ninja + +- granite-demo ++To install, use `ninja install` + +-## Documentation ++ ninja install + +-Documentation for all of the classes and functions in Granite is available [on Valadoc](https://valadoc.org/granite/Granite.html) ++To see a demo app of Granite's widgets, run `granite-demo` after installing it: + +-To generate Vala documentation from this repository, use `make valadocs` ++ granite-demo ++ ++ ++## Documentation + +- make valadocs ++Documentation for all of the classes and functions in Granite is available ++[on Valadoc](https://valadoc.org/granite/Granite.html) + +-To generate C documentation from this repository, use `make cdocs` ++The additional requirements for building the documentation are: + +- make cdocs ++* valadoc ++* gtk-doc + +-To generate both C and Vala documentation at once, use `make docs` ++To generate gtk-doc and valadoc documentation for this project, pass the ++additional `-Ddocumentation=true` flag to meson, and run `ninja` as before. + +- make docs +diff --git a/cmake/COPYING-CMAKE-SCRIPTS b/cmake/COPYING-CMAKE-SCRIPTS +deleted file mode 100644 +index 4b417765..00000000 +--- a/cmake/COPYING-CMAKE-SCRIPTS ++++ /dev/null +@@ -1,22 +0,0 @@ +-Redistribution and use in source and binary forms, with or without +-modification, are permitted provided that the following conditions +-are met: +- +-1. Redistributions of source code must retain the copyright +- notice, this list of conditions and the following disclaimer. +-2. Redistributions in binary form must reproduce the copyright +- notice, this list of conditions and the following disclaimer in the +- documentation and/or other materials provided with the distribution. +-3. The name of the author may not be used to endorse or promote products +- derived from this software without specific prior written permission. +- +-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +diff --git a/cmake/FindGObjectIntrospection.cmake b/cmake/FindGObjectIntrospection.cmake +deleted file mode 100644 +index 2073c3cb..00000000 +--- a/cmake/FindGObjectIntrospection.cmake ++++ /dev/null +@@ -1,61 +0,0 @@ +-# - try to find gobject-introspection +-# +-# Once done this will define +-# +-# INTROSPECTION_FOUND - system has gobject-introspection +-# INTROSPECTION_SCANNER - the gobject-introspection scanner, g-ir-scanner +-# INTROSPECTION_COMPILER - the gobject-introspection compiler, g-ir-compiler +-# INTROSPECTION_GENERATE - the gobject-introspection generate, g-ir-generate +-# INTROSPECTION_GIRDIR +-# INTROSPECTION_TYPELIBDIR +-# INTROSPECTION_CFLAGS +-# INTROSPECTION_LIBS +-# +-# Copyright (C) 2010, Pino Toscano, +-# +-# Redistribution and use is allowed according to the terms of the BSD license. +-# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +- +-macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname) +- execute_process( +- COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0 +- OUTPUT_VARIABLE _result +- RESULT_VARIABLE _null +- ) +- +- if (_null) +- else() +- string(REGEX REPLACE "[\r\n]" " " _result "${_result}") +- string(REGEX REPLACE " +$" "" _result "${_result}") +- separate_arguments(_result) +- set(${_outvar} ${_result} CACHE INTERNAL "") +- endif() +-endmacro(_GIR_GET_PKGCONFIG_VAR) +- +-find_package(PkgConfig) +-if(PKG_CONFIG_FOUND) +- if(PACKAGE_FIND_VERSION_COUNT GREATER 0) +- set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}") +- endif() +- pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp}) +- if(_pc_gir_FOUND) +- set(INTROSPECTION_FOUND TRUE) +- _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner") +- _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler") +- _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate") +- _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir") +- _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir") +- set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}") +- set(INTROSPECTION_LIBS "${_pc_gir_LIBS}") +- endif() +-endif() +- +-mark_as_advanced( +- INTROSPECTION_SCANNER +- INTROSPECTION_COMPILER +- INTROSPECTION_GENERATE +- INTROSPECTION_GIRDIR +- INTROSPECTION_TYPELIBDIR +- INTROSPECTION_CFLAGS +- INTROSPECTION_LIBS +-) +diff --git a/cmake/FindVala.cmake b/cmake/FindVala.cmake +deleted file mode 100644 +index aa3a6e7d..00000000 +--- a/cmake/FindVala.cmake ++++ /dev/null +@@ -1,65 +0,0 @@ +-## +-# Copyright 2009-2010 Jakob Westhoff. All rights reserved. +-# +-# Redistribution and use in source and binary forms, with or without +-# modification, are permitted provided that the following conditions are met: +-# +-# 1. Redistributions of source code must retain the above copyright notice, +-# this list of conditions and the following disclaimer. +-# +-# 2. Redistributions in binary form must reproduce the above copyright notice, +-# this list of conditions and the following disclaimer in the documentation +-# and/or other materials provided with the distribution. +-# +-# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR +-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +-# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-# +-# The views and conclusions contained in the software and documentation are those +-# of the authors and should not be interpreted as representing official policies, +-# either expressed or implied, of Jakob Westhoff +-## +- +-## +-# Find module for the Vala compiler (valac) +-# +-# This module determines wheter a Vala compiler is installed on the current +-# system and where its executable is. +-# +-# Call the module using "find_package(Vala) from within your CMakeLists.txt. +-# +-# The following variables will be set after an invocation: +-# +-# VALA_FOUND Whether the vala compiler has been found or not +-# VALA_EXECUTABLE Full path to the valac executable if it has been found +-# VALA_VERSION Version number of the available valac +-## +- +- +-# Search for the valac executable in the usual system paths. +-find_program(VALA_EXECUTABLE +- NAMES valac) +- +-# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call. +-# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka. +-# VALA_EXECUTABLE is set) +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE) +- +-mark_as_advanced(VALA_EXECUTABLE) +- +-# Determine the valac version +-if(VALA_FOUND) +- execute_process(COMMAND ${VALA_EXECUTABLE} "--version" +- OUTPUT_VARIABLE "VALA_VERSION") +- string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION}) +- string(STRIP ${VALA_VERSION} "VALA_VERSION") +-endif(VALA_FOUND) +diff --git a/cmake/GObjectIntrospectionMacros.cmake b/cmake/GObjectIntrospectionMacros.cmake +deleted file mode 100644 +index c3d9df47..00000000 +--- a/cmake/GObjectIntrospectionMacros.cmake ++++ /dev/null +@@ -1,22 +0,0 @@ +-macro(add_target_gir TARGET_NAME GIR_NAME HEADER C_FILES CFLAGS PKG_VERSION) +- set(PACKAGES "") +- foreach(PKG ${ARGN}) +- set(PACKAGES ${PACKAGES} --include=${PKG}) +- endforeach() +- +- set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\") +- +- set(PKG_GIR_NAME ${GIR_NAME}-${PKG_VERSION}) +- +- add_custom_command(TARGET ${TARGET_NAME} COMMAND ${INTROSPECTION_SCANNER} ${CFLAGS} -n ${GIR_NAME} +- --library ${PKG_NAME} ${PACKAGES} +- --warn-all +- -o ${CMAKE_CURRENT_BINARY_DIR}/${PKG_GIR_NAME}.gir +- -L${CMAKE_CURRENT_BINARY_DIR} +- --nsversion=${PKG_VERSION} ${CMAKE_CURRENT_BINARY_DIR}/${HEADER} ${C_FILES}) +- +- add_custom_command(TARGET ${TARGET_NAME} COMMAND ${INTROSPECTION_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/${PKG_GIR_NAME}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${PKG_GIR_NAME}.typelib) +- +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_GIR_NAME}.gir DESTINATION ${INTROSPECTION_GIRDIR}) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_GIR_NAME}.typelib DESTINATION ${INTROSPECTION_TYPELIBDIR}) +-endmacro() +diff --git a/cmake/GSettings.cmake b/cmake/GSettings.cmake +deleted file mode 100644 +index 8fd745c3..00000000 +--- a/cmake/GSettings.cmake ++++ /dev/null +@@ -1,42 +0,0 @@ +-# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them. +- +-option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON) +- +-option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL}) +- +-if(GSETTINGS_LOCALINSTALL) +- message(STATUS "GSettings schemas will be installed locally.") +-endif() +- +-if(GSETTINGS_COMPILE) +- message(STATUS "GSettings shemas will be compiled.") +-endif() +- +-macro(add_schema SCHEMA_NAME) +- +- set(PKG_CONFIG_EXECUTABLE pkg-config) +- # Have an option to not install the schema into where GLib is +- if (GSETTINGS_LOCALINSTALL) +- SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/") +- else (GSETTINGS_LOCALINSTALL) +- execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE) +- SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/") +- endif (GSETTINGS_LOCALINSTALL) +- +- # Run the validator and error if it fails +- execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE) +- execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE) +- +- if (_schemas_invalid) +- message (SEND_ERROR "Schema validation error: ${_schemas_invalid}") +- endif (_schemas_invalid) +- +- # Actually install and recomple schemas +- message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}") +- install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL) +- +- if (GSETTINGS_COMPILE) +- install (CODE "message (STATUS \"Compiling GSettings schemas\")") +- install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})") +- endif () +-endmacro() +diff --git a/cmake/Makefile b/cmake/Makefile +deleted file mode 100644 +index aee34c92..00000000 +--- a/cmake/Makefile ++++ /dev/null +@@ -1,286 +0,0 @@ +-# CMAKE generated file: DO NOT EDIT! +-# Generated by "Unix Makefiles" Generator, CMake Version 2.8 +- +-# Default target executed when no arguments are given to make. +-default_target: all +-.PHONY : default_target +- +-#============================================================================= +-# Special targets provided by cmake. +- +-# Disable implicit rules so canoncical targets will work. +-.SUFFIXES: +- +-# Remove some rules from gmake that .SUFFIXES does not remove. +-SUFFIXES = +- +-.SUFFIXES: .hpux_make_needs_suffix_list +- +-# Suppress display of executed commands. +-$(VERBOSE).SILENT: +- +-# A target that is always out of date. +-cmake_force: +-.PHONY : cmake_force +- +-#============================================================================= +-# Set environment variables for the build. +- +-# The shell in which to execute make rules. +-SHELL = /bin/sh +- +-# The CMake executable. +-CMAKE_COMMAND = /usr/bin/cmake +- +-# The command to remove a file. +-RM = /usr/bin/cmake -E remove -f +- +-# The top-level source directory on which CMake was run. +-CMAKE_SOURCE_DIR = /home/mefrio/Scrivania/cmake +- +-# The top-level build directory on which CMake was run. +-CMAKE_BINARY_DIR = /home/mefrio/Scrivania/cmake/cmake +- +-#============================================================================= +-# Targets provided globally by CMake. +- +-# Special rule for the target edit_cache +-edit_cache: +- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..." +- /usr/bin/cmake -i . +-.PHONY : edit_cache +- +-# Special rule for the target edit_cache +-edit_cache/fast: edit_cache +-.PHONY : edit_cache/fast +- +-# Special rule for the target install +-install: preinstall +- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." +- /usr/bin/cmake -P cmake_install.cmake +-.PHONY : install +- +-# Special rule for the target install +-install/fast: preinstall/fast +- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." +- /usr/bin/cmake -P cmake_install.cmake +-.PHONY : install/fast +- +-# Special rule for the target install/local +-install/local: preinstall +- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." +- /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +-.PHONY : install/local +- +-# Special rule for the target install/local +-install/local/fast: install/local +-.PHONY : install/local/fast +- +-# Special rule for the target install/strip +-install/strip: preinstall +- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." +- /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +-.PHONY : install/strip +- +-# Special rule for the target install/strip +-install/strip/fast: install/strip +-.PHONY : install/strip/fast +- +-# Special rule for the target list_install_components +-list_install_components: +- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +-.PHONY : list_install_components +- +-# Special rule for the target list_install_components +-list_install_components/fast: list_install_components +-.PHONY : list_install_components/fast +- +-# Special rule for the target rebuild_cache +-rebuild_cache: +- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." +- /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +-.PHONY : rebuild_cache +- +-# Special rule for the target rebuild_cache +-rebuild_cache/fast: rebuild_cache +-.PHONY : rebuild_cache/fast +- +-# The main all target +-all: cmake_check_build_system +- $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles /home/mefrio/Scrivania/cmake/cmake/CMakeFiles/progress.marks +- $(MAKE) -f CMakeFiles/Makefile2 all +- $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles 0 +-.PHONY : all +- +-# The main clean target +-clean: +- $(MAKE) -f CMakeFiles/Makefile2 clean +-.PHONY : clean +- +-# The main clean target +-clean/fast: clean +-.PHONY : clean/fast +- +-# Prepare targets for installation. +-preinstall: all +- $(MAKE) -f CMakeFiles/Makefile2 preinstall +-.PHONY : preinstall +- +-# Prepare targets for installation. +-preinstall/fast: +- $(MAKE) -f CMakeFiles/Makefile2 preinstall +-.PHONY : preinstall/fast +- +-# clear depends +-depend: +- $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +-.PHONY : depend +- +-#============================================================================= +-# Target rules for targets named scratch +- +-# Build rule for target. +-scratch: cmake_check_build_system +- $(MAKE) -f CMakeFiles/Makefile2 scratch +-.PHONY : scratch +- +-# fast build rule for target. +-scratch/fast: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/build +-.PHONY : scratch/fast +- +-src/entry.o: src/entry.c.o +-.PHONY : src/entry.o +- +-# target to build an object file +-src/entry.c.o: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.o +-.PHONY : src/entry.c.o +- +-src/entry.i: src/entry.c.i +-.PHONY : src/entry.i +- +-# target to preprocess a source file +-src/entry.c.i: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.i +-.PHONY : src/entry.c.i +- +-src/entry.s: src/entry.c.s +-.PHONY : src/entry.s +- +-# target to generate assembly for a file +-src/entry.c.s: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.s +-.PHONY : src/entry.c.s +- +-src/main_window.o: src/main_window.c.o +-.PHONY : src/main_window.o +- +-# target to build an object file +-src/main_window.c.o: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.o +-.PHONY : src/main_window.c.o +- +-src/main_window.i: src/main_window.c.i +-.PHONY : src/main_window.i +- +-# target to preprocess a source file +-src/main_window.c.i: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.i +-.PHONY : src/main_window.c.i +- +-src/main_window.s: src/main_window.c.s +-.PHONY : src/main_window.s +- +-# target to generate assembly for a file +-src/main_window.c.s: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.s +-.PHONY : src/main_window.c.s +- +-src/menu.o: src/menu.c.o +-.PHONY : src/menu.o +- +-# target to build an object file +-src/menu.c.o: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.o +-.PHONY : src/menu.c.o +- +-src/menu.i: src/menu.c.i +-.PHONY : src/menu.i +- +-# target to preprocess a source file +-src/menu.c.i: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.i +-.PHONY : src/menu.c.i +- +-src/menu.s: src/menu.c.s +-.PHONY : src/menu.s +- +-# target to generate assembly for a file +-src/menu.c.s: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.s +-.PHONY : src/menu.c.s +- +-src/notebook.o: src/notebook.c.o +-.PHONY : src/notebook.o +- +-# target to build an object file +-src/notebook.c.o: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.o +-.PHONY : src/notebook.c.o +- +-src/notebook.i: src/notebook.c.i +-.PHONY : src/notebook.i +- +-# target to preprocess a source file +-src/notebook.c.i: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.i +-.PHONY : src/notebook.c.i +- +-src/notebook.s: src/notebook.c.s +-.PHONY : src/notebook.s +- +-# target to generate assembly for a file +-src/notebook.c.s: +- $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.s +-.PHONY : src/notebook.c.s +- +-# Help Target +-help: +- @echo "The following are some of the valid targets for this Makefile:" +- @echo "... all (the default if no target is provided)" +- @echo "... clean" +- @echo "... depend" +- @echo "... edit_cache" +- @echo "... install" +- @echo "... install/local" +- @echo "... install/strip" +- @echo "... list_install_components" +- @echo "... rebuild_cache" +- @echo "... scratch" +- @echo "... src/entry.o" +- @echo "... src/entry.i" +- @echo "... src/entry.s" +- @echo "... src/main_window.o" +- @echo "... src/main_window.i" +- @echo "... src/main_window.s" +- @echo "... src/menu.o" +- @echo "... src/menu.i" +- @echo "... src/menu.s" +- @echo "... src/notebook.o" +- @echo "... src/notebook.i" +- @echo "... src/notebook.s" +-.PHONY : help +- +- +- +-#============================================================================= +-# Special targets to cleanup operation of make. +- +-# Special rule to run CMake to check the build system integrity. +-# No rule that depends on this can have commands that come from listfiles +-# because they might be regenerated. +-cmake_check_build_system: +- $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +-.PHONY : cmake_check_build_system +- +diff --git a/cmake/ParseArguments.cmake b/cmake/ParseArguments.cmake +deleted file mode 100644 +index 717c0f56..00000000 +--- a/cmake/ParseArguments.cmake ++++ /dev/null +@@ -1,36 +0,0 @@ +-## +-# This is a helper Macro to parse optional arguments in Macros/Functions +-# It has been taken from the public CMake wiki. +-# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and +-# licensing. +-## +-macro(parse_arguments prefix arg_names option_names) +- set(DEFAULT_ARGS) +- foreach(arg_name ${arg_names}) +- set(${prefix}_${arg_name}) +- endforeach(arg_name) +- foreach(option ${option_names}) +- set(${prefix}_${option} FALSE) +- endforeach(option) +- +- set(current_arg_name DEFAULT_ARGS) +- set(current_arg_list) +- foreach(arg ${ARGN}) +- set(larg_names ${arg_names}) +- list(FIND larg_names "${arg}" is_arg_name) +- if(is_arg_name GREATER -1) +- set(${prefix}_${current_arg_name} ${current_arg_list}) +- set(current_arg_name ${arg}) +- set(current_arg_list) +- else(is_arg_name GREATER -1) +- set(loption_names ${option_names}) +- list(FIND loption_names "${arg}" is_option) +- if(is_option GREATER -1) +- set(${prefix}_${arg} TRUE) +- else(is_option GREATER -1) +- set(current_arg_list ${current_arg_list} ${arg}) +- endif(is_option GREATER -1) +- endif(is_arg_name GREATER -1) +- endforeach(arg) +- set(${prefix}_${current_arg_name} ${current_arg_list}) +-endmacro(parse_arguments) +diff --git a/cmake/README b/cmake/README +deleted file mode 100644 +index 9d45b32f..00000000 +--- a/cmake/README ++++ /dev/null +@@ -1,10 +0,0 @@ +- Elementary CMake modules +- +-This is a set of CMake modules: Translations, GSettings, and Vala modules. +- +-For all the Vala related modules see README.Vala.rst: +- - ParseArguments.cmake +- - ValaPrecompile.cmake +- - ValaVersion.cmake +- - FindVala.cmake +- +diff --git a/cmake/README.Vala.rst b/cmake/README.Vala.rst +deleted file mode 100644 +index bcc59b76..00000000 +--- a/cmake/README.Vala.rst ++++ /dev/null +@@ -1,173 +0,0 @@ +-========== +-Vala CMake +-========== +-:Author: +- Jakob Westhoff +-:Version: +- Draft +- +- +-Overview +-======== +- +-Vala CMake is a collection of macros for the CMake_ build system to allow the +-creation and management of projects developed using the Vala_ programming +-language or its "Genie" flavor (less tested). +- +- +-Installation +-============ +- +-To use the Vala macros in your own project you need to copy the macro files to +-an arbitrary folder in your projects directory and reference them in your +-``CMakeLists.txt`` file. +- +-Assuming the macros are stored under ``cmake/vala`` in your projects folder you +-need to add the following information to your base ``CMakeLists.txt``:: +- +- list(APPEND CMAKE_MODULE_PATH +- ${CMAKE_SOURCE_DIR}/cmake/vala +- ) +- +-After the new module path as been added you can simply include the provided +-modules or use the provided find routines. +- +- +-Finding Vala +-============ +- +-The find module for vala works like any other Find module in CMake. +-You can use it by simply calling the usual ``find_package`` function. Default +-parameters like ``REQUIRED`` and ``QUIETLY`` are supported. +- +-:: +- +- find_package(Vala REQUIRED) +- +-After a successful call to the find_package function the following variables +-will be set: +- +-VALA_FOUND +- Whether the vala compiler has been found or not +- +-VALA_EXECUTABLE +- Full path to the valac executable if it has been found +- +-VALA_VERSION +- Version number of the available valac +- +- +-Precompiling Vala sources +-========================= +- +-CMake is mainly supposed to handle c or c++ based projects. Luckily every vala +-program is translated into plain c code using the vala compiler, followed by +-normal compilation of the generated c program using gcc. +- +-The macro ``vala_precompile`` uses that fact to create c files from your .vala +-sources for further CMake processing. +- +-The first parameter provided is a variable, which will be filled with a list of +-c files outputted by the vala compiler. This list can than be used in +-conjunction with functions like ``add_executable`` or others to create the +-necessary compile rules with CMake. +- +-The initial variable is followed by a list of .vala files to be compiled. +-Please take care to add every vala file belonging to the currently compiled +-project or library as Vala will otherwise not be able to resolve all +-dependencies. +- +-The following sections may be specified afterwards to provide certain options +-to the vala compiler: +- +-PACKAGES +- A list of vala packages/libraries to be used during the compile cycle. The +- package names are exactly the same, as they would be passed to the valac +- "--pkg=" option. +- +-OPTIONS +- A list of optional options to be passed to the valac executable. This can be +- used to pass "--thread" for example to enable multi-threading support. +- +-DIRECTORY +- Specify the directory where the output source files will be stored. If +- ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR. +- +-CUSTOM_VAPIS +- A list of custom vapi files to be included for compilation. This can be +- useful to include freshly created vala libraries without having to install +- them in the system. +- +-GENERATE_VAPI +- Pass all the needed flags to the compiler to create an internal vapi for +- the compiled library. The provided name will be used for this and a +- .vapi file will be created. +- +-GENERATE_HEADER +- Let the compiler generate a header file for the compiled code. There will +- be a header file as well as an internal header file being generated called +- .h and _internal.h +- +-The following call is a simple example to the vala_precompile macro showing an +-example to every of the optional sections:: +- +- vala_precompile(VALA_C +- source1.vala +- source2.vala +- source3.vala +- PACKAGES +- gtk+-2.0 +- gio-1.0 +- posix +- OPTIONS +- --thread +- CUSTOM_VAPIS +- some_vapi.vapi +- GENERATE_VAPI +- myvapi +- GENERATE_HEADER +- myheader +- ) +- +-Most important is the variable VALA_C which will contain all the generated c +-file names after the call. The easiest way to use this information is to tell +-CMake to create an executable out of it. +- +-:: +- +- add_executable(myexecutable ${VALA_C}) +- +- +-Further reading +-=============== +- +-The `Pdf Presenter Console`__ , which is a vala based project of mine, makes +-heavy usage of the here described macros. To look at a real world example of +-these macros the mentioned project is the right place to take a look. The svn +-trunk of it can be found at:: +- +- svn://pureenergy.cc/pdf_presenter_console/trunk +- +- +-__ http://westhoffswelt.de/projects/pdf_presenter_console.html +- +- +-Acknowledgments +-=============== +- +-Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me +-a lot with the initial version of this macros and always answered my mostly +-dumb CMake questions. +- +-.. _CMake: http://cmake.org +-.. _Vala: http://live.gnome.org/Vala +-.. _Genie: http://live.gnome.org/Genie +- +- +- +-.. +- Local Variables: +- mode: rst +- fill-column: 79 +- End: +- vim: et syn=rst tw=79 +diff --git a/cmake/Translations.cmake b/cmake/Translations.cmake +deleted file mode 100644 +index 4ed63e02..00000000 +--- a/cmake/Translations.cmake ++++ /dev/null +@@ -1,225 +0,0 @@ +-# Translations.cmake, CMake macros written for Marlin, feel free to re-use them +-include(CMakeParseArguments) +-# be sure that all languages are present +-# Using all usual languages code from https://www.gnu.org/software/gettext/manual/html_node/Language-Codes.html#Language-Codes +-# Rare language codes should be added on-demand. +-set (LANGUAGES_NEEDED aa ab ae af ak am an ar as ast av ay az ba be bg bh bi bm bn bo br bs ca ce ch ckb co cr cs cu cv cy da de dv dz ee el en_AU en_CA en_GB eo es et eu fa ff fi fj fo fr fr_CA fy ga gd gl gn gu gv ha he hi ho hr ht hu hy hz ia id ie ig ii ik io is it iu ja jv ka kg ki kj kk kl km kn ko kr ks ku kv kw ky la lb lg li ln lo lt lu lv mg mh mi mk ml mn mo mr ms mt my na nb nd ne ng nl nn no nr nv ny oc oj om or os pa pi pl ps pt pt_BR qu rm rn ro ru rue rw sa sc sd se sg si sk sl sm sma sn so sq sr ss st su sv sw ta te tg th ti tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa wo xh yi yo za zh zh_CN zh_HK zh_TW zu) +- +-macro (add_translations_directory NLS_PACKAGE) +- add_custom_target (i18n ALL COMMENT “Building i18n messages.”) +- find_program (MSGFMT_EXECUTABLE msgfmt) +- foreach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED}) +- create_po_file (${LANGUAGE_NEEDED} ${CMAKE_CURRENT_SOURCE_DIR}) +- endforeach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED}) +- # generate .mo from .po +- file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po) +- foreach (PO_INPUT ${PO_FILES}) +- get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE) +- set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo) +- add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT}) +- +- install (FILES ${MO_OUTPUT} DESTINATION +- share/locale/${PO_INPUT_BASE}/LC_MESSAGES +- RENAME ${NLS_PACKAGE}.mo) +- endforeach (PO_INPUT ${PO_FILES}) +-endmacro (add_translations_directory) +- +-# Apply the right default template. +-macro (create_po_file LANGUAGE_NEEDED DIRECTORY) +- set (FILE ${DIRECTORY}/${LANGUAGE_NEEDED}.po) +- if (NOT EXISTS ${DIRECTORY}/${LANGUAGE_NEEDED}.po) +- file (APPEND ${FILE} "msgid \"\"\n") +- file (APPEND ${FILE} "msgstr \"\"\n") +- file (APPEND ${FILE} "\"MIME-Version: 1.0\\n\"\n") +- file (APPEND ${FILE} "\"Content-Type: text/plain; charset=UTF-8\\n\"\n") +- +- if ("${LANGUAGE_NEEDED}" STREQUAL "ja" +- OR "${LANGUAGE_NEEDED}" STREQUAL "vi" +- OR "${LANGUAGE_NEEDED}" STREQUAL "ko") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\\n\"\n") +- elseif ("${LANGUAGE_NEEDED}" STREQUAL "en" +- OR "${LANGUAGE_NEEDED}" STREQUAL "de" +- OR "${LANGUAGE_NEEDED}" STREQUAL "nl" +- OR "${LANGUAGE_NEEDED}" STREQUAL "sv" +- OR "${LANGUAGE_NEEDED}" STREQUAL "nb" +- OR "${LANGUAGE_NEEDED}" STREQUAL "nn" +- OR "${LANGUAGE_NEEDED}" STREQUAL "nb" +- OR "${LANGUAGE_NEEDED}" STREQUAL "no" +- OR "${LANGUAGE_NEEDED}" STREQUAL "fo" +- OR "${LANGUAGE_NEEDED}" STREQUAL "es" +- OR "${LANGUAGE_NEEDED}" STREQUAL "pt" +- OR "${LANGUAGE_NEEDED}" STREQUAL "it" +- OR "${LANGUAGE_NEEDED}" STREQUAL "bg" +- OR "${LANGUAGE_NEEDED}" STREQUAL "he" +- OR "${LANGUAGE_NEEDED}" STREQUAL "fi" +- OR "${LANGUAGE_NEEDED}" STREQUAL "et" +- OR "${LANGUAGE_NEEDED}" STREQUAL "eo" +- OR "${LANGUAGE_NEEDED}" STREQUAL "hu" +- OR "${LANGUAGE_NEEDED}" STREQUAL "tr" +- OR "${LANGUAGE_NEEDED}" STREQUAL "es") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=2; plural=n != 1;\\n\"\n") +- elseif ("${LANGUAGE_NEEDED}" STREQUAL "fr" +- OR "${LANGUAGE_NEEDED}" STREQUAL "fr_CA" +- OR "${LANGUAGE_NEEDED}" STREQUAL "pt_BR") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=2; plural=n>1;\\n\"\n") +- elseif ("${LANGUAGE_NEEDED}" STREQUAL "lv") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2;\\n\"\n") +- elseif ("${LANGUAGE_NEEDED}" STREQUAL "ro") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2;\\n\"\n") +- elseif ("${LANGUAGE_NEEDED}" STREQUAL "lt") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2;\\n\"\n") +- elseif ("${LANGUAGE_NEEDED}" STREQUAL "ru" +- OR "${LANGUAGE_NEEDED}" STREQUAL "uk" +- OR "${LANGUAGE_NEEDED}" STREQUAL "be" +- OR "${LANGUAGE_NEEDED}" STREQUAL "sr" +- OR "${LANGUAGE_NEEDED}" STREQUAL "hr") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\\n\"\n") +- elseif ("${LANGUAGE_NEEDED}" STREQUAL "cs" +- OR "${LANGUAGE_NEEDED}" STREQUAL "sk") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\\n\"\n") +- elseif ("${LANGUAGE_NEEDED}" STREQUAL "pl") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\\n\"\n") +- elseif ("${LANGUAGE_NEEDED}" STREQUAL "sl") +- file (APPEND ${FILE} "\"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;\\n\"\n") +- endif () +- +- endif () +-endmacro (create_po_file) +- +-macro (configure_file_translation SOURCE RESULT PO_DIR) +- find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge) +- set(EXTRA_PO_DIR ${PO_DIR}/extra/) +- get_filename_component(EXTRA_PO_DIR ${EXTRA_PO_DIR} ABSOLUTE) +- +- # Intltool can't create a new directory. +- get_filename_component(RESULT_DIRECTORY ${RESULT} DIRECTORY) +- file(MAKE_DIRECTORY ${RESULT_DIRECTORY}) +- +- set (INTLTOOL_FLAG "") +- if (${SOURCE} MATCHES ".desktop") +- set (INTLTOOL_FLAG "--desktop-style") +- elseif (${SOURCE} MATCHES ".gschema") +- set (INTLTOOL_FLAG "--schemas-style") +- elseif (${SOURCE} MATCHES ".xml") +- set (INTLTOOL_FLAG "--xml-style") +- endif () +- execute_process (WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${INTLTOOL_MERGE_EXECUTABLE} --quiet ${INTLTOOL_FLAG} ${EXTRA_PO_DIR} ${SOURCE} ${RESULT}) +-endmacro () +- +-macro (add_translations_catalog NLS_PACKAGE) +- cmake_parse_arguments (ARGS "" "" "DESKTOP_FILES;APPDATA_FILES;SCHEMA_FILES" ${ARGN}) +- add_custom_target (pot COMMENT “Building translation catalog.”) +- find_program (XGETTEXT_EXECUTABLE xgettext) +- find_program (INTLTOOL_EXTRACT_EXECUTABLE intltool-extract) +- find_program (MSG_MERGE msgmerge) +- +- set(EXTRA_PO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extra) +- +- set(TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot) +- set(EXTRA_TEMPLATE ${EXTRA_PO_DIR}/extra.pot) +- +- set(C_SOURCE "") +- set(VALA_SOURCE "") +- set(GLADE_SOURCE "") +- +- foreach(FILES_INPUT ${ARGN}) +- if((${FILES_INPUT} MATCHES ${CMAKE_SOURCE_DIR}) OR (${FILES_INPUT} MATCHES ${CMAKE_BINARY_DIR})) +- set(BASE_DIRECTORY ${FILES_INPUT}) +- else () +- set(BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}) +- endif () +- +- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.c) +- foreach(C_FILE ${SOURCE_FILES}) +- set(C_SOURCE ${C_SOURCE} ${C_FILE}) +- endforeach() +- +- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.vala) +- foreach(VALA_FILE ${SOURCE_FILES}) +- set(VALA_SOURCE ${VALA_SOURCE} ${VALA_FILE}) +- endforeach() +- +- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.ui) +- foreach(GLADE_FILE ${SOURCE_FILES}) +- set(GLADE_SOURCE ${GLADE_SOURCE} ${GLADE_FILE}) +- endforeach() +- endforeach() +- +- set (XGETTEXT_C_ARGS --add-comments="/" --keyword="_" --keyword="N_" --keyword="C_:1c,2" --keyword="NC_:1c,2" --keyword="ngettext:1,2" --keyword="Q_:1g") +- set(BASE_XGETTEXT_COMMAND +- ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} +- -o ${TEMPLATE} +- ${XGETTEXT_C_ARGS} --from-code=UTF-8) +- +- set(EXTRA_XGETTEXT_COMMAND +- ${XGETTEXT_EXECUTABLE} -d extra +- -o ${EXTRA_TEMPLATE} --no-location --from-code=UTF-8) +- +- set (INTLTOOL_EXTRACT_COMMAND +- ${INTLTOOL_EXTRACT_EXECUTABLE} --local --srcdir=/) +- +- set(CONTINUE_FLAG "") +- +- IF(NOT "${C_SOURCE}" STREQUAL "") +- add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${C_SOURCE}) +- set(CONTINUE_FLAG "-j") +- ENDIF() +- +- IF(NOT "${VALA_SOURCE}" STREQUAL "") +- add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LC\# ${VALA_SOURCE}) +- set(CONTINUE_FLAG "-j") +- ENDIF() +- +- IF(NOT "${GLADE_SOURCE}" STREQUAL "") +- add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LGlade ${GLADE_SOURCE}) +- ENDIF() +- # Then we have to update all the .po files +- add_custom_target (po COMMENT “Syncing translation files.”) +- add_dependencies (po pot) +- file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po) +- foreach (PO_INPUT ${PO_FILES}) +- get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME) +- add_custom_command (TARGET po WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${MSG_MERGE} --update ${PO_INPUT_BASE} ${TEMPLATE} --force-po) +- endforeach (PO_INPUT ${PO_FILES}) +- +- +- # We need to create the directory if one extra content exists. +- IF((NOT "${ARGS_DESKTOP_FILES}" STREQUAL "") OR (NOT "${ARGS_APPDATA_FILES}" STREQUAL "") OR (NOT "${ARGS_SCHEMA_FILES}" STREQUAL "")) +- file(MAKE_DIRECTORY ${EXTRA_PO_DIR}) +- foreach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED}) +- create_po_file (${LANGUAGE_NEEDED} ${EXTRA_PO_DIR}) +- endforeach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED}) +- ENDIF() +- +- set(CONTINUE_FLAG "") +- +- foreach(DESKTOP_SOURCE ${ARGS_DESKTOP_FILES}) +- get_filename_component(DESKTOP_SOURCE ${DESKTOP_SOURCE} ABSOLUTE) +- add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${INTLTOOL_EXTRACT_COMMAND} --type=gettext/keys ${DESKTOP_SOURCE}) +- get_filename_component(DESKTOP_SOURCE_NAME ${DESKTOP_SOURCE} NAME) +- add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${EXTRA_XGETTEXT_COMMAND} ${CONTINUE_FLAG} ${XGETTEXT_C_ARGS} ${CMAKE_CURRENT_BINARY_DIR}/tmp/${DESKTOP_SOURCE_NAME}.h) +- set(CONTINUE_FLAG "-j") +- endforeach() +- +- foreach(APPDATA_SOURCE ${ARGS_APPDATA_FILES}) +- get_filename_component(APPDATA_SOURCE ${APPDATA_SOURCE} ABSOLUTE) +- add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${INTLTOOL_EXTRACT_COMMAND} --type=gettext/xml ${APPDATA_SOURCE}) +- get_filename_component(APPDATA_SOURCE_NAME ${APPDATA_SOURCE} NAME) +- add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${EXTRA_XGETTEXT_COMMAND} ${CONTINUE_FLAG} ${XGETTEXT_C_ARGS} ${CMAKE_CURRENT_BINARY_DIR}/tmp/${APPDATA_SOURCE_NAME}.h) +- set(CONTINUE_FLAG "-j") +- endforeach() +- +- foreach(SCHEMA_SOURCE ${ARGS_SCHEMA_FILES}) +- get_filename_component(SCHEMA_SOURCE ${SCHEMA_SOURCE} ABSOLUTE) +- add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${INTLTOOL_EXTRACT_COMMAND} --type=gettext/schemas ${SCHEMA_SOURCE}) +- get_filename_component(SCHEMA_SOURCE_NAME ${SCHEMA_SOURCE} NAME) +- add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${EXTRA_XGETTEXT_COMMAND} ${CONTINUE_FLAG} ${XGETTEXT_C_ARGS} ${CMAKE_CURRENT_BINARY_DIR}/tmp/${SCHEMA_SOURCE_NAME}.h) +- set(CONTINUE_FLAG "-j") +- endforeach() +- +- file (GLOB PO_FILES ${EXTRA_PO_DIR}/*.po) +- foreach (PO_INPUT ${PO_FILES}) +- get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME) +- add_custom_command (TARGET po COMMAND WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ${MSG_MERGE} --update ${PO_INPUT_BASE} ${EXTRA_TEMPLATE}) +- endforeach (PO_INPUT ${PO_FILES}) +-endmacro () +diff --git a/cmake/ValaPrecompile.cmake b/cmake/ValaPrecompile.cmake +deleted file mode 100644 +index 6ab7fb29..00000000 +--- a/cmake/ValaPrecompile.cmake ++++ /dev/null +@@ -1,213 +0,0 @@ +-## +-# Copyright 2009-2010 Jakob Westhoff. All rights reserved. +-# +-# Redistribution and use in source and binary forms, with or without +-# modification, are permitted provided that the following conditions are met: +-# +-# 1. Redistributions of source code must retain the above copyright notice, +-# this list of conditions and the following disclaimer. +-# +-# 2. Redistributions in binary form must reproduce the above copyright notice, +-# this list of conditions and the following disclaimer in the documentation +-# and/or other materials provided with the distribution. +-# +-# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR +-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +-# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-# +-# The views and conclusions contained in the software and documentation are those +-# of the authors and should not be interpreted as representing official policies, +-# either expressed or implied, of Jakob Westhoff +-## +- +-include(ParseArguments) +-find_package(Vala REQUIRED) +- +-## +-# Compile vala files to their c equivalents for further processing. +-# +-# The "vala_precompile" macro takes care of calling the valac executable on the +-# given source to produce c files which can then be processed further using +-# default cmake functions. +-# +-# The first parameter provided is a variable, which will be filled with a list +-# of c files outputted by the vala compiler. This list can than be used in +-# conjuction with functions like "add_executable" or others to create the +-# neccessary compile rules with CMake. +-# +-# The initial variable is followed by a list of .vala files to be compiled. +-# Please take care to add every vala file belonging to the currently compiled +-# project or library as Vala will otherwise not be able to resolve all +-# dependencies. +-# +-# The following sections may be specified afterwards to provide certain options +-# to the vala compiler: +-# +-# PACKAGES +-# A list of vala packages/libraries to be used during the compile cycle. The +-# package names are exactly the same, as they would be passed to the valac +-# "--pkg=" option. +-# +-# OPTIONS +-# A list of optional options to be passed to the valac executable. This can be +-# used to pass "--thread" for example to enable multi-threading support. +-# +-# CUSTOM_VAPIS +-# A list of custom vapi files to be included for compilation. This can be +-# useful to include freshly created vala libraries without having to install +-# them in the system. +-# +-# GENERATE_VAPI +-# Pass all the needed flags to the compiler to create an internal vapi for +-# the compiled library. The provided name will be used for this and a +-# .vapi file will be created. +-# +-# GENERATE_HEADER +-# Let the compiler generate a header file for the compiled code. There will +-# be a header file as well as an internal header file being generated called +-# .h and _internal.h +-# +-# GENERATE_GIR +-# Have the compiler generate a GObject-Introspection repository file with +-# name: .gir. This can be later used to create a binary typelib +-# using the GI compiler. +-# +-# GENERATE_SYMBOLS +-# Output a .symbols file containing all the exported symbols. +-# +-# The following call is a simple example to the vala_precompile macro showing +-# an example to every of the optional sections: +-# +-# vala_precompile(VALA_C mytargetname +-# source1.vala +-# source2.vala +-# source3.vala +-# PACKAGES +-# gtk+-2.0 +-# gio-1.0 +-# posix +-# DIRECTORY +-# gen +-# OPTIONS +-# --thread +-# CUSTOM_VAPIS +-# some_vapi.vapi +-# GENERATE_VAPI +-# myvapi +-# GENERATE_HEADER +-# myheader +-# GENERATE_GIR +-# mygir +-# GENERATE_SYMBOLS +-# mysymbols +-# ) +-# +-# Most important is the variable VALA_C which will contain all the generated c +-# file names after the call. +-## +- +-macro(vala_precompile output target_name) +- parse_arguments(ARGS "TARGET;PACKAGES;OPTIONS;DIRECTORY;GENERATE_GIR;GENERATE_SYMBOLS;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN}) +- +- if(ARGS_DIRECTORY) +- set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY}) +- else(ARGS_DIRECTORY) +- set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +- endif(ARGS_DIRECTORY) +- include_directories(${DIRECTORY}) +- set(vala_pkg_opts "") +- foreach(pkg ${ARGS_PACKAGES}) +- list(APPEND vala_pkg_opts "--pkg=${pkg}") +- endforeach(pkg ${ARGS_PACKAGES}) +- set(in_files "") +- set(out_files "") +- set(out_files_display "") +- set(${output} "") +- foreach(src ${ARGS_DEFAULT_ARGS}) +- list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}") +- string(REPLACE ".vala" ".c" src ${src}) +- string(REPLACE ".gs" ".c" src ${src}) +- set(out_file "${DIRECTORY}/${src}") +- list(APPEND out_files "${DIRECTORY}/${src}") +- list(APPEND out_files_display "${src}") +- list(APPEND ${output} ${out_file}) +- endforeach(src ${ARGS_DEFAULT_ARGS}) +- +- set(custom_vapi_arguments "") +- if(ARGS_CUSTOM_VAPIS) +- foreach(vapi ${ARGS_CUSTOM_VAPIS}) +- list(APPEND custom_vapi_arguments ${vapi}) +- endforeach(vapi ${ARGS_CUSTOM_VAPIS}) +- endif(ARGS_CUSTOM_VAPIS) +- +- set(vapi_arguments "") +- if(ARGS_GENERATE_VAPI) +- list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi") +- list(APPEND out_files_display "${ARGS_GENERATE_VAPI}.vapi") +- set(vapi_arguments "--library=${ARGS_GENERATE_VAPI}" "--vapi=${ARGS_GENERATE_VAPI}.vapi") +- endif(ARGS_GENERATE_VAPI) +- +- set(header_arguments "") +- if(ARGS_GENERATE_HEADER) +- list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") +- list(APPEND out_files_display "${ARGS_GENERATE_HEADER}.h") +- list(APPEND header_arguments "--header=${ARGS_GENERATE_HEADER}.h") +- endif(ARGS_GENERATE_HEADER) +- +- set(gir_arguments "") +- if(ARGS_GENERATE_GIR) +- list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_GIR}.gir") +- list(APPEND out_files_display "${ARGS_GENERATE_GIR}.gir") +- set(gir_arguments "--gir=${ARGS_GENERATE_GIR}.gir") +- endif(ARGS_GENERATE_GIR) +- +- set(symbols_arguments "") +- if(ARGS_GENERATE_SYMBOLS) +- list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_SYMBOLS}.symbols") +- list(APPEND out_files_display "${ARGS_GENERATE_SYMBOLS}.symbols") +- set(symbols_arguments "--symbols=${ARGS_GENERATE_SYMBOLS}.symbols") +- endif(ARGS_GENERATE_SYMBOLS) +- +- # Workaround for a bug that would make valac run twice. This file is written +- # after the vala compiler generates C source code. +- set(OUTPUT_STAMP ${CMAKE_CURRENT_BINARY_DIR}/${target_name}_valac.stamp) +- +- add_custom_command( +- OUTPUT +- ${OUTPUT_STAMP} +- COMMAND +- ${VALA_EXECUTABLE} +- ARGS +- "-C" +- ${header_arguments} +- ${vapi_arguments} +- ${gir_arguments} +- ${symbols_arguments} +- "-b" ${CMAKE_CURRENT_SOURCE_DIR} +- "-d" ${DIRECTORY} +- ${vala_pkg_opts} +- ${ARGS_OPTIONS} +- ${in_files} +- ${custom_vapi_arguments} +- COMMAND +- touch +- ARGS +- ${OUTPUT_STAMP} +- DEPENDS +- ${in_files} +- ${ARGS_CUSTOM_VAPIS} +- COMMENT +- "Generating ${out_files_display}" +- ) +- +- # This command will be run twice for some reason (pass a non-empty string to COMMENT +- # in order to see it). Since valac is not executed from here, this won't be a problem. +- add_custom_command(OUTPUT ${out_files} DEPENDS ${OUTPUT_STAMP} COMMENT "") +-endmacro(vala_precompile) +diff --git a/cmake/ValaVersion.cmake b/cmake/ValaVersion.cmake +deleted file mode 100644 +index 3fff193f..00000000 +--- a/cmake/ValaVersion.cmake ++++ /dev/null +@@ -1,96 +0,0 @@ +-## +-# Copyright 2009-2010 Jakob Westhoff. All rights reserved. +-# +-# Redistribution and use in source and binary forms, with or without +-# modification, are permitted provided that the following conditions are met: +-# +-# 1. Redistributions of source code must retain the above copyright notice, +-# this list of conditions and the following disclaimer. +-# +-# 2. Redistributions in binary form must reproduce the above copyright notice, +-# this list of conditions and the following disclaimer in the documentation +-# and/or other materials provided with the distribution. +-# +-# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR +-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +-# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-# +-# The views and conclusions contained in the software and documentation are those +-# of the authors and should not be interpreted as representing official policies, +-# either expressed or implied, of Jakob Westhoff +-## +- +-include(ParseArguments) +-find_package(Vala REQUIRED) +- +-## +-# Ensure a certain valac version is available +-# +-# The initial argument is the version to check for +-# +-# It may be followed by a optional parameter to specifiy a version range. The +-# following options are valid: +-# +-# EXACT +-# Vala needs to be available in the exact version given +-# +-# MINIMUM +-# The provided version is the minimum version. Therefore Vala needs to be +-# available in the given version or any higher version +-# +-# MAXIMUM +-# The provided version is the maximum. Therefore Vala needs to be available +-# in the given version or any version older than this +-# +-# If no option is specified the version will be treated as a minimal version. +-## +-macro(ensure_vala_version version) +- parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN}) +- set(compare_message "") +- set(error_message "") +- if(ARGS_MINIMUM) +- set(compare_message "a minimum ") +- set(error_message "or greater ") +- elseif(ARGS_MAXIMUM) +- set(compare_message "a maximum ") +- set(error_message "or less ") +- endif(ARGS_MINIMUM) +- +- message(STATUS +- "checking for ${compare_message}Vala version of ${version}" +- ) +- +- unset(version_accepted) +- +- # MINIMUM is the default if no option is specified +- if(ARGS_EXACT) +- if(${VALA_VERSION} VERSION_EQUAL ${version} ) +- set(version_accepted TRUE) +- endif(${VALA_VERSION} VERSION_EQUAL ${version}) +- elseif(ARGS_MAXIMUM) +- if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) +- set(version_accepted TRUE) +- endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) +- else(ARGS_MAXIMUM) +- if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) +- set(version_accepted TRUE) +- endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) +- endif(ARGS_EXACT) +- +- if (NOT version_accepted) +- message(FATAL_ERROR +- "Vala version ${version} ${error_message}is required." +- ) +- endif(NOT version_accepted) +- +- message(STATUS +- " found Vala, version ${VALA_VERSION}" +- ) +-endmacro(ensure_vala_version) +diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt +deleted file mode 100644 +index 24f9201d..00000000 +--- a/demo/CMakeLists.txt ++++ /dev/null +@@ -1,45 +0,0 @@ +-include_directories (${CMAKE_CURRENT_BINARY_DIR}/../lib) +- +-set (CMAKE_INCLUDE_CURRENT_DIR ON) +-set (CFLAGS ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER} ) +-set (LIB_PATHS ${DEPS_LIBRARY_DIRS}) +- +-link_directories (${LIB_PATHS} ${CMAKE_CURRENT_BINARY_DIR}/../lib) +-add_definitions (${CFLAGS} "-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"") +- +-set (EXEC_NAME ${PKG_NAME}-demo) +- +-vala_precompile (VALA_C ${EXEC_NAME} +- GraniteDemo.vala +- Views/AlertViewView.vala +- Views/AvatarView.vala +- Views/CSSView.vala +- Views/DateTimePickerView.vala +- Views/DynamicNotebookView.vala +- Views/MessageDialogView.vala +- Views/ModeButtonView.vala +- Views/OverlayBarView.vala +- Views/SeekBarView.vala +- Views/SourceListView.vala +- Views/StorageView.vala +- Views/ToastView.vala +- Views/UtilsView.vala +- Views/WelcomeView.vala +- Views/AsyncImageView.vala +- Views/SettingsView/SettingsView.vala +- Views/SettingsView/SettingsPage.vala +- Views/SettingsView/SimpleSettingsPage.vala +-CUSTOM_VAPIS +- ${CMAKE_CURRENT_BINARY_DIR}/../lib/${PKG_NAME}.vapi +-PACKAGES +- ${PKG_DEPS} +-OPTIONS +- ${VALAC_OPTIONS} +-) +- +-add_executable (${EXEC_NAME} ${VALA_C}) +-# The demo app is of course using deprecated widgets +-set_target_properties(${EXEC_NAME} PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations) +-target_link_libraries (${EXEC_NAME} ${PKG_NAME} ${DEPS_LIBRARIES}) +-install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin) +-install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/granite-demo.desktop DESTINATION share/applications) +diff --git a/demo/meson.build b/demo/meson.build +new file mode 100644 +index 00000000..0858f0ac +--- /dev/null ++++ b/demo/meson.build +@@ -0,0 +1,40 @@ ++executable( ++ 'granite-demo', ++ ++ 'GraniteDemo.vala', ++ ++ 'Views/AlertViewView.vala', ++ 'Views/AsyncImageView.vala', ++ 'Views/AvatarView.vala', ++ 'Views/CSSView.vala', ++ 'Views/DateTimePickerView.vala', ++ 'Views/DynamicNotebookView.vala', ++ 'Views/MessageDialogView.vala', ++ 'Views/ModeButtonView.vala', ++ 'Views/OverlayBarView.vala', ++ 'Views/SeekBarView.vala', ++ 'Views/SettingsView/SettingsPage.vala', ++ 'Views/SettingsView/SettingsView.vala', ++ 'Views/SettingsView/SimpleSettingsPage.vala', ++ 'Views/SourceListView.vala', ++ 'Views/StorageView.vala', ++ 'Views/ToastView.vala', ++ 'Views/UtilsView.vala', ++ 'Views/WelcomeView.vala', ++ ++ dependencies: [libgranite_dep], ++ ++ install: true, ++) ++ ++applications_dir = join_paths( ++ get_option('prefix'), ++ get_option('datadir'), ++ 'applications' ++) ++ ++install_data( ++ 'granite-demo.desktop', ++ install_dir: applications_dir ++) ++ +diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt +deleted file mode 100644 +index ead44892..00000000 +--- a/doc/CMakeLists.txt ++++ /dev/null +@@ -1,52 +0,0 @@ +-# Serialize deps packages for valadoc +-foreach (pkg ${PKG_DEPS}) +- list (APPEND VALADOC_PKG_OPTS "--pkg=${pkg}") +-endforeach () +- +-# Source files to scan +-set (SRC_DIR "${CMAKE_SOURCE_DIR}/lib") +-file (GLOB SRC_FILES ${SRC_DIR}/*.vala ${SRC_DIR}/*/*.vala) +- +-set (BASE_VALADOC_COMMAND +- valadoc +- ${VALADOC_PKG_OPTS} +- ${SRC_FILES} +- --vapidir=${SRC_DIR} +- --pkg config +- --verbose +- --target-glib=2.50 +- --package-name=${PKG_NAME} +- --package-version=${PKG_VERSION}) +- +-######################### +-# C API Documentation +-######################### +- +-add_custom_target (cdocs) +-add_dependencies (cdocs ${PKG_NAME}) # we need the lib's C header file, and thus valac must run first +- +-set (C_API_DOC_DIR ${CMAKE_CURRENT_BINARY_DIR}/cdocs) +- +-add_custom_command (TARGET cdocs COMMAND rm ${C_API_DOC_DIR} -R -f) # delete previous files +-add_custom_command (TARGET cdocs COMMAND ${BASE_VALADOC_COMMAND} ${VALADOC_PKG_OPTS} -o ${C_API_DOC_DIR} +- --doclet-arg=${CMAKE_BINARY_DIR}/lib/${PKG_NAME}.h --doclet=gtkdoc) +- +-######################### +-# Vala API documentation +-######################### +- +-add_custom_target (valadocs) +-set (VALA_API_DOC_DIR "${CMAKE_CURRENT_BINARY_DIR}/valadocs") +- +-add_custom_command (TARGET valadocs COMMAND rm ${CMAKE_CURRENT_BINARY_DIR}/images -R -f) +-add_custom_command (TARGET valadocs COMMAND cp ${CMAKE_SOURCE_DIR}/doc/images/ ${CMAKE_CURRENT_BINARY_DIR}/images -R) +- +-add_custom_command (TARGET valadocs COMMAND rm ${VALA_API_DOC_DIR} -R -f) # delete previous files +-add_custom_command (TARGET valadocs COMMAND ${BASE_VALADOC_COMMAND} --doclet=html -o ${VALA_API_DOC_DIR}) +- +-######################### +-# All the documents +-######################### +- +-add_custom_target (docs) +-add_dependencies (docs cdocs valadocs) +diff --git a/doc/meson.build b/doc/meson.build +new file mode 100644 +index 00000000..9b3e9906 +--- /dev/null ++++ b/doc/meson.build +@@ -0,0 +1,58 @@ ++valadoc = find_program('valadoc') ++gd_scan = find_program('gtkdoc-scan') ++ ++valadoc_vala_dir = 'granite-vala' ++valadoc_target = custom_target( ++ 'valadoc', ++ command: [ ++ valadoc, ++ '--pkg=gee-0.8', ++ '--pkg=glib-2.0', ++ '--pkg=gio-2.0', ++ '--pkg=gio-unix-2.0', ++ '--pkg=gobject-2.0', ++ '--pkg=gtk+-3.0', ++ '--pkg=posix', ++ libgranite_sources, ++ '--target-glib=' + glib_min_version, ++ '--package-name=' + meson.project_name(), ++ '--package-version=' + meson.project_version(), ++ '--verbose', ++ '--force', ++ '--use-svg-images', ++ '-o', join_paths(meson.current_build_dir(), valadoc_vala_dir), ++ ], ++ ++ build_by_default: true, ++ output: valadoc_vala_dir, ++ depends: libgranite, ++) ++ ++valadoc_c_dir = 'granite' ++cdoc_target = custom_target( ++ 'cdocs', ++ command: [ ++ valadoc, ++ '--pkg=gee-0.8', ++ '--pkg=glib-2.0', ++ '--pkg=gio-2.0', ++ '--pkg=gio-unix-2.0', ++ '--pkg=gobject-2.0', ++ '--pkg=gtk+-3.0', ++ '--pkg=posix', ++ libgranite_sources, ++ '--target-glib=' + glib_min_version, ++ '--package-name=' + meson.project_name(), ++ '--package-version=' + meson.project_version(), ++ '--verbose', ++ '--force', ++ '--use-svg-images', ++ '-o', join_paths(meson.current_build_dir(), valadoc_c_dir), ++ '--doclet-arg=' + 'lib/granite.h', ++ '--doclet=gtkdoc' ++ ], ++ ++ build_by_default: true, ++ output: valadoc_c_dir, ++ depends: libgranite ++) +diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt +deleted file mode 100644 +index c22d8737..00000000 +--- a/icons/CMakeLists.txt ++++ /dev/null +@@ -1,8 +0,0 @@ +-install(FILES 16x16/open-menu.svg DESTINATION share/icons/hicolor/16x16/actions/) +-install(FILES 16x16/appointment.svg DESTINATION share/icons/hicolor/16x16/actions/) +-install(FILES 22x22/open-menu.svg DESTINATION share/icons/hicolor/22x22/actions/) +-install(FILES 24x24/open-menu.svg DESTINATION share/icons/hicolor/24x24/actions/) +-install(FILES 24x24/appointment.svg DESTINATION share/icons/hicolor/24x24/actions/) +-install(FILES 32x32/open-menu.svg DESTINATION share/icons/hicolor/32x32/actions/) +-install(FILES 48x48/open-menu.svg DESTINATION share/icons/hicolor/48x48/actions/) +-install(FILES scalable/open-menu-symbolic.svg DESTINATION share/icons/hicolor/scalable/actions/) +\ No newline at end of file +diff --git a/icons/meson.build b/icons/meson.build +new file mode 100644 +index 00000000..79721ec8 +--- /dev/null ++++ b/icons/meson.build +@@ -0,0 +1,33 @@ ++open_menu_sizes = ['16', '22', '24', '32', '48'] ++appointment_sizes = ['16', '24'] ++ ++# open-menu.svg ++foreach size : open_menu_sizes ++ sizexsize = '@0@x@0@'.format(size) ++ path = join_paths(sizexsize, 'open-menu.svg') ++ install_dir = join_paths(icons_dir, sizexsize, 'actions') ++ ++ install_data( ++ path, ++ install_dir: install_dir ++ ) ++endforeach ++ ++# open-menu-symbolic.svg ++install_data( ++ 'scalable/open-menu-symbolic.svg', ++ install_dir: join_paths(icons_dir, 'scalable', 'actions') ++) ++ ++# appointment.svg ++foreach size : appointment_sizes ++ sizexsize = '@0@x@0@'.format(size) ++ path = join_paths(sizexsize, 'appointment.svg') ++ install_dir = join_paths(icons_dir, sizexsize, 'actions') ++ ++ install_data( ++ path, ++ install_dir: install_dir ++ ) ++endforeach ++ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +deleted file mode 100644 +index 01f6f234..00000000 +--- a/lib/CMakeLists.txt ++++ /dev/null +@@ -1,131 +0,0 @@ +-# increase when you break the API +-set (PKG_SOVERSION 5) +- +-# Increase when you add functionality +-set (PKG_SOMINOR 0) +- +-set (VALA_SOURCES +- StyleClass.vala +- Application.vala +- DateTime.vala +- Drawing/Color.vala +- Drawing/BufferSurface.vala +- Drawing/Utilities.vala +- +- GtkPatch/AboutDialog.vala +- +- Services/Settings.vala +- Services/Logger.vala +- Services/Paths.vala +- Services/System.vala +- Services/ContractorProxy.vala +- Services/IconFactory.vala +- Services/SimpleCommand.vala +- +- Widgets/AbstractSettingsPage.vala +- Widgets/AbstractSimpleSettingsPage.vala +- Widgets/AlertView.vala +- Widgets/Avatar.vala +- Widgets/Utils.vala +- Widgets/AboutDialog.vala +- Widgets/ModeButton.vala +- Widgets/ModeSwitch.vala +- Widgets/DatePicker.vala +- Widgets/TimePicker.vala +- Widgets/CollapsiblePaned.vala +- Widgets/DynamicNotebook.vala +- Widgets/CompositedWindow.vala +- Widgets/AppMenu.vala +- Widgets/Welcome.vala +- Widgets/WelcomeButton.vala +- Widgets/Toast.vala +- Widgets/SeekBar.vala +- Widgets/StorageBar.vala +- Widgets/SourceList.vala +- Widgets/CellRendererExpander.vala +- Widgets/CellRendererBadge.vala +- Widgets/OverlayBar.vala +- Widgets/HeaderLabel.vala +- Widgets/SettingsSidebar.vala +- Widgets/SettingsSidebarRow.vala +- Widgets/MessageDialog.vala +- Widgets/AsyncImage.vala +-) +- +-set (C_SOURCES +- Widgets/widgets-utils.c +-) +- +-###################### +-# lib PC file +-###################### +-set (PREFIX ${CMAKE_INSTALL_PREFIX}) +-set (DOLLAR "$") # You hear that? It's kittens being killed by the gods of cmake +- +-configure_file (${CMAKE_SOURCE_DIR}/lib/config.h.cmake ${CMAKE_BINARY_DIR}/lib/config.h) # used from config.vala +-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/${PKG_NAME}.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}.pc) +- +-include (GNUInstallDirs) +-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}.pc DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig) +- +-# Link all +-set (CFLAGS ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER}) +-add_definitions (${CFLAGS} "-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"") +- +-set (LIBS ${DEPS_LIBRARIES} -lm) +-set (LIB_PATHS ${DEPS_LIBRARY_DIRS}) +-link_directories (${LIB_PATHS}) +- +-include_directories (${CMAKE_CURRENT_SOURCE_DIR}/Widgets) +- +-option (VAPI_COMMENTS "Include comments in the generated vapi file" OFF) +- +-if (VAPI_COMMENTS) +- set (VALAC_OPTIONS ${VALAC_OPTIONS} --vapi-comments) +-endif () +- +-vala_precompile (VALA_C ${PKG_NAME} +- ${VALA_SOURCES} +-PACKAGES +- ${PKG_DEPS} +-GENERATE_HEADER +- ${PKG_NAME} +-GENERATE_GIR +- ${PKG_GIR_NAME} +-GENERATE_VAPI +- ${PKG_NAME} +-CUSTOM_VAPIS +- ${CMAKE_CURRENT_SOURCE_DIR}/config.vapi +-OPTIONS +- ${VALAC_OPTIONS} +-) +- +-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}.vapi DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/vala/vapi) +-install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PKG_NAME}.deps DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/vala/vapi) +-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${PKG_NAME}) +-install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/Widgets/widgets-utils.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${PKG_NAME}) +- +-set (LIB_FILES ${C_SOURCES} ${VALA_C}) +- +-add_library (${PKG_NAME} SHARED ${LIB_FILES}) +- +-target_link_libraries (${PKG_NAME} ${LIBS}) +- +-set_target_properties (${PKG_NAME} PROPERTIES +- VERSION ${PKG_SOVERSION}.${PKG_SOMINOR} +- SOVERSION ${PKG_SOVERSION}) +- +-install (TARGETS ${PKG_NAME} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) +- +-########################### +-# GObject Introspection +-########################### +- +-include (FindGObjectIntrospection) +- +-if (INTROSPECTION_FOUND) +- include (GObjectIntrospectionMacros) +- add_custom_command(TARGET ${PKG_NAME} COMMAND ${INTROSPECTION_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/${PKG_GIR_NAME}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${PKG_GIR_NAME}.typelib) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_GIR_NAME}.gir DESTINATION ${INTROSPECTION_GIRDIR}) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_GIR_NAME}.typelib DESTINATION ${INTROSPECTION_TYPELIBDIR}) +-endif () +diff --git a/lib/Widgets/AboutDialog.vala b/lib/Widgets/AboutDialog.vala +index 5cae05db..c4bd5f1d 100644 +--- a/lib/Widgets/AboutDialog.vala ++++ b/lib/Widgets/AboutDialog.vala +@@ -25,7 +25,7 @@ namespace Granite.Widgets { + * This class makes an about dialog which goes in the App Menu on most apps. + * This class is deprecated. Applications should instead provide an Appstream appdata.xml file to describe their metadata + * +- * {{../../doc/images/AboutDialog.png}} ++ * {{../doc/images/AboutDialog.png}} + */ + [Version (deprecated = true, deprecated_since = "0.4.2", replacement = "")] + public class AboutDialog : Granite.GtkPatch.AboutDialog { +diff --git a/lib/Widgets/AlertView.vala b/lib/Widgets/AlertView.vala +index 59e49998..3b5134ad 100644 +--- a/lib/Widgets/AlertView.vala ++++ b/lib/Widgets/AlertView.vala +@@ -24,7 +24,7 @@ + * + * It can be used to show an empty view or hiding a panel when this one is disabled. + * +- * {{../../doc/images/AlertView.png}} ++ * {{../doc/images/AlertView.png}} + * + * ''Example''<
> + * {{{ +diff --git a/lib/Widgets/CellRendererBadge.vala b/lib/Widgets/CellRendererBadge.vala +index 448ea405..0038eeea 100644 +--- a/lib/Widgets/CellRendererBadge.vala ++++ b/lib/Widgets/CellRendererBadge.vala +@@ -24,7 +24,7 @@ + * it might be used to show how much songs are in a playlist or how much updates + * are available. + * +- * {{../../doc/images/cellrendererbadge.png}} ++ * {{../doc/images/cellrendererbadge.png}} + * + * @since 0.2 + */ +diff --git a/lib/Widgets/DynamicNotebook.vala b/lib/Widgets/DynamicNotebook.vala +index cc4dfe57..fb5ad571 100644 +--- a/lib/Widgets/DynamicNotebook.vala ++++ b/lib/Widgets/DynamicNotebook.vala +@@ -511,7 +511,7 @@ namespace Granite.Widgets { + * Tab bar widget designed for a variable number of tabs. + * Supports showing a "New tab" button, restoring closed tabs, "pinning" tabs, and more. + * +- * {{../../doc/images/DynamicNotebook.png}} ++ * {{../doc/images/DynamicNotebook.png}} + */ + public class DynamicNotebook : Gtk.EventBox { + /** +diff --git a/lib/Widgets/MessageDialog.vala b/lib/Widgets/MessageDialog.vala +index 5915d87b..01d2e3f4 100644 +--- a/lib/Widgets/MessageDialog.vala ++++ b/lib/Widgets/MessageDialog.vala +@@ -43,7 +43,7 @@ + * message_dialog.destroy (); + * }}} + * +- * {{../../doc/images/MessageDialog.png}} ++ * {{../doc/images/MessageDialog.png}} + */ + public class Granite.MessageDialog : Gtk.Dialog { + /** +diff --git a/lib/Widgets/ModeButton.vala b/lib/Widgets/ModeButton.vala +index b79a8e2c..e1033a07 100644 +--- a/lib/Widgets/ModeButton.vala ++++ b/lib/Widgets/ModeButton.vala +@@ -25,7 +25,7 @@ namespace Granite.Widgets { + /** + * This widget is a multiple option modal switch + * +- * {{../../doc/images/ModeButton.png}} ++ * {{../doc/images/ModeButton.png}} + */ + public class ModeButton : Gtk.Box { + +diff --git a/lib/Widgets/OverlayBar.vala b/lib/Widgets/OverlayBar.vala +index 2a1a22d8..6d164a18 100644 +--- a/lib/Widgets/OverlayBar.vala ++++ b/lib/Widgets/OverlayBar.vala +@@ -27,7 +27,7 @@ + * + * The Overlay Bar displays a single line of text that can be changed using the "status" property. + * +- * {{../../doc/images/OverlayBar.png}} ++ * {{../doc/images/OverlayBar.png}} + * + * This widget tries to avoid getting in front of the content being displayed inside the {@link Gtk.Overlay} + * by moving itself horizontally to the opposite side from the current one when the mouse pointer enters +@@ -38,8 +38,6 @@ + * the parent is supplied as a parameter, but you have to be careful not to unset the event for + * the {@link Gtk.Overlay} at a later stage. + * +- * @see Gtk.Overlay +- * + * ''Example''<
> + * {{{ + * public class OverlayBarView : Gtk.Overlay { +@@ -62,6 +60,9 @@ + * } + * } + * }}} ++ * ++ * @see Gtk.Overlay ++ * + */ + public class Granite.Widgets.OverlayBar : Gtk.EventBox { + +diff --git a/lib/Widgets/SeekBar.vala b/lib/Widgets/SeekBar.vala +index 27b93ab0..41393def 100644 +--- a/lib/Widgets/SeekBar.vala ++++ b/lib/Widgets/SeekBar.vala +@@ -21,7 +21,7 @@ + * + * Granite.SeekBar will get the style class .seek-bar + * +- * {{../../doc/images/SeekBar.png}} ++ * {{../doc/images/SeekBar.png}} + * + * ''Example''<
> + * {{{ +diff --git a/lib/Widgets/StorageBar.vala b/lib/Widgets/StorageBar.vala +index d08a7446..e53e0b56 100644 +--- a/lib/Widgets/StorageBar.vala ++++ b/lib/Widgets/StorageBar.vala +@@ -22,7 +22,7 @@ + /** + * An horizontal bar showing the remaining amount of space. + * +- * {{../../doc/images/StorageBar.png}} ++ * {{../doc/images/StorageBar.png}} + * + * ''Example''<
> + * {{{ +diff --git a/lib/Widgets/Toast.vala b/lib/Widgets/Toast.vala +index 5324ea2f..b71bd21e 100644 +--- a/lib/Widgets/Toast.vala ++++ b/lib/Widgets/Toast.vala +@@ -27,7 +27,7 @@ namespace Granite.Widgets { + * + * Granite.Widgets.Toast will get the style class .app-notification + * +- * {{../../doc/images/Toast.png}} ++ * {{../doc/images/Toast.png}} + */ + public class Toast : Gtk.Revealer { + +diff --git a/lib/Widgets/Welcome.vala b/lib/Widgets/Welcome.vala +index a86e86d3..5ebe9a4d 100644 +--- a/lib/Widgets/Welcome.vala ++++ b/lib/Widgets/Welcome.vala +@@ -26,7 +26,7 @@ + * + * Granite.Widgets.Welcome will get the style class `welcome`. + * +- * {{../../doc/images/Welcome.png}} ++ * {{../doc/images/Welcome.png}} + * + * ''Example''<
> + * {{{ +diff --git a/lib/config.h.cmake b/lib/config.h.cmake +deleted file mode 100644 +index 20ff2d63..00000000 +--- a/lib/config.h.cmake ++++ /dev/null +@@ -1,7 +0,0 @@ +-#ifndef H_CONFIG +-#define H_CONFIG +- +-#cmakedefine GRANITE_NLS_LOCALEDIR "@GRANITE_NLS_LOCALEDIR@" +-#cmakedefine RESOURCES_DIR "@RESOURCES_DIR@" +- +-#endif +diff --git a/lib/config.vapi b/lib/config.vapi +deleted file mode 100644 +index 76cff91b..00000000 +--- a/lib/config.vapi ++++ /dev/null +@@ -1,4 +0,0 @@ +-[CCode (cname = "GETTEXT_PACKAGE", cheader_filename = "config.h")] +-internal const string GETTEXT_PACKAGE; +-[CCode (cname = "RESOURCES_DIR", cheader_filename = "config.h")] +-internal const string RESOURCES_DIR; +diff --git a/lib/granite.pc.cmake b/lib/granite.pc.cmake +deleted file mode 100644 +index bb8b5911..00000000 +--- a/lib/granite.pc.cmake ++++ /dev/null +@@ -1,12 +0,0 @@ +-prefix=@PREFIX@ +-exec_prefix=@DOLLAR@{prefix} +-libdir=@DOLLAR@{prefix}/lib +-includedir=@DOLLAR@{prefix}/include +- +-Name: granite +-Description: elementary's Application Framework +-Version: @PKG_VERSION@ +-Libs: -L@DOLLAR@{libdir} -l@PKG_NAME@ +-Cflags: -I@DOLLAR@{includedir}/@PKG_NAME@ +-Requires: cairo gee-0.8 glib-2.0 gio-unix-2.0 gobject-2.0 gthread-2.0 gdk-3.0 gdk-pixbuf-2.0 gtk+-3.0 +- +diff --git a/lib/meson.build b/lib/meson.build +new file mode 100644 +index 00000000..a126dd1f +--- /dev/null ++++ b/lib/meson.build +@@ -0,0 +1,130 @@ ++libgranite_sources = files( ++ 'Application.vala', ++ 'DateTime.vala', ++ 'StyleClass.vala', ++ ++ 'Drawing/BufferSurface.vala', ++ 'Drawing/Color.vala', ++ 'Drawing/Utilities.vala', ++ ++ 'GtkPatch/AboutDialog.vala', ++ ++ 'Services/ContractorProxy.vala', ++ 'Services/IconFactory.vala', ++ 'Services/Logger.vala', ++ 'Services/Paths.vala', ++ 'Services/Settings.vala', ++ 'Services/SimpleCommand.vala', ++ 'Services/System.vala', ++ ++ 'Widgets/AboutDialog.vala', ++ 'Widgets/AbstractSettingsPage.vala', ++ 'Widgets/AbstractSimpleSettingsPage.vala', ++ 'Widgets/AlertView.vala', ++ 'Widgets/AppMenu.vala', ++ 'Widgets/AsyncImage.vala', ++ 'Widgets/Avatar.vala', ++ 'Widgets/CellRendererBadge.vala', ++ 'Widgets/CellRendererExpander.vala', ++ 'Widgets/CollapsiblePaned.vala', ++ 'Widgets/CompositedWindow.vala', ++ 'Widgets/DatePicker.vala', ++ 'Widgets/DynamicNotebook.vala', ++ 'Widgets/HeaderLabel.vala', ++ 'Widgets/MessageDialog.vala', ++ 'Widgets/ModeButton.vala', ++ 'Widgets/ModeSwitch.vala', ++ 'Widgets/OverlayBar.vala', ++ 'Widgets/SeekBar.vala', ++ 'Widgets/SettingsSidebarRow.vala', ++ 'Widgets/SettingsSidebar.vala', ++ 'Widgets/SourceList.vala', ++ 'Widgets/StorageBar.vala', ++ 'Widgets/TimePicker.vala', ++ 'Widgets/Toast.vala', ++ 'Widgets/Utils.vala', ++ 'Widgets/WelcomeButton.vala', ++ 'Widgets/Welcome.vala', ++ ++ 'Widgets/widgets-utils.c', ++) ++ ++# define all the names and versions ++granite_gi_name = 'Granite' ++granite_gi_version = '1.0' ++ ++granite_gi = granite_gi_name + '-' + granite_gi_version ++granite_gir = granite_gi + '.gir' ++granite_typelib = granite_gi + '.typelib' ++ ++include_dir = join_paths( ++ get_option('prefix'), ++ get_option('includedir'), ++ 'granite' ++) ++ ++# compile shared library, generate GIR, header, and vapi file ++libgranite = library( ++ 'granite', ++ ++ libgranite_sources, ++ ++ dependencies: [ ++ libgranite_deps, ++ meson.get_compiler('c').find_library('m'), ++ meson.get_compiler('vala').find_library('posix') ++ ], ++ ++ vala_header: 'granite.h', ++ vala_vapi: 'granite.vapi', ++ vala_gir: granite_gir, ++ ++ version: meson.project_version(), ++ install: true, ++ install_dir: [true, include_dir, true, true], ++) ++ ++install_data( ++ 'granite.deps', ++ install_dir: join_paths(get_option('datadir'), 'vala', 'vapi') ++) ++ ++install_data( ++ 'Widgets/widgets-utils.h', ++ install_dir: include_dir ++) ++ ++# typelib generation isn't automated yet ++g_ir_compiler = find_program('g-ir-compiler') ++custom_target( ++ granite_typelib, ++ command: [ ++ g_ir_compiler, ++ '--shared-library', ++ libgranite.full_path(), ++ '--output', ++ '@OUTPUT@', ++ join_paths(meson.current_build_dir(), granite_gir), ++ ], ++ output: granite_typelib, ++ depends: libgranite, ++ install: true, ++ install_dir: join_paths(get_option('libdir'), 'girepository-1.0'), ++) ++ ++libgranite_dep = declare_dependency( ++ link_with: libgranite, ++ dependencies: libgranite_deps, ++ include_directories: [include_directories('.')], ++) ++ ++# generate pkgconfig file ++granite_pc = pkgconfig.generate( ++ libgranite, ++ name: 'granite', ++ subdirs: ['granite'], ++ description: 'elementary\'s Application Framework', ++ version: meson.project_version(), ++ url: 'https://github.com/elementary/granite', ++) ++ +diff --git a/meson.build b/meson.build +new file mode 100644 +index 00000000..8b98eeb7 +--- /dev/null ++++ b/meson.build +@@ -0,0 +1,72 @@ ++project( ++ 'granite', ++ 'vala', 'c', ++ version: '5.2.2' ++) ++ ++if meson.get_compiler('vala').version().version_compare('<0.40.0') ++ error('vala compiler version 0.40.0 or newer is required.') ++endif ++ ++add_project_arguments( ++ '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), ++ language: ['c'] ++) ++ ++if build_machine.system() == 'linux' ++ vala_os_arg = ['--define=LINUX'] ++elif build_machine.system() == 'dragonfly' ++ vala_os_arg = ['--define=DRAGON_FLY'] ++elif build_machine.system() == 'freebsd' ++ vala_os_arg = ['--define=FREE_BSD'] ++elif build_machine.system() == 'netbsd' ++ vala_os_arg = ['--define=NET_BSD'] ++else ++ vala_os_arg = [] ++endif ++ ++glib_min_version = '2.50' ++ ++add_project_arguments( ++ vala_os_arg, ++ '--abi-stability', ++ '--hide-internal', ++ '--target-glib=' + glib_min_version, ++ '--thread', ++ language: ['vala'] ++) ++ ++libgranite_deps = [ ++ dependency('gee-0.8'), ++ dependency('gio-2.0', version: '>=' + glib_min_version), ++ dependency('gio-unix-2.0', version: '>=' + glib_min_version), ++ dependency('glib-2.0', version: '>=' + glib_min_version), ++ dependency('gobject-2.0', version: '>=' + glib_min_version), ++ dependency('gtk+-3.0', version: '>=3.22'), ++] ++ ++icons_dir = join_paths( ++ get_option('prefix'), ++ get_option('datadir'), ++ 'icons', ++ 'hicolor' ++) ++ ++pkgconfig = import('pkgconfig') ++i18n = import('i18n') ++ ++subdir('lib') ++subdir('demo') ++subdir('icons') ++subdir('po') ++ ++if get_option('documentation') ++ subdir('doc') ++endif ++ ++# set up post-install script to refresh the GTK icon cache ++meson.add_install_script( ++ join_paths(meson.current_source_dir(), 'meson', 'post_install.py'), ++ '--iconsdir', icons_dir, ++) ++ +diff --git a/meson/post_install.py b/meson/post_install.py +new file mode 100755 +index 00000000..18645152 +--- /dev/null ++++ b/meson/post_install.py +@@ -0,0 +1,16 @@ ++#!/usr/bin/env python3 ++ ++import argparse ++import os ++import subprocess ++ ++parser = argparse.ArgumentParser() ++parser.add_argument("--iconsdir", action="store", required=True) ++args = vars(parser.parse_args()) ++ ++icons_dir = args["iconsdir"] ++ ++if not os.environ.get('DESTDIR'): ++ print('Compiling icon cache ...') ++ subprocess.run(['gtk-update-icon-cache', icons_dir]) ++ +diff --git a/meson_options.txt b/meson_options.txt +new file mode 100644 +index 00000000..9d9f62e9 +--- /dev/null ++++ b/meson_options.txt +@@ -0,0 +1 @@ ++option('documentation', type: 'boolean', value: false, description: 'generate documentation with gtk-doc and valadoc') +diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt +deleted file mode 100644 +index bb7ec0d3..00000000 +--- a/po/CMakeLists.txt ++++ /dev/null +@@ -1,3 +0,0 @@ +-include (Translations) +-add_translations_directory ("${GETTEXT_PACKAGE}") +-add_translations_catalog ("${GETTEXT_PACKAGE}" ../lib/ ../demo/) +\ No newline at end of file +diff --git a/po/LINGUAS b/po/LINGUAS +new file mode 100644 +index 00000000..4ace4d3f +--- /dev/null ++++ b/po/LINGUAS +@@ -0,0 +1,196 @@ ++aa ++ab ++ae ++af ++ak ++am ++an ++ar ++as ++ast ++av ++ay ++az ++ba ++be ++bg ++bh ++bi ++bm ++bn ++bo ++br ++bs ++ca ++ce ++ch ++ckb ++co ++cr ++cs ++cu ++cv ++cy ++da ++de ++dv ++dz ++ee ++el ++en_AU ++en_CA ++en_GB ++eo ++es ++et ++eu ++fa ++ff ++fi ++fj ++fo ++fr ++fr_CA ++fy ++ga ++gd ++gl ++gn ++gu ++gv ++ha ++he ++hi ++ho ++hr ++ht ++hu ++hy ++hz ++ia ++id ++ie ++ig ++ii ++ik ++io ++is ++it ++iu ++ja ++jv ++ka ++kg ++ki ++kj ++kk ++kl ++km ++kn ++ko ++kr ++ks ++ku ++kv ++kw ++ky ++la ++lb ++lg ++li ++ln ++lo ++lt ++lu ++lv ++mg ++mh ++mi ++mk ++ml ++mn ++mo ++mr ++ms ++mt ++my ++na ++nb ++nd ++ne ++ng ++nl ++nn ++no ++nr ++nv ++ny ++oc ++oj ++om ++or ++os ++pa ++pi ++pl ++ps ++pt ++pt_BR ++qu ++rm ++rn ++ro ++ru ++rue ++rw ++sa ++sc ++sd ++se ++sg ++si ++sk ++sl ++sm ++sma ++sn ++so ++sq ++sr ++ss ++st ++su ++sv ++sw ++ta ++te ++tg ++th ++ti ++tk ++tl ++tn ++to ++tr ++ts ++tt ++tw ++ty ++ug ++uk ++ur ++uz ++ve ++vi ++vo ++wa ++wo ++xh ++yi ++yo ++za ++zh ++zh_CN ++zh_HK ++zh_TW ++zu +diff --git a/po/meson.build b/po/meson.build +new file mode 100644 +index 00000000..0bf6f0f3 +--- /dev/null ++++ b/po/meson.build +@@ -0,0 +1,6 @@ ++i18n.gettext( ++ meson.project_name(), ++ args: '--directory=' + meson.source_root(), ++ preset: 'glib' ++) ++ diff --git a/01-meson-pkgconfig-requires-fix.patch b/01-meson-pkgconfig-requires-fix.patch new file mode 100644 index 0000000..9ff1c03 --- /dev/null +++ b/01-meson-pkgconfig-requires-fix.patch @@ -0,0 +1,22 @@ +From f1b29f52e3aaf0f5d6bba44c42617da265f679c8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Corentin=20No=C3=ABl?= +Date: Tue, 18 Dec 2018 11:37:48 +0100 +Subject: [PATCH] meson: bring back the dependencies to the Require field of + the pkgconfig + +--- + lib/meson.build | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/meson.build b/lib/meson.build +index a126dd1f..4967e4b0 100644 +--- a/lib/meson.build ++++ b/lib/meson.build +@@ -122,6 +122,7 @@ libgranite_dep = declare_dependency( + granite_pc = pkgconfig.generate( + libgranite, + name: 'granite', ++ requires: libgranite_deps, + subdirs: ['granite'], + description: 'elementary\'s Application Framework', + version: meson.project_version(), diff --git a/02-datetime-clock-format-gsettings.patch b/02-datetime-clock-format-gsettings.patch new file mode 100644 index 0000000..c5738ab --- /dev/null +++ b/02-datetime-clock-format-gsettings.patch @@ -0,0 +1,129 @@ +From 698e34dd6e8d98a1818ae00d3313b69a86340771 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Mon, 17 Dec 2018 14:58:14 +0100 +Subject: DateTime: include "clock-format" gsettings key here + +--- + data/io.elementary.granite.gschema.xml | 15 +++++++++++++++ + data/meson.build | 4 ++++ + lib/DateTime.vala | 4 ++-- + meson.build | 11 +++++++++++ + meson/post_install.py | 5 +++++ + 5 files changed, 37 insertions(+), 2 deletions(-) + create mode 100644 data/io.elementary.granite.gschema.xml + create mode 100644 data/meson.build + +diff --git a/data/io.elementary.granite.gschema.xml b/data/io.elementary.granite.gschema.xml +new file mode 100644 +index 0000000..1540fb0 +--- /dev/null ++++ b/data/io.elementary.granite.gschema.xml +@@ -0,0 +1,15 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ "12h" ++ Whether the clock displays in 12h or 24h format ++ Whether the clock displays in 12h or 24h format ++ ++ ++ +diff --git a/data/meson.build b/data/meson.build +new file mode 100644 +index 0000000..96cc3b1 +--- /dev/null ++++ b/data/meson.build +@@ -0,0 +1,4 @@ ++install_data( ++ rdnn + '.gschema.xml', ++ install_dir: schema_dir ++) +diff --git a/lib/DateTime.vala b/lib/DateTime.vala +index aea2ec6..3d81191 100644 +--- a/lib/DateTime.vala ++++ b/lib/DateTime.vala +@@ -104,13 +104,13 @@ namespace Granite.DateTime { + } + + /** +- * Gets the //clock-format// key from //org.gnome.desktop.interface// schema ++ * Gets the //clock-format// key from //io.elementary.granite// schema + * and determines if the clock format is 12h based + * + * @return true if the clock format is 12h based, false otherwise. + */ + private static bool is_clock_format_12h () { +- var h24_settings = new Settings ("io.elementary.desktop.wingpanel.datetime"); ++ var h24_settings = new Settings ("io.elementary.granite"); + var format = h24_settings.get_string ("clock-format"); + return (format.contains ("12h")); + } +diff --git a/meson.build b/meson.build +index 8b98eeb..f0abcdf 100644 +--- a/meson.build ++++ b/meson.build +@@ -4,6 +4,8 @@ project( + version: '5.2.2' + ) + ++rdnn = 'io.elementary.' + meson.project_name() ++ + if meson.get_compiler('vala').version().version_compare('<0.40.0') + error('vala compiler version 0.40.0 or newer is required.') + endif +@@ -52,10 +54,18 @@ icons_dir = join_paths( + 'hicolor' + ) + ++schema_dir = join_paths( ++ get_option('prefix'), ++ get_option('datadir'), ++ 'glib-2.0', ++ 'schemas' ++) ++ + pkgconfig = import('pkgconfig') + i18n = import('i18n') + + subdir('lib') ++subdir('data') + subdir('demo') + subdir('icons') + subdir('po') +@@ -68,5 +78,6 @@ endif + meson.add_install_script( + join_paths(meson.current_source_dir(), 'meson', 'post_install.py'), + '--iconsdir', icons_dir, ++ '--schemadir', schema_dir, + ) + +diff --git a/meson/post_install.py b/meson/post_install.py +index 1864515..5313f96 100755 +--- a/meson/post_install.py ++++ b/meson/post_install.py +@@ -6,11 +6,16 @@ import subprocess + + parser = argparse.ArgumentParser() + parser.add_argument("--iconsdir", action="store", required=True) ++parser.add_argument("--schemadir", action="store", required=True) + args = vars(parser.parse_args()) + + icons_dir = args["iconsdir"] ++schema_dir = args["schemadir"] + + if not os.environ.get('DESTDIR'): + print('Compiling icon cache ...') + subprocess.run(['gtk-update-icon-cache', icons_dir]) + ++ print('Compiling GSettings schemas ...') ++ subprocess.run(['glib-compile-schemas', schemadir]) ++ +-- +2.20.1 + diff --git a/granite.rpmlintrc b/granite.rpmlintrc new file mode 100644 index 0000000..19f784d --- /dev/null +++ b/granite.rpmlintrc @@ -0,0 +1,9 @@ +# that's the proper name +addFilter("W: summary-not-capitalized C *") + +# false positives +addFilter("E: invalid-lc-messages-dir /usr/share/locale/bh*") +addFilter("E: invalid-lc-messages-dir /usr/share/locale/mo*") + +# don't care about manpages for graphical applications +addFilter("W: no-manual-page-for-binary granite-demo *") diff --git a/granite.spec b/granite.spec index e0ba68b..2def941 100644 --- a/granite.spec +++ b/granite.spec @@ -1,15 +1,33 @@ +%global common_description %{expand: +Granite is a companion library for GTK+ and GLib. Among other things, it +provides complex widgets and convenience functions designed for use in +apps built for elementary.} + Name: granite Summary: elementary companion library for GTK+ and GLib -Version: 5.1.0 +Version: 5.2.2 Release: 1%{?dist} License: LGPLv3+ URL: https://github.com/elementary/%{name} Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz -BuildRequires: cmake >= 2.8 +# ported to meson, patch already accepted upstream +# https://github.com/elementary/granite/commit/2066b37 +Patch0: 00-meson-port.patch + +# small meson regression fix from upstream +# https://github.com/elementary/granite/commit/f1b29f5 +Patch1: 01-meson-pkgconfig-requires-fix.patch + +# move required "clock-format" gsettings key from wingpanel-indicator-datetime: +# this is a temporary fix - especially for third-party applications - until +# this issue can be resolved better upstream +Patch2: 02-datetime-clock-format-gsettings.patch + BuildRequires: desktop-file-utils BuildRequires: gettext +BuildRequires: meson BuildRequires: vala >= 0.40 BuildRequires: pkgconfig(gee-0.8) @@ -20,39 +38,28 @@ BuildRequires: pkgconfig(gobject-introspection-1.0) # granite provides and needs some generic icons Requires: hicolor-icon-theme - -%description -Granite is a companion library for GTK+ and GLib. Among other things, it -provides complex widgets and convenience functions designed for use in -apps built for elementary. +%description %{common_description} %package devel Summary: Granite Toolkit development headers Requires: %{name}%{?_isa} = %{version}-%{release} -%description devel -Granite is a companion library for GTK+ and GLib. Among other things, it -provides complex widgets and convenience functions designed for use in -apps built for elementary. +%description devel %{common_description} This package contains the development headers. %prep -%autosetup +%autosetup -p1 %build -mkdir build && pushd build -%cmake .. -%make_build -popd +%meson +%meson_build %install -pushd build -%make_install -popd +%meson_install %find_lang granite @@ -67,15 +74,21 @@ desktop-file-validate \ %license COPYING %{_libdir}/libgranite.so.5 -%{_libdir}/libgranite.so.5.0 +%{_libdir}/libgranite.so.5.* + %{_libdir}/girepository-1.0/Granite-1.0.typelib +%{_datadir}/glib-2.0/schemas/io.elementary.granite.gschema.xml + %{_datadir}/icons/hicolor/*/actions/appointment.svg %{_datadir}/icons/hicolor/*/actions/open-menu.svg %{_datadir}/icons/hicolor/scalable/actions/open-menu-symbolic.svg %files devel +%doc README.md +%license COPYING + %{_bindir}/granite-demo %{_libdir}/libgranite.so @@ -90,6 +103,15 @@ desktop-file-validate \ %changelog +* Mon Dec 17 2018 Fabio Valentini - 5.2.2-1 +- Update to version 5.2.2. +- Add patch to fix a meson regression with the pkgconfig file. + +* Sun Dec 16 2018 Fabio Valentini - 5.2.1-1 +- Update to version 5.2.1. +- Port to meson. +- Resolve circular dependencies within Pantheon and fix third-party applications. + * Mon Aug 27 2018 Fabio Valentini - 5.1.0-1 - Update to version 5.1.0. diff --git a/sources b/sources index df30753..6def3ae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (granite-5.1.0.tar.gz) = 23d26205ddc90d4da95674127b9c61c6e961f149b18893856e32f3af233ba0f331b7cdecf022abb10a20036911d9b738258dee539b653f1731126ca724c04e07 +SHA512 (granite-5.2.2.tar.gz) = 25678bd0792e16c285f6e4c7787c25727fc70279d057a59531413009f1bde25abaaba892d58808637de9edc1d4e9674572b8367e8fa2b0b3a2b887d9d6d42c83