Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package lxqt-build-tools for
openSUSE:Factory checked in at 2021-04-17 00:01:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lxqt-build-tools (Old)
and /work/SRC/openSUSE:Factory/.lxqt-build-tools.new.12324 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lxqt-build-tools"
Sat Apr 17 00:01:46 2021 rev:8 rq:885929 version:0.9.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/lxqt-build-tools/lxqt-build-tools.changes
2020-11-04 18:32:30.132133088 +0100
+++
/work/SRC/openSUSE:Factory/.lxqt-build-tools.new.12324/lxqt-build-tools.changes
2021-04-17 00:01:56.377610578 +0200
@@ -1,0 +2,6 @@
+Fri Apr 16 06:32:51 UTC 2021 - Michael Vetter <[email protected]>
+
+- Update to 0.9.0:
+ * A CMake FindXTerm module is added.
+
+-------------------------------------------------------------------
Old:
----
lxqt-build-tools-0.8.0.tar.xz
lxqt-build-tools-0.8.0.tar.xz.asc
New:
----
lxqt-build-tools-0.9.0.tar.xz
lxqt-build-tools-0.9.0.tar.xz.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ lxqt-build-tools.spec ++++++
--- /var/tmp/diff_new_pack.bBvyzd/_old 2021-04-17 00:01:57.409612205 +0200
+++ /var/tmp/diff_new_pack.bBvyzd/_new 2021-04-17 00:01:57.413612211 +0200
@@ -1,7 +1,7 @@
#
# spec file for package lxqt-build-tools
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: lxqt-build-tools
-Version: 0.8.0
+Version: 0.9.0
Release: 0
Summary: Core build tools for LXQt
License: BSD-3-Clause
++++++ lxqt-build-tools-0.8.0.tar.xz -> lxqt-build-tools-0.9.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lxqt-build-tools-0.8.0/CHANGELOG
new/lxqt-build-tools-0.9.0/CHANGELOG
--- old/lxqt-build-tools-0.8.0/CHANGELOG 2020-10-30 14:17:17.000000000
+0100
+++ new/lxqt-build-tools-0.9.0/CHANGELOG 2021-04-05 11:30:11.000000000
+0200
@@ -1,3 +1,7 @@
+lxqt-build-tools-0.9.0 / 2021-04-15
+===================================
+ * Added a CMake FindXTerm module.
+
lxqt-build-tools-0.8.0 / 2020-11-01
===================================
* Removed version checks for some LXQt dependencies.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lxqt-build-tools-0.8.0/CMakeLists.txt
new/lxqt-build-tools-0.9.0/CMakeLists.txt
--- old/lxqt-build-tools-0.8.0/CMakeLists.txt 2020-10-30 14:17:17.000000000
+0100
+++ new/lxqt-build-tools-0.9.0/CMakeLists.txt 2021-04-05 11:30:11.000000000
+0200
@@ -9,9 +9,11 @@
option(WITH_XDG_DIRS_FALLBACK "Use our XDG_CONFIG_DIRS fallback" ON)
set(LXQT_BUILD_TOOLS_MAJOR_VERSION 0)
-set(LXQT_BUILD_TOOLS_MINOR_VERSION 8)
+set(LXQT_BUILD_TOOLS_MINOR_VERSION 9)
set(LXQT_BUILD_TOOLS_PATCH_VERSION 0)
set(LXQT_BUILD_TOOLS_VERSION
${LXQT_BUILD_TOOLS_MAJOR_VERSION}.${LXQT_BUILD_TOOLS_MINOR_VERSION}.${LXQT_BUILD_TOOLS_PATCH_VERSION})
+# for lxqt_translate_ts we require at least Qt linguist 5.12.5 for correct
file name handling
+set(LXQT_MIN_LINGUIST_VERSION "5.12.5")
include(CMakePackageConfigHelpers)
include(GNUInstallDirs) # Standard directories for installation
@@ -42,7 +44,11 @@
file(GLOB toInstallModules
"${PROJECT_SOURCE_DIR}/cmake/modules/*.cmake"
- "${PROJECT_SOURCE_DIR}/cmake/modules/*.in"
+ "${PROJECT_SOURCE_DIR}/cmake/modules/*.cpp.in"
+)
+
+file(GLOB toInstallModulesHelpers
+ "${PROJECT_SOURCE_DIR}/cmake/modules/*.pl"
)
@@ -59,6 +65,7 @@
file(COPY
${toInstallModules}
+ ${toInstallModulesHelpers}
DESTINATION "${MODULES_INSTALL_DIR}"
)
@@ -77,6 +84,12 @@
@ONLY
)
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/LXQtTranslateTs.cmake.in"
+ "${MODULES_INSTALL_DIR}/LXQtTranslateTs.cmake"
+ @ONLY
+)
+
#-----------------------------------------------------------------------------
# Installable mode
@@ -100,6 +113,12 @@
@ONLY
)
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/LXQtTranslateTs.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/install/LXQtTranslateTs.cmake"
+ @ONLY
+)
+
# The package version file is common to superbuild and installable mode
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/lxqt-build-tools-config-version.cmake.in"
@@ -121,7 +140,9 @@
install(
FILES
${toInstallModules}
+ ${toInstallModulesHelpers}
"${CMAKE_CURRENT_BINARY_DIR}/install/LXQtConfigVars.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/install/LXQtTranslateTs.cmake"
DESTINATION
"${MODULES_INSTALL_DIR}"
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lxqt-build-tools-0.8.0/cmake/find-modules/FindXTerm.cmake
new/lxqt-build-tools-0.9.0/cmake/find-modules/FindXTerm.cmake
--- old/lxqt-build-tools-0.8.0/cmake/find-modules/FindXTerm.cmake
1970-01-01 01:00:00.000000000 +0100
+++ new/lxqt-build-tools-0.9.0/cmake/find-modules/FindXTerm.cmake
2021-04-05 11:30:11.000000000 +0200
@@ -0,0 +1,52 @@
+#=============================================================================
+# Copyright 2020 Lu??s Pereira <[email protected]>
+#
+# 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.
+#=============================================================================
+# FindXTerm
+#
+# Try to find the XTerm executable
+#
+# This will define the following variables:
+#
+# `XTerm_FOUND`
+# True if XTerm executable is available.
+#
+# `XTerm_EXECUTABLE`
+# The XTerm executable.
+#
+
+# Find XTerm executable
+find_program(XTerm_EXECUTABLE NAMES xterm)
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(XTerm
+ FOUND_VAR
+ XTerm_FOUND
+ REQUIRED_VARS
+ XTerm_EXECUTABLE
+)
+
+mark_as_advanced(XTerm_EXECUTABLE)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lxqt-build-tools-0.8.0/cmake/modules/LXQtTranslateDesktop.cmake
new/lxqt-build-tools-0.9.0/cmake/modules/LXQtTranslateDesktop.cmake
--- old/lxqt-build-tools-0.8.0/cmake/modules/LXQtTranslateDesktop.cmake
2020-10-30 14:17:17.000000000 +0100
+++ new/lxqt-build-tools-0.9.0/cmake/modules/LXQtTranslateDesktop.cmake
2021-04-05 11:30:11.000000000 +0200
@@ -7,6 +7,7 @@
# funtion lxqt_translate_desktop(_RESULT
# SOURCES <sources>
# [TRANSLATION_DIR] translation_directory
+# [USE_YAML]
# )
# Output:
# _RESULT The generated .desktop (.desktop) files
@@ -20,10 +21,14 @@
# relative to the CMakeList.txt. Defaults to
# "translations".
#
+# USE_YAML Flag if *.desktop.yaml translation should be used.
#=============================================================================
+find_package(Perl REQUIRED)
+
function(lxqt_translate_desktop _RESULT)
# Parse arguments ***************************************
+ set(options USE_YAML)
set(oneValueArgs TRANSLATION_DIR)
set(multiValueArgs SOURCES)
@@ -60,47 +65,36 @@
#Extract the real extension ............
get_filename_component(_fileExt ${_inFile} EXT)
string(REPLACE ".in" "" _fileExt ${_fileExt})
+ string(REGEX REPLACE "^\\.([^.].*)$" "\\1" _fileExt ${_fileExt})
#.......................................
- set(_outFile "${CMAKE_CURRENT_BINARY_DIR}/${_fileName}${_fileExt}")
-
- file(GLOB _translations
- ${_translationDir}/${_fileName}_*${_fileExt}
- )
+ set(_outFile "${CMAKE_CURRENT_BINARY_DIR}/${_fileName}.${_fileExt}")
- set(_pattern "'\\[.*]\\s*='")
- if (_translations)
- list(SORT _translations)
+ if (_ARGS_USE_YAML)
add_custom_command(OUTPUT ${_outFile}
- COMMAND grep -v -a "'#TRANSLATIONS_DIR='" ${_inFile} >
${_outFile}
- COMMAND grep -h -a ${_pattern} ${_translations} >> ${_outFile}
- COMMENT "Generating ${_fileName}${_fileExt}"
+ COMMAND ${PERL_EXECUTABLE}
${LXQT_CMAKE_MODULES_DIR}/LXQtTranslateDesktopYaml.pl ${_inFile} ${_fileName}
${_translationDir}/${_fileName}[_.]*${_fileExt}.yaml >> ${_outFile}
+ VERBATIM
+ COMMENT "Generating ${_fileName}.${_fileExt}"
+ )
+ else ()
+ file(GLOB _translations
+ ${_translationDir}/${_fileName}[_.]*${_fileExt}
)
- else()
+
+ list(SORT _translations)
add_custom_command(OUTPUT ${_outFile}
- COMMAND grep -v -a "'#TRANSLATIONS_DIR='" ${_inFile} >
${_outFile}
- COMMENT "Generating ${_fileName}${_fileExt}"
+ COMMAND grep -v -a "#TRANSLATIONS_DIR=" ${_inFile} >
${_outFile}
+ VERBATIM
+ COMMENT "Generating ${_fileName}.${_fileExt}"
)
- endif()
+ if (_translations)
+ add_custom_command(OUTPUT ${_outFile}
+ COMMAND grep -h -a "\\[.*]\\s*=" ${_translations} >>
${_outFile}
+ VERBATIM APPEND
+ )
+ endif ()
+ endif ()
set(__result ${__result} ${_outFile})
-
-
- # TX file ***********************************************
- set(_txFile "${CMAKE_BINARY_DIR}/tx/${_fileName}${_fileExt}.tx.sh")
- string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_translationDir
${_translationDir})
- string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_inFile ${_inFile})
- string(REPLACE "." "" _fileType ${_fileExt})
-
- file(WRITE ${_txFile}
- "[ -f ${_inFile} ] || exit 0\n"
- "echo '[lxqt.${_fileName}_${_fileType}]'\n"
- "echo 'type = DESKTOP'\n"
- "echo 'source_lang = en'\n"
- "echo 'source_file = ${_tx_inFile}'\n"
- "echo 'file_filter =
${_tx_translationDir}/${_fileName}_<lang>${_fileExt}'\n"
- "echo ''\n"
- )
-
endforeach()
set(${_RESULT} ${__result} PARENT_SCOPE)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lxqt-build-tools-0.8.0/cmake/modules/LXQtTranslateDesktopYaml.pl
new/lxqt-build-tools-0.9.0/cmake/modules/LXQtTranslateDesktopYaml.pl
--- old/lxqt-build-tools-0.8.0/cmake/modules/LXQtTranslateDesktopYaml.pl
1970-01-01 01:00:00.000000000 +0100
+++ new/lxqt-build-tools-0.9.0/cmake/modules/LXQtTranslateDesktopYaml.pl
2021-04-05 11:30:11.000000000 +0200
@@ -0,0 +1,50 @@
+use strict;
+
+binmode(STDOUT, ":encoding(utf8)");
+binmode(STDERR, ":encoding(utf8)");
+
+my $desktop_in = $ARGV[0];
+my $filename_base = $ARGV[1];
+my @translation_files = glob($ARGV[2]);
+
+my $section_re = qr/^\[([^\]]+)]/o;
+my $lang_re = qr/^.*${filename_base}_([^.]+)\..+$/o;
+my $strip_re = qr/#TRANSLATIONS_DIR=/o;
+
+sub flush_translations {
+ my ($curr_section) = @_;
+ if (defined $curr_section) {
+ my $transl_yaml_re = qr/^${curr_section}\/([^: ]+) ?: *([^ ].*)$/;
+ foreach my $file (@translation_files) {
+ my $language = ($file =~ $lang_re ? "[$1]" : '');
+ open(my $trans_fh, '<:encoding(UTF-8)', $file) or next;
+ while (my $trans_l = <$trans_fh>) {
+ if ($trans_l =~ $transl_yaml_re)
+ {
+ my ($key, $value) = ($1, $2);
+ $value =~ s/^\s+|\s+$//; $value =~ s/^['"]//; $value =~
s/['"]$//;
+ if (length($value))
+ {
+ # Don't flush empty (untranslated) strings
+ print(STDOUT "$key$language=$value\n");
+ }
+ }
+ }
+ close($trans_fh);
+ }
+ }
+}
+
+
+open(my $fh, '<:encoding(UTF-8)', $desktop_in) or die "Could not open file
'$desktop_in' $!";
+my $curr_section = undef;
+while (my $line = <$fh>) {
+ if ($line =~ $section_re) {
+ flush_translations($curr_section);
+ $curr_section = $1;
+ }
+ $line =~ $strip_re or print(STDOUT $line);
+}
+flush_translations($curr_section);
+
+close($fh);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lxqt-build-tools-0.8.0/cmake/modules/LXQtTranslateTs.cmake
new/lxqt-build-tools-0.9.0/cmake/modules/LXQtTranslateTs.cmake
--- old/lxqt-build-tools-0.8.0/cmake/modules/LXQtTranslateTs.cmake
2020-10-30 14:17:17.000000000 +0100
+++ new/lxqt-build-tools-0.9.0/cmake/modules/LXQtTranslateTs.cmake
1970-01-01 01:00:00.000000000 +0100
@@ -1,156 +0,0 @@
-#=============================================================================
-# Copyright 2014 Lu??s Pereira <[email protected]>
-#
-# 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.
-#=============================================================================
-#
-# funtion lxqt_translate_ts(qmFiles
-# [USE_QT5 [Yes | No]]
-# [UPDATE_TRANSLATIONS [Yes | No]]
-# SOURCES <sources>
-# [UPDATE_OPTIONS] update_options
-# [TEMPLATE] translation_template
-# [TRANSLATION_DIR] translation_directory
-# [INSTALL_DIR] install_directory
-# [COMPONENT] component
-# )
-# Output:
-# qmFiles The generated compiled translations (.qm) files
-#
-# Input:
-# USE_QT5 Optional flag to choose between Qt4 and Qt5. Defaults to Qt5
-#
-# UPDATE_TRANSLATIONS Optional flag. Setting it to Yes, extracts and
-# compiles the translations. Setting it No, only
-# compiles them.
-#
-# UPDATE_OPTIONS Optional options to lupdate when UPDATE_TRANSLATIONS
-# is True.
-#
-# TEMPLATE Optional translations files base name. Defaults to
-# ${PROJECT_NAME}. An .ts extensions is added.
-#
-# TRANSLATION_DIR Optional path to the directory with the .ts files,
-# relative to the CMakeList.txt. Defaults to
-# "translations".
-#
-# INSTALL_DIR Optional destination of the file compiled files (qmFiles).
-# If not present no installation is performed
-#
-# COMPONENT Optional install component. Only effective if INSTALL_DIR
-# present. Defaults to "Runtime".
-#
-
-# We use our patched version to round a annoying bug.
-include(Qt5PatchedLinguistToolsMacros)
-
-function(lxqt_translate_ts qmFiles)
- set(oneValueArgs
- USE_QT5
- UPDATE_TRANSLATIONS
- TEMPLATE
- TRANSLATION_DIR
- INSTALL_DIR
- COMPONENT
- )
- set(multiValueArgs SOURCES UPDATE_OPTIONS)
- cmake_parse_arguments(TR "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
-
- if (NOT DEFINED TR_UPDATE_TRANSLATIONS)
- set(TR_UPDATE_TRANSLATIONS "No")
- endif()
-
- if (NOT DEFINED TR_UPDATE_OPTIONS)
- set(TR_UPDATE_OPTIONS "")
- endif()
-
- if (NOT DEFINED TR_USE_QT5)
- set(TR_USE_QT5 "Yes")
- endif()
-
- if(NOT DEFINED TR_TEMPLATE)
- set(TR_TEMPLATE "${PROJECT_NAME}")
- endif()
-
- if (NOT DEFINED TR_TRANSLATION_DIR)
- set(TR_TRANSLATION_DIR "translations")
- endif()
- get_filename_component(TR_TRANSLATION_DIR "${TR_TRANSLATION_DIR}" ABSOLUTE)
-
- if (EXISTS "${TR_TRANSLATION_DIR}")
- file(GLOB tsFiles "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}_*.ts")
- set(templateFile "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}.ts")
- endif ()
-
- if(TR_USE_QT5)
- # Qt5
- if (TR_UPDATE_TRANSLATIONS)
- qt5_patched_create_translation(QMS
- ${TR_SOURCES}
- ${templateFile}
- OPTIONS ${TR_UPDATE_OPTIONS}
- )
- qt5_patched_create_translation(QM
- ${TR_SOURCES}
- ${tsFiles}
- OPTIONS ${TR_UPDATE_OPTIONS}
- )
- else()
- qt5_patched_add_translation(QM ${tsFiles})
- endif()
- else()
- # Qt4
- if(TR_UPDATE_TRANSLATIONS)
- qt4_create_translation(QMS
- ${TR_SOURCES}
- ${templateFile}
- OPTIONS ${TR_UPDATE_OPTIONS}
- )
- qt4_create_translation(QM
- ${TR_SOURCES}
- ${tsFiles}
- OPTIONS ${TR_UPDATE_OPTIONS}
- )
- else()
- qt4_add_translation(QM ${tsFiles})
- endif()
- endif()
-
- if(TR_UPDATE_TRANSLATIONS)
- add_custom_target("update_${TR_TEMPLATE}_ts" ALL DEPENDS ${QMS})
- endif()
-
- if(DEFINED TR_INSTALL_DIR)
- if(NOT DEFINED TR_COMPONENT)
- set(TR_COMPONENT "Runtime")
- endif()
-
- install(FILES ${QM}
- DESTINATION "${TR_INSTALL_DIR}"
- COMPONENT "${TR_COMPONENT}"
- )
- endif()
-
- set(${qmFiles} ${QM} PARENT_SCOPE)
-endfunction()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lxqt-build-tools-0.8.0/cmake/modules/LXQtTranslateTs.cmake.in
new/lxqt-build-tools-0.9.0/cmake/modules/LXQtTranslateTs.cmake.in
--- old/lxqt-build-tools-0.8.0/cmake/modules/LXQtTranslateTs.cmake.in
1970-01-01 01:00:00.000000000 +0100
+++ new/lxqt-build-tools-0.9.0/cmake/modules/LXQtTranslateTs.cmake.in
2021-04-05 11:30:11.000000000 +0200
@@ -0,0 +1,155 @@
+#=============================================================================
+# Copyright 2014 Lu??s Pereira <[email protected]>
+#
+# 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.
+#=============================================================================
+#
+# funtion lxqt_translate_ts(qmFiles
+# [USE_QT5 [Yes | No]]
+# [UPDATE_TRANSLATIONS [Yes | No]]
+# SOURCES <sources>
+# [UPDATE_OPTIONS] update_options
+# [TEMPLATE] translation_template
+# [TRANSLATION_DIR] translation_directory
+# [INSTALL_DIR] install_directory
+# [COMPONENT] component
+# )
+# Output:
+# qmFiles The generated compiled translations (.qm) files
+#
+# Input:
+# USE_QT5 Optional flag to choose between Qt4 and Qt5. Defaults to Qt5
+#
+# UPDATE_TRANSLATIONS Optional flag. Setting it to Yes, extracts and
+# compiles the translations. Setting it No, only
+# compiles them.
+#
+# UPDATE_OPTIONS Optional options to lupdate when UPDATE_TRANSLATIONS
+# is True.
+#
+# TEMPLATE Optional translations files base name. Defaults to
+# ${PROJECT_NAME}. An .ts extensions is added.
+#
+# TRANSLATION_DIR Optional path to the directory with the .ts files,
+# relative to the CMakeList.txt. Defaults to
+# "translations".
+#
+# INSTALL_DIR Optional destination of the file compiled files (qmFiles).
+# If not present no installation is performed
+#
+# COMPONENT Optional install component. Only effective if INSTALL_DIR
+# present. Defaults to "Runtime".
+#
+
+find_package(Qt5LinguistTools "@LXQT_MIN_LINGUIST_VERSION@" REQUIRED)
+
+function(lxqt_translate_ts qmFiles)
+ set(oneValueArgs
+ USE_QT5
+ UPDATE_TRANSLATIONS
+ TEMPLATE
+ TRANSLATION_DIR
+ INSTALL_DIR
+ COMPONENT
+ )
+ set(multiValueArgs SOURCES UPDATE_OPTIONS)
+ cmake_parse_arguments(TR "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
+
+ if (NOT DEFINED TR_UPDATE_TRANSLATIONS)
+ set(TR_UPDATE_TRANSLATIONS "No")
+ endif()
+
+ if (NOT DEFINED TR_UPDATE_OPTIONS)
+ set(TR_UPDATE_OPTIONS "")
+ endif()
+
+ if (NOT DEFINED TR_USE_QT5)
+ set(TR_USE_QT5 "Yes")
+ endif()
+
+ if(NOT DEFINED TR_TEMPLATE)
+ set(TR_TEMPLATE "${PROJECT_NAME}")
+ endif()
+
+ if (NOT DEFINED TR_TRANSLATION_DIR)
+ set(TR_TRANSLATION_DIR "translations")
+ endif()
+ get_filename_component(TR_TRANSLATION_DIR "${TR_TRANSLATION_DIR}" ABSOLUTE)
+
+ if (EXISTS "${TR_TRANSLATION_DIR}")
+ file(GLOB tsFiles "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}_*.ts")
+ set(templateFile "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}.ts")
+ endif ()
+
+ if(TR_USE_QT5)
+ # Qt5
+ if (TR_UPDATE_TRANSLATIONS)
+ qt5_create_translation(QMS
+ ${TR_SOURCES}
+ ${templateFile}
+ OPTIONS ${TR_UPDATE_OPTIONS}
+ )
+ qt5_create_translation(QM
+ ${TR_SOURCES}
+ ${tsFiles}
+ OPTIONS ${TR_UPDATE_OPTIONS}
+ )
+ else()
+ qt5_add_translation(QM ${tsFiles})
+ endif()
+ else()
+ # Qt4
+ if(TR_UPDATE_TRANSLATIONS)
+ qt4_create_translation(QMS
+ ${TR_SOURCES}
+ ${templateFile}
+ OPTIONS ${TR_UPDATE_OPTIONS}
+ )
+ qt4_create_translation(QM
+ ${TR_SOURCES}
+ ${tsFiles}
+ OPTIONS ${TR_UPDATE_OPTIONS}
+ )
+ else()
+ qt4_add_translation(QM ${tsFiles})
+ endif()
+ endif()
+
+ if(TR_UPDATE_TRANSLATIONS)
+ add_custom_target("update_${TR_TEMPLATE}_ts" ALL DEPENDS ${QMS})
+ endif()
+
+ if(DEFINED TR_INSTALL_DIR)
+ if(NOT DEFINED TR_COMPONENT)
+ set(TR_COMPONENT "Runtime")
+ endif()
+
+ install(FILES ${QM}
+ DESTINATION "${TR_INSTALL_DIR}"
+ COMPONENT "${TR_COMPONENT}"
+ )
+ endif()
+
+ set(${qmFiles} ${QM} PARENT_SCOPE)
+endfunction()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lxqt-build-tools-0.8.0/cmake/modules/Qt5PatchedLinguistToolsMacros.cmake
new/lxqt-build-tools-0.9.0/cmake/modules/Qt5PatchedLinguistToolsMacros.cmake
---
old/lxqt-build-tools-0.8.0/cmake/modules/Qt5PatchedLinguistToolsMacros.cmake
2020-10-30 14:17:17.000000000 +0100
+++
new/lxqt-build-tools-0.9.0/cmake/modules/Qt5PatchedLinguistToolsMacros.cmake
1970-01-01 01:00:00.000000000 +0100
@@ -1,112 +0,0 @@
-#=============================================================================
-# Copyright 2005-2011 Kitware, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * 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.
-#
-# * Neither the name of Kitware, Inc. nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "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 COPYRIGHT
-# HOLDER 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.
-#=============================================================================
-
-include(CMakeParseArguments)
-
-function(QT5_PATCHED_CREATE_TRANSLATION _qm_files)
- set(options)
- set(oneValueArgs)
- set(multiValueArgs OPTIONS)
-
- cmake_parse_arguments(_LUPDATE "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
- set(_lupdate_files ${_LUPDATE_UNPARSED_ARGUMENTS})
- set(_lupdate_options ${_LUPDATE_OPTIONS})
-
- set(_my_sources)
- set(_my_tsfiles)
- foreach(_file ${_lupdate_files})
- get_filename_component(_ext ${_file} EXT)
- get_filename_component(_abs_FILE ${_file} ABSOLUTE)
- if(_ext MATCHES "ts")
- list(APPEND _my_tsfiles ${_abs_FILE})
- else()
- list(APPEND _my_sources ${_abs_FILE})
- endif()
- endforeach()
- foreach(_ts_file ${_my_tsfiles})
- if(_my_sources)
- # make a list file to call lupdate on, so we don't make our commands
too
- # long for some systems
-# get_filename_component(_ts_name ${_ts_file} NAME_WE)
-
- get_filename_component(_name ${_ts_file} NAME)
- string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _ts_name ${_name})
-
- set(_ts_lst_file
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lst_file")
- set(_lst_file_srcs)
- foreach(_lst_file_src ${_my_sources})
- set(_lst_file_srcs "${_lst_file_src}\n${_lst_file_srcs}")
- endforeach()
-
- get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
- foreach(_pro_include ${_inc_DIRS})
- get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
- set(_lst_file_srcs "-I${_pro_include}\n${_lst_file_srcs}")
- endforeach()
-
- file(WRITE ${_ts_lst_file} "${_lst_file_srcs}")
- endif()
- add_custom_command(OUTPUT ${_ts_file}
- COMMAND ${Qt5_LUPDATE_EXECUTABLE}
- ARGS ${_lupdate_options} "@${_ts_lst_file}" -ts ${_ts_file}
- DEPENDS ${_my_sources} ${_ts_lst_file} VERBATIM)
- endforeach()
- qt5_patched_add_translation(${_qm_files} ${_my_tsfiles})
- set(${_qm_files} ${${_qm_files}} PARENT_SCOPE)
-endfunction()
-
-
-function(QT5_PATCHED_ADD_TRANSLATION _qm_files)
- foreach(_current_FILE ${ARGN})
- get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
-# get_filename_component(qm ${_abs_FILE} NAME_WE)
-
- get_filename_component(_name ${_abs_FILE} NAME)
- string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" qm ${_name})
-
- get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
- if(output_location)
- file(MAKE_DIRECTORY "${output_location}")
- set(qm "${output_location}/${qm}.qm")
- else()
- set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
- endif()
-
- add_custom_command(OUTPUT ${qm}
- COMMAND ${Qt5_LRELEASE_EXECUTABLE}
- ARGS ${_abs_FILE} -qm ${qm}
- DEPENDS ${_abs_FILE} VERBATIM
- )
- list(APPEND ${_qm_files} ${qm})
- endforeach()
- set(${_qm_files} ${${_qm_files}} PARENT_SCOPE)
-endfunction()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lxqt-build-tools-0.8.0/lxqt-transupdate
new/lxqt-build-tools-0.9.0/lxqt-transupdate
--- old/lxqt-build-tools-0.8.0/lxqt-transupdate 2020-10-30 14:17:17.000000000
+0100
+++ new/lxqt-build-tools-0.9.0/lxqt-transupdate 2021-04-05 11:30:11.000000000
+0200
@@ -45,6 +45,6 @@
lupdate $SOURCEDIR -ts $i -locations absolute -no-obsolete
echo
echo "== Language updates =="
- echo "lupdate $SOURCEDIR -ts $TRANSDIR/*.ts -locations absolute
-no-obsolete\n"
+ echo "lupdate $SOURCEDIR -ts $TRANSDIR/*_*.ts -locations absolute
-no-obsolete\n"
lupdate $SOURCEDIR -ts $TRANSDIR/*_*.ts -locations absolute -no-obsolete
done