From 2d51d78363d526867853fbc5819fe4c9063c520c Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 06:25:26 -0300 Subject: [PATCH 01/13] Remove cmake files --- CMakeLists.txt | 129 ------------- cmake/FindGirCompiler.cmake | 56 ------ cmake/FindVala.cmake | 65 ------- cmake/GObjectIntrospectionMacros.cmake | 34 ---- cmake/GResource.cmake | 67 ------- cmake/GSettings.cmake | 42 ----- cmake/ParseArguments.cmake | 36 ---- cmake/README | 10 - cmake/README.Vala.rst | 173 ----------------- cmake/Tests.cmake | 5 - cmake/Translations.cmake | 203 -------------------- cmake/ValaPrecompile.cmake | 251 ------------------------- cmake/ValaVersion.cmake | 96 ---------- cmake_uninstall.cmake.in | 21 --- po/CMakeLists.txt | 9 - schemas/CMakeLists.txt | 3 - src/Config.vala.cmake | 37 ---- 17 files changed, 1237 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 cmake/FindGirCompiler.cmake delete mode 100644 cmake/FindVala.cmake delete mode 100644 cmake/GObjectIntrospectionMacros.cmake delete mode 100644 cmake/GResource.cmake delete mode 100644 cmake/GSettings.cmake delete mode 100644 cmake/ParseArguments.cmake delete mode 100644 cmake/README delete mode 100644 cmake/README.Vala.rst delete mode 100644 cmake/Tests.cmake delete mode 100644 cmake/Translations.cmake delete mode 100644 cmake/ValaPrecompile.cmake delete mode 100644 cmake/ValaVersion.cmake delete mode 100644 cmake_uninstall.cmake.in delete mode 100644 po/CMakeLists.txt delete mode 100644 schemas/CMakeLists.txt delete mode 100644 src/Config.vala.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index a923597..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,129 +0,0 @@ - -# project name -project (com.github.tomatoers.tomato) - -# the oldest stable cmake version we support -cmake_minimum_required (VERSION 2.8) - -# tell cmake where its modules can be found in our project directory -list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) - -set (APP_NAME "Tomato") -set (RELEASE_NAME "Stupice") -set (VERSION "2.0.2") -set (GENERIC_NAME "Pomodoro App") -set (PACKAGE_ID ${CMAKE_PROJECT_NAME}) -set (ICON_NAME ${CMAKE_PROJECT_NAME}) -set (EXEC_NAME ${CMAKE_PROJECT_NAME}) -set (COMMENT "Keep focused on your work") -set (DESCRIPTION "Tomato is a clean, easy-to-use time manager based on Pomodoro technique. It breaks down work into intervals to keep you focused and allows you to rest during strategic periods to reward your progress. It is a must-have app if you need to avoid procrastination.") -set (VERSION_INFO "Release") -set (ENCODING "UTF-8") -set (GETTEXT_PACKAGE "${CMAKE_PROJECT_NAME}") - -# where we install data directory (if we have any) -include (GNUInstallDirs) -set (CMAKE_INSTALL_PREFIX "/usr") -set (DATADIR ${CMAKE_INSTALL_PREFIX}/share) -set (PKG_DATADIR ${DATADIR}/${CMAKE_PROJECT_NAME}) - -include(InstallRequiredSystemLibraries) -add_definitions(-w) # Disable gcc warnings - -# Add 'make dist' command for creating release tarball -set (CPACK_PACKAGE_VERSION ${VERSION}) -set (CPACK_SOURCE_GENERATOR "TGZ") -set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") -set (CPACK_SOURCE_IGNORE_FILES "/build/;/.bzr/;/.bzrignore;~$;${CPACK_SOURCE_IGNORE_FILES}") - -include (CPack) -add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) - -# Add 'make uninstall' command to remove installed files -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) - -add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) - -# we're about to use pkgconfig to make sure dependencies are installed so let's find pkgconfig first -find_package(PkgConfig) - -# now let's actually check for the required dependencies -set (DEPS_PACKAGES - gtk+-3.0 - granite - libcanberra - unity -) - -pkg_check_modules(DEPS REQUIRED ${DEPS_PACKAGES}) - -add_definitions(${DEPS_CFLAGS}) -link_libraries(${DEPS_LIBRARIES}) -link_directories(${DEPS_LIBRARY_DIRS}) - -# make sure we have vala -find_package(Vala REQUIRED) -# make sure we use vala -include(ValaVersion) -# make sure it's the desired version of vala -ensure_vala_version("0.22" MINIMUM) - -# define variable for sources -set (SOURCE_LIST - src/Config.vala - src/Services.vala - src/Util/Countdown.vala - src/Util/Timer.vala - src/Managers/SoundManager.vala - src/Managers/NotificationManager.vala - src/Managers/LauncherManager.vala - src/Managers/WorkManager.vala - src/Windows/MainWindow.vala - src/Windows/PreferencesDialog.vala - src/Widgets/ValueRange.vala - src/Widgets/Slide.vala - src/Widgets/Screen.vala - src/Tomato.vala -) - -# Some configuration -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_CURRENT_SOURCE_DIR}/src/Config.vala) - -# files we want to compile -include(ValaPrecompile) -vala_precompile(VALA_C ${EXEC_NAME} - ${SOURCE_LIST} -PACKAGES - ${DEPS_PACKAGES} -) - -add_executable(${EXEC_NAME} ${VALA_C}) - -# install the binaries we just made -install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin) - -add_subdirectory (schemas) -add_subdirectory (po) -add_subdirectory(data) - -# add translation support -add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\") - -# custom command to update pot template files -set (_pot_file po/${PROJECT_NAME}.pot) -add_custom_command (OUTPUT ${_pot_file} - COMMAND xgettext --output=${_pot_file} ${SOURCE_LIST} --from-code=${ENCODING} - DEPENDS ${SOURCE_LIST} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Extract translatable messages to ${_pot_file}") - -add_custom_target (pot_file ALL DEPENDS ${_pot_file}) - -# test data files -include (CTest) -add_test (NAME validate-desktop-file COMMAND desktop-file-validate ${CMAKE_CURRENT_SOURCE_DIR}/data/${PACKAGE_ID}.desktop) -add_test (NAME validate-appdata COMMAND appstreamcli validate ${CMAKE_CURRENT_SOURCE_DIR}/data/${PACKAGE_ID}.appdata.xml) diff --git a/cmake/FindGirCompiler.cmake b/cmake/FindGirCompiler.cmake deleted file mode 100644 index ccec563..0000000 --- a/cmake/FindGirCompiler.cmake +++ /dev/null @@ -1,56 +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 Gir compiler (g-ir-compiler) -# -# This module determines wheter a Gir compiler is installed on the current -# system and where its executable is. -# -# Call the module using "find_package(GirCompiler) from within your CMakeLists.txt. -# -# The following variables will be set after an invocation: -# -# G_IR_COMPILER_FOUND Whether the g-ir-compiler compiler has been found or not -# G_IR_COMPILER_EXECUTABLE Full path to the g-ir-compiler executable if it has been found -## - - -# Search for the g-ir-compiler executable in the usual system paths. -find_program (G_IR_COMPILER_EXECUTABLE - NAMES g-ir-compiler) - -# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call. -# Furthermore set G_IR_COMPILER_FOUND to TRUE if the g-ir-compiler has been found (aka. -# G_IR_COMPILER_EXECUTABLE is set) - -include (FindPackageHandleStandardArgs) -find_package_handle_standard_args (GirCompiler DEFAULT_MSG G_IR_COMPILER_EXECUTABLE) - -mark_as_advanced (G_IR_COMPILER_EXECUTABLE) diff --git a/cmake/FindVala.cmake b/cmake/FindVala.cmake deleted file mode 100644 index aa3a6e7..0000000 --- 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 6a0dc0b..0000000 --- a/cmake/GObjectIntrospectionMacros.cmake +++ /dev/null @@ -1,34 +0,0 @@ -macro(add_target_gir TARGET_NAME GIR_NAME HEADER CFLAGS GRANITE_VERSION) - set(PACKAGES "") - foreach(PKG ${ARGN}) - set(PACKAGES ${PACKAGES} --include=${PKG}) - endforeach() - install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\") - execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME} - --quiet - --library ${TARGET_NAME} ${PACKAGES} - -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir - -L${CMAKE_CURRENT_BINARY_DIR} - --nsversion=${GRANITE_VERSION} ${HEADER})") - install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)") - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/) -endmacro() - -macro(add_target_gir_with_executable TARGET_NAME EXE_NAME GIR_NAME HEADER EXE_HEADER CFLAGS GRANITE_VERSION) - set(PACKAGES "") - foreach(PKG ${ARGN}) - set(PACKAGES ${PACKAGES} --include=${PKG}) - endforeach() - install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\") - execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME} - --quiet - --library ${TARGET_NAME} --program ${EXE_NAME} ${PACKAGES} - -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir - -L${CMAKE_CURRENT_BINARY_DIR} - -I${CMAKE_CURRENT_BINARY_DIR} - --nsversion=${GRANITE_VERSION} ${HEADER} ${EXE_HEADER})") - install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)") - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/) -endmacro() diff --git a/cmake/GResource.cmake b/cmake/GResource.cmake deleted file mode 100644 index eff49cc..0000000 --- a/cmake/GResource.cmake +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright (C) 2013 Venom authors and contributors -# -# This file is part of Venom. -# -# Venom is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Venom is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Venom. If not, see . -# - -FIND_PROGRAM(GLIB_COMPILE_RESOURCES_EXECUTABLE NAMES glib-compile-resources) -MARK_AS_ADVANCED(GLIB_COMPILE_RESOURCES_EXECUTABLE) - -INCLUDE(CMakeParseArguments) - -FUNCTION(GLIB_COMPILE_RESOURCES output) - CMAKE_PARSE_ARGUMENTS(ARGS "" "SOURCE" ${ARGN}) - SET(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - SET(out_files "") - - FOREACH(src ${ARGS_SOURCE} ${ARGS_UNPARSED_ARGUMENTS}) - SET(in_file "${CMAKE_CURRENT_SOURCE_DIR}/${src}") - GET_FILENAME_COMPONENT(WORKING_DIR ${in_file} PATH) - STRING(REPLACE ".xml" ".c" src ${src}) - SET(out_file "${DIRECTORY}/${src}") - GET_FILENAME_COMPONENT(OUPUT_DIR ${out_file} PATH) - FILE(MAKE_DIRECTORY ${OUPUT_DIR}) - LIST(APPEND out_files "${DIRECTORY}/${src}") - - #FIXME implicit depends currently not working - EXECUTE_PROCESS( - COMMAND - ${GLIB_COMPILE_RESOURCES_EXECUTABLE} - "--generate-dependencies" - ${in_file} - WORKING_DIRECTORY ${WORKING_DIR} - OUTPUT_VARIABLE in_file_dep - ) - STRING(REGEX REPLACE "(\r?\n)" ";" in_file_dep "${in_file_dep}") - SET(in_file_dep_path "") - FOREACH(dep ${in_file_dep}) - LIST(APPEND in_file_dep_path "${WORKING_DIR}/${dep}") - ENDFOREACH(dep ${in_file_dep}) - ADD_CUSTOM_COMMAND( - OUTPUT ${out_file} - WORKING_DIRECTORY ${WORKING_DIR} - COMMAND - ${GLIB_COMPILE_RESOURCES_EXECUTABLE} - ARGS - "--generate-source" - "--target=${out_file}" - ${in_file} - DEPENDS - ${in_file};${in_file_dep_path} - ) - ENDFOREACH(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS}) - SET(${output} ${out_files} PARENT_SCOPE) -ENDFUNCTION(GLIB_COMPILE_RESOURCES) diff --git a/cmake/GSettings.cmake b/cmake/GSettings.cmake deleted file mode 100644 index 8fd745c..0000000 --- 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/ParseArguments.cmake b/cmake/ParseArguments.cmake deleted file mode 100644 index 717c0f5..0000000 --- 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 9d45b32..0000000 --- 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 bcc59b7..0000000 --- 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/Tests.cmake b/cmake/Tests.cmake deleted file mode 100644 index 76ba0b7..0000000 --- a/cmake/Tests.cmake +++ /dev/null @@ -1,5 +0,0 @@ -# Test macros for Marlin, feel free to re-use them. - -macro(add_test_executable EXE_NAME) - add_test(${EXE_NAME} gtester ${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}) -endmacro() diff --git a/cmake/Translations.cmake b/cmake/Translations.cmake deleted file mode 100644 index 880e93a..0000000 --- a/cmake/Translations.cmake +++ /dev/null @@ -1,203 +0,0 @@ -# Translations.cmake, CMake macros written for Marlin, feel free to re-use them -include(CMakeParseArguments) - -macro (add_translations_directory NLS_PACKAGE) - add_custom_target (i18n ALL COMMENT “Building i18n messages.”) - find_program (MSGFMT_EXECUTABLE msgfmt) - # 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) - foreach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED}) - create_po_file (${LANGUAGE_NEEDED}) - 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) - set (FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LANGUAGE_NEEDED}.po) - if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${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(SOURCE_DIRECTORY ${SOURCE} DIRECTORY) - file(MAKE_DIRECTORY ${SOURCE_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) - - set(EXTRA_PO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extra) - - 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 ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot - ${XGETTEXT_C_ARGS} --from-code=UTF-8) - - set(EXTRA_XGETTEXT_COMMAND - ${XGETTEXT_EXECUTABLE} -d extra - -o ${EXTRA_PO_DIR}/extra.pot --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() - - # We need to create the directory if one extra content exists. - IF((NOT "${ARGS_DESKTOP_FILES}" STREQUAL "") OR (NOT "${ARGS_APPDATA_SOURCE}" STREQUAL "") OR (NOT "${ARGS_SCHEMA_SOURCE}" STREQUAL "")) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/extra/) - 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() -endmacro () diff --git a/cmake/ValaPrecompile.cmake b/cmake/ValaPrecompile.cmake deleted file mode 100644 index f0248d6..0000000 --- a/cmake/ValaPrecompile.cmake +++ /dev/null @@ -1,251 +0,0 @@ -## -# Copyright 2009-2010 Jakob Westhoff. All rights reserved. -# Copyright 2012 elementary. -# -# 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}) - string(REGEX MATCH "^/" IS_MATCHED ${src}) - if(${IS_MATCHED} MATCHES "/") - set(src_file_path ${src}) - else() - set(src_file_path ${CMAKE_CURRENT_SOURCE_DIR}/${src}) - endif() - list(APPEND in_files ${src_file_path}) - string(REPLACE ".vala" ".c" src ${src}) - string(REPLACE ".gs" ".c" src ${src}) - if(${IS_MATCHED} MATCHES "/") - get_filename_component(VALA_FILE_NAME ${src} NAME) - set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}") - list(APPEND out_files "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}") - else() - set(out_file "${DIRECTORY}/${src}") - list(APPEND out_files "${DIRECTORY}/${src}") - endif() - list(APPEND ${output} ${out_file}) - list(APPEND out_files_display "${src}") - endforeach(src ${ARGS_DEFAULT_ARGS}) - - set(custom_vapi_arguments "") - if(ARGS_CUSTOM_VAPIS) - # Check for relative and absolute paths - foreach(vapi ${ARGS_CUSTOM_VAPIS}) - string(REGEX MATCH "^/" IS_MATCHED ${vapi}) - if(${IS_MATCHED} MATCHES "/") - list(APPEND custom_vapi_arguments ${vapi}) - else() - list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi}) - endif() - 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") - - # Header and internal header is needed to generate internal vapi - if (NOT ARGS_GENERATE_HEADER) - set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI}) - endif(NOT ARGS_GENERATE_HEADER) - 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 "") - set(gircomp_command "") - 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") - - include (FindGirCompiler) - find_package(GirCompiler REQUIRED) - - set(gircomp_command - COMMAND - ${G_IR_COMPILER_EXECUTABLE} - ARGS - "${DIRECTORY}/${ARGS_GENERATE_GIR}.gir" - -o "${DIRECTORY}/${ARGS_GENERATE_GIR}.typelib") - 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} - "-g" - ${in_files} - ${custom_vapi_arguments} - COMMAND - touch - ARGS - ${OUTPUT_STAMP} - DEPENDS - ${in_files} - ${ARGS_CUSTOM_VAPIS} - COMMENT - "Generating ${out_files_display}" - ${gircomp_command} - ) - - # 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 3fff193..0000000 --- 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/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in deleted file mode 100644 index 2037e36..0000000 --- a/cmake_uninstall.cmake.in +++ /dev/null @@ -1,21 +0,0 @@ -if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - -file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -string(REGEX REPLACE "\n" ";" files "${files}") -foreach(file ${files}) - message(STATUS "Uninstalling $ENV{DESTDIR}${file}") - if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - if(NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") - endif(NOT "${rm_retval}" STREQUAL 0) - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt deleted file mode 100644 index d34d56c..0000000 --- a/po/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -include (Translations) -add_translations_directory (${GETTEXT_PACKAGE}) -add_translations_catalog (${GETTEXT_PACKAGE} - ../src - DESKTOP_FILES - ${CMAKE_BINARY_DIR}/${PACKAGE_ID}.desktop.in - APPDATA_FILES - ${CMAKE_BINARY_DIR}/${PACKAGE_ID}.appdata.xml.in -) diff --git a/schemas/CMakeLists.txt b/schemas/CMakeLists.txt deleted file mode 100644 index 5dc55d5..0000000 --- a/schemas/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ - -include(GSettings) -add_schema("com.github.tomatoers.tomato.gschema.xml") diff --git a/src/Config.vala.cmake b/src/Config.vala.cmake deleted file mode 100644 index a452e77..0000000 --- a/src/Config.vala.cmake +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2015 LuizAugustoMorais -* -* This file is part of Tomato. -* -* Tomato is free software: you can redistribute it -* and/or modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Tomato is distributed in the hope that it will be -* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -* Public License for more details. -* -* You should have received a copy of the GNU General Public License along -* with Tomato. If not, see http://www.gnu.org/licenses/. -*/ - -namespace Constants { - public const string DATADIR = "@DATADIR@"; - public const string PKG_DATADIR = "@PKG_DATADIR@"; - public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"; - public const string RELEASE_NAME = "@RELEASE_NAME@"; - public const string VERSION = "@VERSION@"; - public const string VERSION_INFO = "@VERSION_INFO@"; - public const string INSTALL_PREFIX = "@CMAKE_INSTALL_PREFIX@"; - public const string APP_NAME = "@APP_NAME@"; - public const string EXEC_NAME = "@EXEC_NAME@"; - public const string ICON_NAME = "@ICON_NAME@"; -} - -namespace Default { - public const int POMODORO_DURATION = 25; - public const int SHORT_BREAK_DURATION = 5; - public const int LONG_BREAK_DURATION = 15; - public const int LONG_BREAK_DELAY = 4; -} From 0576a250c017ace277e31a6d0b507ee4e30c2826 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 06:35:03 -0300 Subject: [PATCH 02/13] Add meson files --- data/meson.build | 84 ++++++++++++++++++++ meson.build | 70 +++++++++++++++++ po/LINGUAS | 196 +++++++++++++++++++++++++++++++++++++++++++++++ po/POTFILES | 9 +++ po/meson.build | 4 + post_install.py | 19 +++++ 6 files changed, 382 insertions(+) create mode 100644 data/meson.build create mode 100644 meson.build create mode 100644 po/LINGUAS create mode 100644 po/POTFILES create mode 100644 po/meson.build create mode 100755 post_install.py diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..2ddb0c8 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,84 @@ +icon_sizes = ['16', '22', '24', '32', '48', '64', '128', '256'] + +foreach i : icon_sizes + install_data ( + join_paths ('icons', i + 'x' + i, 'apps', meson.project_name () + '.png'), + install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps') + ) +endforeach + +install_data ( + join_paths ('icons', 'scalable', 'apps', meson.project_name () + '.svg'), + install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', 'scalable', 'apps') +) + +appdata = configure_file ( + input: meson.project_name () + '.appdata.xml.in', + output: meson.project_name () + '.appdata.xml.in', + configuration: config +) + +desktop = configure_file( + input: meson.project_name () + '.desktop.in', + output: meson.project_name () + '.desktop.in', + configuration: config +) + +i18n.merge_file ( + 'desktop', + input: desktop, + output: meson.project_name () + '.desktop', + install: true, + install_dir: join_paths (get_option ('datadir'), 'applications'), + po_dir: join_paths (meson.source_root (), 'po'), + type: 'desktop' +) + +i18n.merge_file ( + 'appdata', + input: appdata, + output: meson.project_name () + '.appdata.xml', + install: true, + install_dir: join_paths (get_option ('datadir'), 'metainfo'), + po_dir: join_paths (meson.source_root (), 'po') +) + +install_data ( + join_paths ('style', 'window.css'), + install_dir: join_paths (pkg_datadir, 'style') +) + +install_data ( + meson.project_name () + '.gschema.xml', + install_dir : join_paths (get_option ('datadir'), 'glib-2.0', 'schemas') +) + +dvf = find_program ('desktop-file-validate', required: false) +asc = find_program ('appstreamcli', required: false) +vala_lint = find_program ('io.elementary.vala-lint', required: false) + +if dvf.found () +test ( + 'Validate desktop file', + dvf, + args: join_paths (meson.current_build_dir (), meson.project_name () + '.desktop') +) +endif + + +if asc.found () +test ( + 'Validate appdata file', + asc, + args: ['validate', join_paths (meson.current_build_dir (), meson.project_name () + '.appdata.xml')] +) +endif + + +if vala_lint.found () + test ( + 'Validate Vala code style', + vala_lint, + args: ['-d', join_paths (meson.source_root (), 'src')] + ) +endif \ No newline at end of file diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..c709c68 --- /dev/null +++ b/meson.build @@ -0,0 +1,70 @@ +project( + 'com.github.tomatoers.tomato', 'vala', 'c', + version : '2.0.2', + license : 'LGPL2+' +) + +add_global_arguments ( + '-DGETTEXT_PACKAGE="' + meson.project_name () + '"', + language: 'c' +) + + +prefix = get_option ('prefix') +datadir = join_paths (prefix, get_option ('datadir')) +pkg_datadir = join_paths (datadir, meson.project_name ()) + +config = configuration_data () +config.set ('APP_NAME', 'Tomato') +config.set ('RELEASE_NAME', 'Stupice') +config.set ('VERSION', meson.project_version ()) +config.set ('GENERIC_NAME', 'Pomodoro App') +config.set ('PACKAGE_ID', meson.project_name ()) +config.set ('ICON_NAME', meson.project_name ()) +config.set ('EXEC_NAME', meson.project_name ()) +config.set ('COMMENT', 'Keep focused on your work') +config.set ('DESCRIPTION', 'Tomato is a clean, easy-to-use time manager based on Pomodoro technique. It breaks down work into intervals to keep you focused and allows you to rest during strategic periods to reward your progress. It is a must-have app if you need to avoid procrastination.') +config.set ('VERSION_INFO', 'Release') +config.set ('ENCODING', 'UTF-8') +config.set ('GETTEXT_PACKAGE', meson.project_name ()) +config.set ('PREFIX', prefix) +config.set ('DATADIR', datadir) +config.set ('PKG_DATADIR', pkg_datadir) + +build_config = configure_file ( + input: 'src/Config.vala.in', + output: 'Config.vala', + configuration: config +) + +dependencies = [ + dependency ('gtk+-3.0', version: '>=3.14'), + dependency ('granite', version: '>=0.4.0'), + dependency ('libcanberra'), + dependency ('unity') +] + +main = executable ( + meson.project_name (), + 'src/Services.vala', + 'src/Util/Countdown.vala', + 'src/Util/Timer.vala', + 'src/Managers/SoundManager.vala', + 'src/Managers/NotificationManager.vala', + 'src/Managers/LauncherManager.vala', + 'src/Managers/WorkManager.vala', + 'src/Windows/MainWindow.vala', + 'src/Windows/PreferencesDialog.vala', + 'src/Widgets/ValueRange.vala', + 'src/Widgets/Slide.vala', + 'src/Widgets/Screen.vala', + 'src/Tomato.vala', + build_config, + dependencies: dependencies, + install: true +) + +subdir ('po') +subdir ('data') + +meson.add_install_script ('post_install.py') \ No newline at end of file diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..ddd8e78 --- /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_CA +fr +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_BR +pt +qu +rm +rn +ro +rue +ru +rw +sa +sc +sd +se +sg +si +sk +sl +sma +sm +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_CN +zh_HK +zh +zh_TW +zu \ No newline at end of file diff --git a/po/POTFILES b/po/POTFILES new file mode 100644 index 0000000..4a3f5a3 --- /dev/null +++ b/po/POTFILES @@ -0,0 +1,9 @@ +src/Tomato.vala +src/Services.vala +src/Windows/PreferencesDialog.vala +src/Windows/MainWindow.vala +src/Util/Timer.vala +src/Util/Countdown.vala +src/Managers/NotificationManager.vala +data/com.github.tomatoers.tomato.appdata.xml.in +data/com.github.tomatoers.tomato.desktop.in \ No newline at end of file diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000..881935a --- /dev/null +++ b/po/meson.build @@ -0,0 +1,4 @@ +i18n = import('i18n') + +message ('Update translations…') +i18n.gettext(meson.project_name (), args: '--directory=' + meson.source_root (), preset: 'glib') \ No newline at end of file diff --git a/post_install.py b/post_install.py new file mode 100755 index 0000000..74cfdd1 --- /dev/null +++ b/post_install.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +from os import environ, path +from subprocess import call + +prefix = environ.get('MESON_INSTALL_PREFIX') +datadir = path.join(prefix, 'share') +destdir = environ.get('DESTDIR', '') + +# Package managers set this so we don't need to run +if not destdir: + print('Updating icon cache…') + call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) + + print('Updating desktop database…') + call(['update-desktop-database', '-q', path.join(datadir, 'applications')]) + + print('Compiling GSettings schemas…') + call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')]) From 91fd072ebe1bfc4f720c7f6a051dd59d8a6d1c6d Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 06:36:10 -0300 Subject: [PATCH 03/13] Rename config file --- src/{Config.vala => Config.vala.in} | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) rename src/{Config.vala => Config.vala.in} (53%) diff --git a/src/Config.vala b/src/Config.vala.in similarity index 53% rename from src/Config.vala rename to src/Config.vala.in index 9e24414..8033f27 100644 --- a/src/Config.vala +++ b/src/Config.vala.in @@ -17,21 +17,22 @@ */ namespace Constants { - public const string DATADIR = "/usr/share"; - public const string PKG_DATADIR = "/usr/share/com.github.tomatoers.tomato"; - public const string GETTEXT_PACKAGE = "com.github.tomatoers.tomato"; - public const string RELEASE_NAME = "Stupice"; - public const string VERSION = "2.0.2"; - public const string VERSION_INFO = "Release"; - public const string INSTALL_PREFIX = "/usr"; - public const string APP_NAME = "Tomato"; - public const string EXEC_NAME = "com.github.tomatoers.tomato"; - public const string ICON_NAME = "com.github.tomatoers.tomato"; + public const string DATADIR = "@DATADIR@"; + public const string PKG_DATADIR = "@PKG_DATADIR@"; + public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"; + public const string RELEASE_NAME = "@RELEASE_NAME@"; + public const string VERSION = "@VERSION@"; + public const string VERSION_INFO = "@VERSION_INFO@"; + public const string INSTALL_PREFIX = "@PREFIX@"; + public const string APP_NAME = "@APP_NAME@"; + public const string EXEC_NAME = "@EXEC_NAME@"; + public const string ICON_NAME = "@ICON_NAME@"; } namespace Default { public const int POMODORO_DURATION = 25; - public const int SHORT_BREAK_DURATION = 5; - public const int LONG_BREAK_DURATION = 15; - public const int LONG_BREAK_DELAY = 4; + public const int SHORT_BREAK_DURATION = 5; + public const int LONG_BREAK_DURATION = 15; + public const int LONG_BREAK_DELAY = 4; } + From c940d298820fe00de9cd8a9c83773b4376b0afe3 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 06:36:50 -0300 Subject: [PATCH 04/13] Move gschema to data --- {schemas => data}/com.github.tomatoers.tomato.gschema.xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {schemas => data}/com.github.tomatoers.tomato.gschema.xml (100%) diff --git a/schemas/com.github.tomatoers.tomato.gschema.xml b/data/com.github.tomatoers.tomato.gschema.xml similarity index 100% rename from schemas/com.github.tomatoers.tomato.gschema.xml rename to data/com.github.tomatoers.tomato.gschema.xml From 0d2a01d4dead81eaf3cb468bb2f3e2028d34f416 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 06:39:27 -0300 Subject: [PATCH 05/13] Rename desktop & appdata files --- data/CMakeLists.txt | 16 --- data/com.github.tomatoers.tomato.appdata.xml | 120 ------------------ ...om.github.tomatoers.tomato.appdata.xml.in} | 39 +++--- data/com.github.tomatoers.tomato.desktop | 19 --- ...=> com.github.tomatoers.tomato.desktop.in} | 8 +- 5 files changed, 25 insertions(+), 177 deletions(-) delete mode 100644 data/CMakeLists.txt delete mode 100644 data/com.github.tomatoers.tomato.appdata.xml rename data/{in/com.github.tomatoers.tomato.appdata.xml.in.in => com.github.tomatoers.tomato.appdata.xml.in} (79%) delete mode 100644 data/com.github.tomatoers.tomato.desktop rename data/{in/com.github.tomatoers.tomato.desktop.in.in => com.github.tomatoers.tomato.desktop.in} (74%) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt deleted file mode 100644 index 10a76d4..0000000 --- a/data/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -include (Translations) - -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/in/${PACKAGE_ID}.desktop.in.in ${CMAKE_CURRENT_SOURCE_DIR}/in/${PACKAGE_ID}.desktop.in) -configure_file_translation(${CMAKE_CURRENT_SOURCE_DIR}/in/${PACKAGE_ID}.desktop.in ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE_ID}.desktop ${CMAKE_SOURCE_DIR}/po/) -file(REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/in/${PACKAGE_ID}.desktop.in) - -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/in/${PACKAGE_ID}.appdata.xml.in.in ${CMAKE_CURRENT_SOURCE_DIR}/in/${PACKAGE_ID}.appdata.xml.in) -configure_file_translation(${CMAKE_CURRENT_SOURCE_DIR}/in/${PACKAGE_ID}.appdata.xml.in ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE_ID}.appdata.xml ${CMAKE_SOURCE_DIR}/po/) -file(REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/in/${PACKAGE_ID}.appdata.xml.in) - -# install our .desktop file so the Applications menu will see it -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE_ID}.appdata.xml DESTINATION ${DATADIR}/metainfo/) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE_ID}.desktop DESTINATION ${DATADIR}/applications) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/style/window.css DESTINATION ${PKG_DATADIR}/style) -install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/icons/ DESTINATION ${DATADIR}/icons/hicolor) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/scalable/apps/${ICON_NAME}.svg DESTINATION ${DATADIR}/pixmaps) diff --git a/data/com.github.tomatoers.tomato.appdata.xml b/data/com.github.tomatoers.tomato.appdata.xml deleted file mode 100644 index 8eed6ce..0000000 --- a/data/com.github.tomatoers.tomato.appdata.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - com.github.tomatoers.tomato.desktop - CC0 - GPL-2 - Tomato - Keep focused on your work - - -

Tomato is a clean, easy-to-use time manager based on Pomodoro technique. It breaks down work into intervals to keep you focused and allows you to rest during strategic periods to reward your progress. It is a must-have app if you need to avoid procrastination.

-
- - - - Pomodoro time - https://raw.githubusercontent.com/tomatoers/tomato/master/data/screenshots/pomodoro.png - - - - Start page - https://raw.githubusercontent.com/tomatoers/tomato/master/data/screenshots/start.png - - - - Short break time - https://raw.githubusercontent.com/tomatoers/tomato/master/data/screenshots/break.png - - - - Tomatoers - https://github.com/tomatoers/tomato - https://github.com/tomatoers/tomato/issues - https://github.com/tomatoers/tomato/issues - c@ssidyjam.es - - - #fff - #000 - - - - com.github.tomatoers.tomato - - - - - ⁠ -
    -
  • Updated URLs
  • -
- ⁠
-
- - - ⁠ -
    -
  • Solved app center issues
  • -
- ⁠
-
- - - ⁠ -
    -
  • UI redesign
  • -
  • Bug fixes
  • -
- ⁠
-
- - - ⁠ -
    -
  • Changed screenshots
  • -
  • Improved internationalization
  • -
  • Fixed minor bugs
  • -
- ⁠
-
- - - ⁠ -
    -
  • Fixed minor bugs
  • -
- ⁠
-
- - - ⁠ -
    -
  • Fixed minor bugs
  • -
- ⁠
-
- - - - - ⁠ -
    -
  • Revamped icons
  • -
  • Fixed minor bugs
  • -
- ⁠
-
- - - - - ⁠ -
    -
  • Notification when the app is auto stopped
  • -
  • Users can access preferences when the app is in break time
  • -
  • Integration with AppCenter
  • -
- ⁠
-
-
-
\ No newline at end of file diff --git a/data/in/com.github.tomatoers.tomato.appdata.xml.in.in b/data/com.github.tomatoers.tomato.appdata.xml.in similarity index 79% rename from data/in/com.github.tomatoers.tomato.appdata.xml.in.in rename to data/com.github.tomatoers.tomato.appdata.xml.in index 4b06e52..65b3eca 100644 --- a/data/in/com.github.tomatoers.tomato.appdata.xml.in.in +++ b/data/com.github.tomatoers.tomato.appdata.xml.in @@ -1,14 +1,14 @@ - @PACKAGE_ID@.desktop + @PACKAGE_ID@ CC0 GPL-2 @APP_NAME@ - <_summary>@COMMENT@ + @COMMENT@ - <_p>@DESCRIPTION@ +

@DESCRIPTION@

@@ -47,7 +47,7 @@
    - <_li>Updated URLs +
  • Updated URLs
@@ -55,7 +55,7 @@
    - <_li>Solved app center issues +
  • Solved app center issues
@@ -63,8 +63,8 @@
    - <_li>UI redesign - <_li>Bug fixes +
  • UI redesign
  • +
  • Bug fixes
@@ -72,9 +72,9 @@
    - <_li>Changed screenshots - <_li>Improved internationalization - <_li>Fixed minor bugs +
  • Changed screenshots
  • +
  • Improved internationalization
  • +
  • Fixed minor bugs
@@ -82,7 +82,7 @@
    - <_li>Fixed minor bugs +
  • Fixed minor bugs
@@ -90,18 +90,18 @@
    - <_li>Fixed minor bugs +
  • Fixed minor bugs
- +
    - <_li>Revamped icons - <_li>Fixed minor bugs +
  • Revamped icons
  • +
  • Fixed minor bugs
@@ -111,11 +111,14 @@
    - <_li>Notification when the app is auto stopped - <_li>Users can access preferences when the app is in break time - <_li>Integration with AppCenter +
  • Notification when the app is auto stopped
  • +
  • Users can access preferences when the app is in break time
  • +
  • Integration with AppCenter
+ + + diff --git a/data/com.github.tomatoers.tomato.desktop b/data/com.github.tomatoers.tomato.desktop deleted file mode 100644 index 8a1c015..0000000 --- a/data/com.github.tomatoers.tomato.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Tomato -Comment=Keep focused on your work -GenericName=Pomodoro App -StartupWMClass=com.github.tomatoers.tomato -Exec=com.github.tomatoers.tomato -Icon=com.github.tomatoers.tomato -Terminal=false -Categories=GNOME;GTK;Utility; -Keywords=Pomodoro;Time;Productivity;Tomato; -StartupNotify=true -X-GNOME-Gettext-Domain=com.github.tomatoers.tomato -X-GNOME-UsesNotifications=true -Actions=AboutDialog; - -[Desktop Action AboutDialog] -Name=About Tomato -Exec=com.github.tomatoers.tomato --about diff --git a/data/in/com.github.tomatoers.tomato.desktop.in.in b/data/com.github.tomatoers.tomato.desktop.in similarity index 74% rename from data/in/com.github.tomatoers.tomato.desktop.in.in rename to data/com.github.tomatoers.tomato.desktop.in index 5c05308..0c4f3e0 100644 --- a/data/in/com.github.tomatoers.tomato.desktop.in.in +++ b/data/com.github.tomatoers.tomato.desktop.in @@ -1,19 +1,19 @@ [Desktop Entry] Type=Application Name=@APP_NAME@ -_Comment=@COMMENT@ -_GenericName=@GENERIC_NAME@ +Comment=@COMMENT@ +GenericName=@GENERIC_NAME@ StartupWMClass=@EXEC_NAME@ Exec=@EXEC_NAME@ Icon=@ICON_NAME@ Terminal=false Categories=GNOME;GTK;Utility; -_Keywords=Pomodoro;Time;Productivity;Tomato; +Keywords=Pomodoro;Time;Productivity;Tomato; StartupNotify=true X-GNOME-Gettext-Domain=@GETTEXT_PACKAGE@ X-GNOME-UsesNotifications=true Actions=AboutDialog; [Desktop Action AboutDialog] -_Name=About Tomato +Name=About Tomato Exec=@EXEC_NAME@ --about From 6e9377484a6495c80cf9cb02f4c6c5d7261d1d27 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 06:41:51 -0300 Subject: [PATCH 06/13] Update .pot file Remove unused .pot file --- po/com.github.luizaugustomm.tomato.pot | 226 ---------------------- po/com.github.tomatoers.tomato.pot | 257 +++++++++++++++++-------- 2 files changed, 182 insertions(+), 301 deletions(-) delete mode 100644 po/com.github.luizaugustomm.tomato.pot diff --git a/po/com.github.luizaugustomm.tomato.pot b/po/com.github.luizaugustomm.tomato.pot deleted file mode 100644 index de2d30a..0000000 --- a/po/com.github.luizaugustomm.tomato.pot +++ /dev/null @@ -1,226 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-05 09:53-0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/Util/Timer.vala:29 -msgid "hour" -msgstr "" - -#: src/Util/Timer.vala:29 -msgid "hours" -msgstr "" - -#: src/Util/Timer.vala:30 src/Windows/PreferencesDialog.vala:82 -#: src/Windows/PreferencesDialog.vala:85 src/Windows/PreferencesDialog.vala:88 -#: src/Windows/PreferencesDialog.vala:108 -#: src/Windows/PreferencesDialog.vala:111 -msgid "minute" -msgstr "" - -#: src/Util/Timer.vala:30 src/Windows/PreferencesDialog.vala:82 -#: src/Windows/PreferencesDialog.vala:85 src/Windows/PreferencesDialog.vala:88 -#: src/Windows/PreferencesDialog.vala:108 -#: src/Windows/PreferencesDialog.vala:111 -msgid "minutes" -msgstr "" - -#: src/Util/Timer.vala:51 -msgid " and " -msgstr "" - -#: src/Managers/NotificationManager.vala:33 -msgid "Pomodoro Time" -msgstr "" - -#: src/Managers/NotificationManager.vala:34 -msgid "Get back to work!" -msgstr "" - -#: src/Managers/NotificationManager.vala:36 src/Windows/MainWindow.vala:122 -msgid "Short Break" -msgstr "" - -#: src/Managers/NotificationManager.vala:39 -msgid "Long Break!" -msgstr "" - -#: src/Windows/MainWindow.vala:72 -msgid "Start" -msgstr "" - -#: src/Windows/MainWindow.vala:73 -msgid "Resume" -msgstr "" - -#: src/Windows/MainWindow.vala:74 -msgid "Pause" -msgstr "" - -#: src/Windows/MainWindow.vala:75 src/Tomato.vala:160 -msgid "Stop" -msgstr "" - -#: src/Windows/MainWindow.vala:76 -msgid "Skip" -msgstr "" - -#: src/Windows/MainWindow.vala:126 -msgid "Long Break" -msgstr "" - -#: src/Windows/MainWindow.vala:160 -msgid " of work" -msgstr "" - -#: src/Windows/MainWindow.vala:169 -msgid "Preferences…" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:59 src/Windows/PreferencesDialog.vala:132 -msgid "Preferences" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:91 -msgid "pomodoro" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:91 -msgid "pomodoros" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:119 -msgid "Default Settings" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:120 -msgid "Reset Work" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:128 -msgid "Timing" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:137 -msgid "Close" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:167 -msgid "Pomodoro duration:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:171 -msgid "Short break duration:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:175 -msgid "Long break duration:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:179 -msgid "Long break delay:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:187 -msgid "Reset:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:199 -msgid "Behavior:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:202 -msgid "Reset work everyday:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:205 -msgid "Start new pomodoro manually:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:208 -msgid "Auto stop:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:211 -msgid "Sound:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:214 -msgid "Pomodoro sound:" -msgstr "" - -#: src/Windows/PreferencesDialog.vala:218 -msgid "Extras:" -msgstr "" - -#: src/Tomato.vala:35 -msgid "Go have a coffee" -msgstr "" - -#: src/Tomato.vala:36 -msgid "Drink some water" -msgstr "" - -#: src/Tomato.vala:37 -msgid "Get up and dance!" -msgstr "" - -#: src/Tomato.vala:38 -msgid "Have a break, have a tomato" -msgstr "" - -#: src/Tomato.vala:39 -msgid "Get up! Stand up! Fight for your fingers!" -msgstr "" - -#: src/Tomato.vala:40 -msgid "Take a break, save a life" -msgstr "" - -#: src/Tomato.vala:41 -msgid "Woot! Break time, baby!" -msgstr "" - -#: src/Tomato.vala:42 -msgid "It's coffee time!" -msgstr "" - -#: src/Tomato.vala:43 -msgid "What about a beer?" -msgstr "" - -#: src/Tomato.vala:44 -msgid "Take a walk outside" -msgstr "" - -#: src/Tomato.vala:45 -msgid "Step away from the machine!" -msgstr "" - -#: src/Tomato.vala:146 -msgid "Stopping in " -msgstr "" - -#: src/Tomato.vala:151 -msgid "Pomodoro was interrupted" -msgstr "" - -#: src/Tomato.vala:151 -msgid "" -"Tomato was paused for a long time. You might have lost focus. Try a new " -"pomodoro!" -msgstr "" diff --git a/po/com.github.tomatoers.tomato.pot b/po/com.github.tomatoers.tomato.pot index a435329..06c181d 100644 --- a/po/com.github.tomatoers.tomato.pot +++ b/po/com.github.tomatoers.tomato.pot @@ -1,14 +1,14 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# This file is distributed under the same license as the com.github.tomatoers.tomato package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: com.github.tomatoers.tomato\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-11-21 16:03-0700\n" +"POT-Creation-Date: 2018-11-24 05:11-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,82 +17,86 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/Util/Timer.vala:29 -msgid "hour" +#: src/Tomato.vala:35 +msgid "Go have a coffee" msgstr "" -#: src/Util/Timer.vala:29 -msgid "hours" +#: src/Tomato.vala:36 +msgid "Drink some water" msgstr "" -#: src/Util/Timer.vala:30 src/Windows/PreferencesDialog.vala:82 -#: src/Windows/PreferencesDialog.vala:85 src/Windows/PreferencesDialog.vala:88 -#: src/Windows/PreferencesDialog.vala:108 -#: src/Windows/PreferencesDialog.vala:111 -msgid "minute" +#: src/Tomato.vala:37 +msgid "Get up and dance!" msgstr "" -#: src/Util/Timer.vala:30 src/Windows/PreferencesDialog.vala:82 -#: src/Windows/PreferencesDialog.vala:85 src/Windows/PreferencesDialog.vala:88 -#: src/Windows/PreferencesDialog.vala:108 -#: src/Windows/PreferencesDialog.vala:111 -msgid "minutes" +#: src/Tomato.vala:38 +msgid "Have a break, have a tomato" msgstr "" -#: src/Util/Timer.vala:51 -msgid " and " +#: src/Tomato.vala:39 +msgid "Get up! Stand up! Fight for your fingers!" msgstr "" -#: src/Managers/NotificationManager.vala:33 -msgid "Pomodoro Time" +#: src/Tomato.vala:40 +msgid "Take a break, save a life" msgstr "" -#: src/Managers/NotificationManager.vala:34 -msgid "Get back to work!" +#: src/Tomato.vala:41 +msgid "Woot! Break time, baby!" msgstr "" -#: src/Managers/NotificationManager.vala:36 src/Windows/MainWindow.vala:122 -msgid "Short Break" +#: src/Tomato.vala:42 +msgid "It's coffee time!" msgstr "" -#: src/Managers/NotificationManager.vala:39 -msgid "Long Break!" +#: src/Tomato.vala:43 +msgid "What about a beer?" msgstr "" -#: src/Windows/MainWindow.vala:72 -msgid "Start" +#: src/Tomato.vala:44 +msgid "Take a walk outside" msgstr "" -#: src/Windows/MainWindow.vala:73 -msgid "Resume" +#: src/Tomato.vala:45 +msgid "Step away from the machine!" msgstr "" -#: src/Windows/MainWindow.vala:74 -msgid "Pause" +#: src/Tomato.vala:146 +msgid "Stopping in " msgstr "" -#: src/Windows/MainWindow.vala:75 src/Tomato.vala:160 -msgid "Stop" +#: src/Tomato.vala:151 +msgid "Pomodoro was interrupted" msgstr "" -#: src/Windows/MainWindow.vala:76 -msgid "Skip" +#: src/Tomato.vala:151 +msgid "" +"Tomato was paused for a long time. You might have lost focus. Try a new " +"pomodoro!" msgstr "" -#: src/Windows/MainWindow.vala:126 -msgid "Long Break" +#: src/Tomato.vala:160 src/Windows/MainWindow.vala:75 +msgid "Stop" msgstr "" -#: src/Windows/MainWindow.vala:160 -msgid " of work" +#. some dialog settings +#. create misc tab +#: src/Windows/PreferencesDialog.vala:59 src/Windows/PreferencesDialog.vala:132 +msgid "Preferences" msgstr "" -#: src/Windows/MainWindow.vala:169 -msgid "Preferences…" +#. ** options - scales ** +#. pomodoro_scale = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 5, 60, 1); +#: src/Windows/PreferencesDialog.vala:82 src/Windows/PreferencesDialog.vala:85 +#: src/Windows/PreferencesDialog.vala:88 src/Windows/PreferencesDialog.vala:108 +#: src/Windows/PreferencesDialog.vala:111 src/Util/Timer.vala:30 +msgid "minute" msgstr "" -#: src/Windows/PreferencesDialog.vala:59 src/Windows/PreferencesDialog.vala:132 -msgid "Preferences" +#: src/Windows/PreferencesDialog.vala:82 src/Windows/PreferencesDialog.vala:85 +#: src/Windows/PreferencesDialog.vala:88 src/Windows/PreferencesDialog.vala:108 +#: src/Windows/PreferencesDialog.vala:111 src/Util/Timer.vala:30 +msgid "minutes" msgstr "" #: src/Windows/PreferencesDialog.vala:91 @@ -103,6 +107,7 @@ msgstr "" msgid "pomodoros" msgstr "" +#. ** options - buttons ** #: src/Windows/PreferencesDialog.vala:119 msgid "Default Settings" msgstr "" @@ -111,26 +116,36 @@ msgstr "" msgid "Reset Work" msgstr "" +#. create timing tab #: src/Windows/PreferencesDialog.vala:128 msgid "Timing" msgstr "" +#. creat future tabs here +#. close button #: src/Windows/PreferencesDialog.vala:137 msgid "Close" msgstr "" +#. create section +#. var label = new Gtk.Label (_("General:")); +#. add_section (grid, label, ref row); +#. pomodoro Scale #: src/Windows/PreferencesDialog.vala:167 msgid "Pomodoro duration:" msgstr "" +#. short break scale #: src/Windows/PreferencesDialog.vala:171 msgid "Short break duration:" msgstr "" +#. long break scale #: src/Windows/PreferencesDialog.vala:175 msgid "Long break duration:" msgstr "" +#. long break delay scale #: src/Windows/PreferencesDialog.vala:179 msgid "Long break delay:" msgstr "" @@ -167,60 +182,152 @@ msgstr "" msgid "Extras:" msgstr "" -#: src/Tomato.vala:35 -msgid "Go have a coffee" +#: src/Windows/MainWindow.vala:72 +msgid "Start" msgstr "" -#: src/Tomato.vala:36 -msgid "Drink some water" +#: src/Windows/MainWindow.vala:73 +msgid "Resume" msgstr "" -#: src/Tomato.vala:37 -msgid "Get up and dance!" +#: src/Windows/MainWindow.vala:74 +msgid "Pause" msgstr "" -#: src/Tomato.vala:38 -msgid "Have a break, have a tomato" +#: src/Windows/MainWindow.vala:76 +msgid "Skip" msgstr "" -#: src/Tomato.vala:39 -msgid "Get up! Stand up! Fight for your fingers!" +#: src/Windows/MainWindow.vala:122 src/Managers/NotificationManager.vala:36 +msgid "Short Break" msgstr "" -#: src/Tomato.vala:40 -msgid "Take a break, save a life" +#: src/Windows/MainWindow.vala:126 +msgid "Long Break" msgstr "" -#: src/Tomato.vala:41 -msgid "Woot! Break time, baby!" +#: src/Windows/MainWindow.vala:160 +msgid " of work" msgstr "" -#: src/Tomato.vala:42 -msgid "It's coffee time!" +#: src/Windows/MainWindow.vala:169 +msgid "Preferences…" msgstr "" -#: src/Tomato.vala:43 -msgid "What about a beer?" +#. in minutes +#: src/Util/Timer.vala:29 +msgid "hour" msgstr "" -#: src/Tomato.vala:44 -msgid "Take a walk outside" +#: src/Util/Timer.vala:29 +msgid "hours" msgstr "" -#: src/Tomato.vala:45 -msgid "Step away from the machine!" +#: src/Util/Timer.vala:51 +msgid " and " msgstr "" -#: src/Tomato.vala:146 -msgid "Stopping in " +#: src/Managers/NotificationManager.vala:33 +msgid "Pomodoro Time" msgstr "" -#: src/Tomato.vala:151 -msgid "Pomodoro was interrupted" +#: src/Managers/NotificationManager.vala:34 +msgid "Get back to work!" msgstr "" -#: src/Tomato.vala:151 -msgid "" -"Tomato was paused for a long time. You might have lost focus. Try a new " -"pomodoro!" +#: src/Managers/NotificationManager.vala:39 +msgid "Long Break!" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:7 +#: data/com.github.tomatoers.tomato.desktop.in:4 +msgid "@APP_NAME@" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:8 +#: data/com.github.tomatoers.tomato.desktop.in:5 +msgid "@COMMENT@" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:11 +msgid "@DESCRIPTION@" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:16 +msgid "Pomodoro time" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:21 +msgid "Start page" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:26 +msgid "Short break time" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:31 +msgid "Tomatoers" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:50 +msgid "Updated URLs" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:58 +msgid "Solved app center issues" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:66 +msgid "UI redesign" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:67 +msgid "Bug fixes" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:75 +msgid "Changed screenshots" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:76 +msgid "Improved internationalization" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:77 +#: data/com.github.tomatoers.tomato.appdata.xml.in:85 +#: data/com.github.tomatoers.tomato.appdata.xml.in:93 +#: data/com.github.tomatoers.tomato.appdata.xml.in:104 +msgid "Fixed minor bugs" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:103 +msgid "Revamped icons" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:114 +msgid "Notification when the app is auto stopped" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:115 +msgid "Users can access preferences when the app is in break time" +msgstr "" + +#: data/com.github.tomatoers.tomato.appdata.xml.in:116 +msgid "Integration with AppCenter" +msgstr "" + +#: data/com.github.tomatoers.tomato.desktop.in:6 +msgid "@GENERIC_NAME@" +msgstr "" + +#: data/com.github.tomatoers.tomato.desktop.in:9 +msgid "@ICON_NAME@" +msgstr "" + +#: data/com.github.tomatoers.tomato.desktop.in:12 +msgid "Pomodoro;Time;Productivity;Tomato;" +msgstr "" + +#: data/com.github.tomatoers.tomato.desktop.in:19 +msgid "About Tomato" msgstr "" From 8d8b696ab92087df09333866dd0e25bae9f801f5 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 06:53:10 -0300 Subject: [PATCH 07/13] Use the correct licence --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c709c68..3c244cd 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'com.github.tomatoers.tomato', 'vala', 'c', version : '2.0.2', - license : 'LGPL2+' + license : 'GPL2+' ) add_global_arguments ( From 1072fdeaea63aaad53803c6fcd1155168d599af6 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 07:33:31 -0300 Subject: [PATCH 08/13] Import i18n package --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 3c244cd..c0dc542 100644 --- a/meson.build +++ b/meson.build @@ -9,6 +9,7 @@ add_global_arguments ( language: 'c' ) +i18n = import ('i18n') prefix = get_option ('prefix') datadir = join_paths (prefix, get_option ('datadir')) From 40f5c77f7802e98b68e43dcb7cd67c4aed5b75f6 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 08:10:33 -0300 Subject: [PATCH 09/13] Update README --- README.md | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 59e7d0b..c790a36 100644 --- a/README.md +++ b/README.md @@ -31,24 +31,17 @@ If you want to hack on and build Tomato yourself, you'll need the following depe - libcanberra - libunity -Create a `build` directory +Use `meson` to configure the build environment and run `ninja` to build ```shell -mkdir build -cd build +meson build --prefix=/usr +ninja -C build ``` -Use `cmake` to configure the build environment and run `make` to build +To install, use `ninja -C build install`, then execute with `com.github.tomatoers.tomato` ```shell -cmake -DCMAKE_INSTALL_PREFIX=/usr ../ -make -``` - -To install, use `make install`, then execute with `com.github.tomatoers.tomato` - -```shell -sudo make install +sudo ninja -C build install com.github.tomatoers.tomato ``` From ef85909beee0820fcb91f8edbf64d038c2683e50 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 24 Nov 2018 08:12:57 -0300 Subject: [PATCH 10/13] Update .gitignore --- .gitignore | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 0850372..d163863 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1 @@ -CMakeCache.txt -CMakeFiles -Makefile -cmake_install.cmake -install_manifest.txt -build/ -.bzr +build/ \ No newline at end of file From e9f0362d29fa85235fd92f5704a9831a1820aa43 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Sat, 8 Dec 2018 14:33:19 -0300 Subject: [PATCH 11/13] Install icons the right way --- data/meson.build | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/data/meson.build b/data/meson.build index 2ddb0c8..91f7ba4 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,15 +1,6 @@ -icon_sizes = ['16', '22', '24', '32', '48', '64', '128', '256'] - -foreach i : icon_sizes - install_data ( - join_paths ('icons', i + 'x' + i, 'apps', meson.project_name () + '.png'), - install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps') - ) -endforeach - -install_data ( - join_paths ('icons', 'scalable', 'apps', meson.project_name () + '.svg'), - install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', 'scalable', 'apps') +install_subdir ( + 'icons', + install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor') ) appdata = configure_file ( From 683505e9551247849b281ac7e6b91f3740997fa6 Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Mon, 10 Dec 2018 22:18:11 -0300 Subject: [PATCH 12/13] install strip_directory --- data/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/meson.build b/data/meson.build index 91f7ba4..c94e7cc 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,6 +1,7 @@ install_subdir ( 'icons', - install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor') + install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor'), + strip_directory: true ) appdata = configure_file ( From 35b81ccf93bbcf16b593606e30d7b24853c86fed Mon Sep 17 00:00:00 2001 From: Cleiton Floss Date: Mon, 10 Dec 2018 22:28:17 -0300 Subject: [PATCH 13/13] remove extra lines fix a typo --- data/com.github.tomatoers.tomato.appdata.xml.in | 3 --- data/meson.build | 10 +++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/data/com.github.tomatoers.tomato.appdata.xml.in b/data/com.github.tomatoers.tomato.appdata.xml.in index 65b3eca..c172e1a 100644 --- a/data/com.github.tomatoers.tomato.appdata.xml.in +++ b/data/com.github.tomatoers.tomato.appdata.xml.in @@ -119,6 +119,3 @@ - - - diff --git a/data/meson.build b/data/meson.build index c94e7cc..8da9c90 100644 --- a/data/meson.build +++ b/data/meson.build @@ -45,16 +45,16 @@ install_data ( install_dir : join_paths (get_option ('datadir'), 'glib-2.0', 'schemas') ) -dvf = find_program ('desktop-file-validate', required: false) asc = find_program ('appstreamcli', required: false) +dfv = find_program ('desktop-file-validate', required: false) vala_lint = find_program ('io.elementary.vala-lint', required: false) -if dvf.found () -test ( +if dfv.found () + test ( 'Validate desktop file', - dvf, + dfv, args: join_paths (meson.current_build_dir (), meson.project_name () + '.desktop') -) + ) endif