Commit c2179bc4 authored by Norbert Preining's avatar Norbert Preining

Update upstream source from tag 'upstream/0.6.2.20190306'

Update to upstream version '0.6.2.20190306'
with Debian dir dbb4972a1cc97f55f3685b942983bb3d15bdf153
parents c1158a67 d4278be8
......@@ -2,19 +2,70 @@ language: cpp
matrix:
include:
- env: TARGET_OS=osx QT=5
- name: "Mac OS X (Qt 5)"
env: TARGET_OS=osx QT=5
os: osx
- env: TARGET_OS=win QT=4
- name: "Windows (Qt 5)"
env: TARGET_OS=win QT=5
os: linux
- env: TARGET_OS=win QT=5
dist: xenial
services: docker
- name: "Ubuntu/Linux (Qt 4)"
env: TARGET_OS=linux QT=4
os: linux
- env: TARGET_OS=linux QT=4
addons:
apt:
packages:
- ubuntu-dev-tools
- dput
- python-paramiko
- debhelper
- libqt4-dev
- zlib1g-dev
- libhunspell-dev
- libpoppler-qt4-dev
- libpoppler-private-dev
- poppler-data
- liblua5.2-dev
- fakeroot
- name: "Ubuntu/Linux (Qt 5)"
env: TARGET_OS=linux QT=5
os: linux
- env: TARGET_OS=linux QT=5
addons:
apt:
packages:
- ubuntu-dev-tools
- dput
- python-paramiko
- debhelper
- qtbase5-dev
- qtscript5-dev
- qttools5-dev
- qttools5-dev-tools
- zlib1g-dev
- libhunspell-dev
- libpoppler-qt5-dev
- libpoppler-private-dev
- poppler-data
- liblua5.2-dev
- fakeroot
- name: "Ubuntu/Linux (Qt 5) [coverage]"
env: TARGET_OS=linux QT=5 COVERAGE=ON
os: linux
dist: trusty
sudo: required
addons:
apt:
packages:
- qtbase5-dev
- qtscript5-dev
- qttools5-dev
- qttools5-dev-tools
- zlib1g-dev
- libhunspell-dev
- libpoppler-qt5-dev
- libpoppler-private-dev
- poppler-data
- liblua5.2-dev
- lcov
before_install:
- ${TRAVIS_BUILD_DIR}/travis-ci/get-dependencies.sh
......@@ -24,6 +75,7 @@ before_script:
script:
- ${TRAVIS_BUILD_DIR}/travis-ci/build.sh
- ${TRAVIS_BUILD_DIR}/travis-ci/run-tests.sh
after_success:
- ${TRAVIS_BUILD_DIR}/travis-ci/package.sh
......
This diff is collapsed.
......@@ -48,3 +48,10 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Hunspell DEFAULT_MSG HUNSPELL_LIBRARIES HUNSPE
# show the HUNSPELL_INCLUDE_DIR and HUNSPELL_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(HUNSPELL_INCLUDE_DIR HUNSPELL_LIBRARIES )
add_library(hunspell UNKNOWN IMPORTED)
set_target_properties(hunspell PROPERTIES IMPORTED_LOCATION ${HUNSPELL_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES ${HUNSPELL_INCLUDE_DIR})
if (NOT BUILD_SHARED_LIBS)
# At least statically compiled hunspell 1.7.0 requires HUNSPELL_STATIC
# For other versions, it should not hurt
set_target_properties(hunspell PROPERTIES INTERFACE_COMPILE_DEFINITIONS HUNSPELL_STATIC)
endif ()
......@@ -10,6 +10,7 @@
# Redistribution and use of this file is allowed according to the terms of the
# MIT license. For details see the file COPYING-CMAKE-MODULES.
if ( NOT PREFER_BUNDLED_SYNCTEX )
if ( SYNCTEX_INCLUDE_DIR AND SYNCTEX_LIBRARIES )
# in cache already
......@@ -50,8 +51,7 @@ IF ( SYNCTEX_INCLUDE_DIR AND EXISTS "${SYNCTEX_INCLUDE_DIR}/synctex_parser.h" )
string(REGEX REPLACE "^Version: ([0-9]+).*$" "\\1" SYNCTEX_VERSION_MAJOR "${SYNCTEX_PARSER_H}")
string(REGEX REPLACE "^Version: ${SYNCTEX_VERSION_MAJOR}\\.([0-9]+).*$" "\\1" SYNCTEX_VERSION_MINOR "${SYNCTEX_PARSER_H}")
set(SYNCTEX_VERSION_PATCH 0)
set(SYNCTEX_VERSION_STRING "${SYNCTEX_VERSION_MAJOR}.${SYNCTEX_VERSION_MINOR}.${SYNCTEX_VERSION_PATCH}")
set(SYNCTEX_VERSION_STRING "${SYNCTEX_VERSION_MAJOR}.${SYNCTEX_VERSION_MINOR}")
ENDIF ()
include(FindPackageHandleStandardArgs)
......@@ -60,3 +60,22 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Synctex REQUIRED_VARS SYNCTEX_LIBRARIES SYNCTE
# show the SYNCTEX_INCLUDE_DIR and SYNCTEX_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(SYNCTEX_INCLUDE_DIR SYNCTEX_LIBRARIES )
endif ( NOT PREFER_BUNDLED_SYNCTEX )
if ( NOT SYNCTEX_FOUND )
# If we didn't find a system-wide synctex (or didn't look for one), use the
# bundled version
set(SYNCTEX_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/modules/synctex")
set(SYNCTEX_LIBRARIES "SyncTeX")
add_subdirectory("${SYNCTEX_INCLUDE_DIR}")
if ( SYNCTEX_INCLUDE_DIR AND EXISTS "${SYNCTEX_INCLUDE_DIR}/synctex_parser.h" )
file(STRINGS "${SYNCTEX_INCLUDE_DIR}/synctex_parser.h" SYNCTEX_PARSER_H REGEX "Version: [0-9.]+")
string(REGEX REPLACE ".*Version: ([0-9]+).*" "\\1" SYNCTEX_VERSION_MAJOR "${SYNCTEX_PARSER_H}")
string(REGEX REPLACE ".*Version: ${SYNCTEX_VERSION_MAJOR}\\.([0-9]+).*" "\\1" SYNCTEX_VERSION_MINOR "${SYNCTEX_PARSER_H}")
set(SYNCTEX_VERSION_STRING "${SYNCTEX_VERSION_MAJOR}.${SYNCTEX_VERSION_MINOR}")
endif ()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Synctex REQUIRED_VARS SYNCTEX_LIBRARIES SYNCTEX_INCLUDE_DIR VERSION_VAR SYNCTEX_VERSION_STRING )
endif ( NOT SYNCTEX_FOUND )
......@@ -108,18 +108,32 @@ MACRO(CREATE_QT_PRO_FILE _pro_path _pro_include_path)
FILE(WRITE ${_pro_path} "${_pro_content}\n")
ENDMACRO(CREATE_QT_PRO_FILE)
# QT_ADD_QM_TRANSLATIONS(<output_var> <1.qm> [<2.qm> ...])
MACRO(QT_ADD_QM_TRANSLATIONS _qm_res)
# QT_ADD_TRANSLATIONS(<output_var> <1.ts|1.qm> [<2.ts|2.qm> ...])
MACRO(QT_ADD_TRANSLATIONS outfile)
# Construct an appropriate resource file
SET(_qm_qrc "<!DOCTYPE RCC>\n<RCC version=\"1.0\">\n<qresource>\n")
FOREACH(_qm_file ${ARGN})
FILE(RELATIVE_PATH _qm_file ${CMAKE_CURRENT_BINARY_DIR} ${_qm_file})
GET_FILENAME_COMPONENT(_qm_filename ${_qm_file} NAME)
FOREACH(_file ${ARGN})
GET_FILENAME_COMPONENT(_ext ${_file} EXT)
set(_qm_file "")
if (_ext MATCHES "ts")
# .ts source files need to be converted
if (QT_VERSION_MAJOR EQUAL 5)
qt5_add_translation(_qm_file "${_file}")
else()
qt4_add_translation(_qm_file "${_file}")
endif()
elseif (_ext MATCHES "qm")
# .qm files are taken as is
set(_qm_file "${_file}")
endif()
GET_FILENAME_COMPONENT(_qm_filename "${_qm_file}" NAME)
SET(_qm_qrc "${_qm_qrc}<file alias=\"resfiles/translations/${_qm_filename}\">${_qm_file}</file>\n")
ENDFOREACH(_qm_file ${_qm_files})
ENDFOREACH(_file)
SET(_qm_qrc "${_qm_qrc}</qresource>\n</RCC>\n")
SET(_qm_qrc_path ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_trans.qrc)
FILE(WRITE ${_qm_qrc_path} ${_qm_qrc})
QT_ADD_RESOURCES(${_qm_res} ${_qm_qrc_path})
ENDMACRO(QT_ADD_QM_TRANSLATIONS)
QT_ADD_RESOURCES(${outfile} ${_qm_qrc_path})
ENDMACRO(QT_ADD_TRANSLATIONS)
......@@ -12,105 +12,105 @@
# - TeXworks-specific patches are applied to
# - help Qt apps find the poppler-data directory.
# - use native Mac OS X font handling (instead of fontconfig)
#
# Upstream source: https://github.com/Homebrew/homebrew-core/blob/master/Formula/poppler.rb
class Poppler < Formula
desc "PDF rendering library (based on the xpdf-3.0 code base)"
homepage "https://poppler.freedesktop.org/"
url "https://poppler.freedesktop.org/poppler-0.54.0.tar.xz"
sha256 "10cca9a67cc2e6f4f9024192b1067c444218bf94430891f43dc819d78536ca31"
url "https://poppler.freedesktop.org/poppler-0.74.0.tar.xz"
sha256 "92e09fd3302567fd36146b36bb707db43ce436e8841219025a82ea9fb0076b2f"
head "https://anongit.freedesktop.org/git/poppler/poppler.git"
# BEGIN TEXWORKS MODIFICATION
# bottle do
# rebuild 1
# sha256 "5b6de69e6ab1996332934e21b3a5220990e2a5943775d002ee8e5c2447b93758" => :sierra
# sha256 "44fcbb473c78c5ce034b65885fcb2e05d4ef0b2d537a043b7d2b6d44d075907b" => :el_capitan
# sha256 "47787f7ffa8f69dea50ebb1391186d8146386ad46f2f6b69e3786b7271caeb9d" => :yosemite
# sha256 "f1c8ead874f888f7324a5ca6c95efd5e04519038393a89a6f7c030b8807bddc1" => :mojave
# sha256 "5d050e5f3355e4a72c9bfe4128108a4f64228c0e10fe6bb51aac32a07c10e707" => :high_sierra
# sha256 "438fc1e448307d1bf17bdc37eb74bbc645ff526b26dd0423915b5f68af12a49d" => :sierra
# end
version '0.54.0-texworks'
version '0.74.0-texworks'
TEXWORKS_SOURCE_DIR = Pathname.new(__FILE__).realpath.dirname.join('../../..')
TEXWORKS_PATCH_DIR = TEXWORKS_SOURCE_DIR + 'lib-patches/'
patch do
url "file://" + TEXWORKS_PATCH_DIR + 'poppler-0001-Fix-bogus-memory-allocation-in-SplashFTFont-makeGlyp.patch'
sha256 "3b40b066995756a0c80badfe47e701bb0438305f3b8eb15b67875c7de38c7290"
sha256 "0d974f87b8c0993aeb8ea70401e3b2419b7d8ee6c25b982c84bbdcb6e0152c71"
end
patch do
url "file://" + TEXWORKS_PATCH_DIR + 'poppler-0002-Native-Mac-font-handling.patch'
sha256 "41cedfe209c203833574ace4c60c0440840cb03f7ba687a27a3a350b0d868cc4"
sha256 "40ed5889583ea4e20bdf3ed642dfb3f948224a84280593b0ced979a90464d011"
end
patch do
url "file://" + TEXWORKS_PATCH_DIR + 'poppler-0003-Add-support-for-persistent-GlobalParams.patch'
sha256 "6c17fe4d91c7c5d77e265af48c511db31fce73370cd2af4cbacc218435c9c86a"
sha256 "fb18b1747f47a608e4b5cd06ab1332df7d12c05e1d1c65526ed2505e07298fd7"
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
# END TEXWORKS MODIFICATION
option "with-qt", "Build Qt5 backend"
option "with-little-cms2", "Use color management system"
deprecated_option "with-qt4" => "with-qt"
deprecated_option "with-qt5" => "with-qt"
deprecated_option "with-lcms2" => "with-little-cms2"
depends_on "cmake" => :build
depends_on "gobject-introspection" => :build
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "fontconfig"
depends_on "freetype"
depends_on "gettext"
depends_on "glib"
depends_on "gobject-introspection"
depends_on "jpeg"
depends_on "libpng"
depends_on "libtiff"
depends_on "little-cms2"
depends_on "nss"
depends_on "openjpeg"
depends_on "qt" => :optional
depends_on "little-cms2" => :optional
depends_on "qt"
conflicts_with "pdftohtml", "pdf2image", "xpdf",
:because => "poppler, pdftohtml, pdf2image, and xpdf install conflicting executables"
resource "font-data" do
url "https://poppler.freedesktop.org/poppler-data-0.4.7.tar.gz"
sha256 "e752b0d88a7aba54574152143e7bf76436a7ef51977c55d6bd9a48dccde3a7de"
url "https://poppler.freedesktop.org/poppler-data-0.4.9.tar.gz"
sha256 "1f9c7e7de9ecd0db6ab287349e31bf815ca108a5a175cf906a90163bdbe32012"
end
needs :cxx11 if build.with?("qt") || MacOS.version < :mavericks
def install
ENV.cxx11 if build.with?("qt") || MacOS.version < :mavericks
ENV["LIBOPENJPEG_CFLAGS"] = "-I#{Formula["openjpeg"].opt_include}/openjpeg-2.1"
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--enable-xpdf-headers
--enable-poppler-glib
--disable-gtk-test
--enable-introspection=yes
--disable-poppler-qt4
ENV.cxx11
args = std_cmake_args + %w[
-DBUILD_GTK_TESTS=OFF
-DENABLE_CMS=lcms2
-DENABLE_GLIB=ON
-DENABLE_QT5=ON
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON
-DWITH_GObjectIntrospection=ON
]
if build.with? "qt"
args << "--enable-poppler-qt5"
else
args << "--disable-poppler-qt5"
end
args << "--enable-cms=lcms2" if build.with? "little-cms2"
# BEGIN TEXWORKS MODIFICATION
# We changed the config file (to add native font handling), so we need to
# update the configure script
system "autoreconf", "-ivf"
# END TEXWORKS MODIFICATION
system "./configure", *args
system "cmake", ".", *args
system "make", "install"
system "make", "clean"
system "cmake", ".", "-DBUILD_SHARED_LIBS=OFF", *args
system "make"
lib.install "libpoppler.a"
lib.install "cpp/libpoppler-cpp.a"
lib.install "glib/libpoppler-glib.a"
resource("font-data").stage do
system "make", "install", "prefix=#{prefix}"
end
libpoppler = (lib/"libpoppler.dylib").readlink
[
"#{lib}/libpoppler-cpp.dylib",
"#{lib}/libpoppler-glib.dylib",
"#{lib}/libpoppler-qt5.dylib",
*Dir["#{bin}/*"],
].each do |f|
macho = MachO.open(f)
macho.change_dylib("@rpath/#{libpoppler}", "#{lib}/#{libpoppler}")
macho.write!
end
# fix gobject-introspection support
# issue reported upstream as https://gitlab.freedesktop.org/poppler/poppler/issues/18
# patch attached there does not work though...
inreplace share/"gir-1.0/Poppler-0.18.gir", "@rpath", lib.to_s
system "g-ir-compiler", "--output=#{lib}/girepository-1.0/Poppler-0.18.typelib", share/"gir-1.0/Poppler-0.18.gir"
end
test do
......
......@@ -49,8 +49,10 @@ PROJECT(TeXworks)
# We require CMake v2.8 or greater because it is the first version that
# provides support for certain parts of Qt, such as the ScriptTools.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6)
CMAKE_POLICY(VERSION 2.8.6)
# Also, 2.8.11 added the possibility to define INTERFACE_COMPILE_DEFINITIONS
# on imported libraries required by recent versions of hunspell (e.g. 1.7.0)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
CMAKE_POLICY(VERSION 2.8.11)
# Silence warning about linking to qtmain.lib statically on Windows
IF(POLICY CMP0020)
......@@ -68,6 +70,10 @@ SET(CMAKE_COLOR_MAKEFILE ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CMAKE_AUTOMOC TRUE)
# Make the contents of `CMake/Modules` available. Among other things, this
# directory contains scripts that locate project components such as hunspell.
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules ${CMAKE_MODULE_PATH})
IF(WIN32 AND MINGW)
# Ensure that no cpp flags are passed to windres, the Windows resource compiler.
# At least with MinGW 4 on Windows, that would cause problems
......@@ -136,6 +142,24 @@ MARK_AS_ADVANCED(BUILD_SHARED_PLUGINS)
OPTION(PREFER_BUNDLED_SYNCTEX "Use SyncTeX bundled with TeXworks even if a shared library is found?" OFF)
MARK_AS_ADVANCED(PREFER_BUNDLED_SYNCTEX)
OPTION(WITH_TESTS "build unit tests" ON)
IF (WITH_TESTS)
ENABLE_TESTING(TRUE)
ENDIF (WITH_TESTS)
OPTION(WITH_COVERAGE "build with lcov coverage support" OFF)
IF (WITH_COVERAGE)
IF (NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" AND WITH_TESTS))
MESSAGE(WARNING "Coverage support is intended to be used with Debug builds and testing enabled")
ENDIF ()
INCLUDE(CodeCoverage)
APPEND_COVERAGE_COMPILER_FLAGS()
IF (UNIX)
SET(COVERAGE_LCOV_EXCLUDES '/usr/*')
ENDIF (UNIX)
SETUP_TARGET_FOR_COVERAGE_LCOV(NAME coverage EXECUTABLE "${CMAKE_CTEST_COMMAND}")
ENDIF (WITH_COVERAGE)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CACHE PATH "Path to place libraries in")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CACHE PATH "Path to place programs in")
MARK_AS_ADVANCED(CMAKE_LIBRARY_OUTPUT_DIRECTORY CMAKE_RUNTIME_OUTPUT_DIRECTORY)
......@@ -165,12 +189,12 @@ ENDIF ()
IF (UNIX AND NOT APPLE)
SET(TeXworks_HELP_DIR share/doc/texworks-help CACHE PATH "Path where TeXworks looks for help files")
SET(TeXworks_DIC_DIR /usr/share/myspell/dicts CACHE PATH "Path where TeXworks looks for spellchecking dictionaries")
SET(TeXworks_DIC_DIR /usr/share/hunspell:/usr/share/myspell/dicts CACHE PATH "Path where TeXworks looks for spellchecking dictionaries")
SET(TeXworks_DOCS_DIR share/doc/texworks CACHE PATH "Path in which documentation files are installed")
SET(TeXworks_ICON_DIR share/pixmaps CACHE PATH "Path in which icons are installed")
SET(TeXworks_MAN_DIR share/man/man1 CACHE PATH "Path in which manpages are installed")
SET(TeXworks_DESKTOP_DIR share/applications CACHE PATH "Path in which .desktop files are installed")
SET(TeXworks_APPDATA_DIR share/appdata CACHE PATH "Path in which .appdata.xml files are installed")
SET(TeXworks_APPDATA_DIR share/metainfo CACHE PATH "Path in which .appdata.xml files are installed")
MARK_AS_ADVANCED(TeXworks_HELP_DIR)
MARK_AS_ADVANCED(TeXworks_DIC_DIR)
MARK_AS_ADVANCED(TeXworks_DOCS_DIR)
......@@ -183,34 +207,62 @@ IF (UNIX AND NOT APPLE)
ENDIF()
ENDIF()
set(CMAKE_CXX_STANDARD 11)
# Source: https://stackoverflow.com/a/31010221
macro(use_cxx11)
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif ()
else ()
set (CMAKE_CXX_STANDARD 11)
endif ()
endmacro(use_cxx11)
use_cxx11()
# Dependency Configuration
# ========================
# Make the contents of `CMake/Modules` available. Among other things, this
# directory contains scripts that locate project components such as hunspell.
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules ${CMAKE_MODULE_PATH})
set(DESIRED_QT_VERSION "" CACHE STRING "Pick a version of Qt to use: 4 or 5")
MARK_AS_ADVANCED(DESIRED_QT_VERSION)
include(FindPackageMessage)
MACRO(find_qt5_package pkg)
find_package(${pkg} QUIET)
if (${pkg}_FOUND)
set(_msg "Found ${pkg}")
if (${pkg}_DIR)
set(_msg "${_msg}: ${${pkg}_DIR}")
endif()
if (${pkg}_VERSION)
set(_msg "${_msg} (found version ${${pkg}_VERSION})")
endif()
FIND_PACKAGE_MESSAGE(${pkg} ${_msg} "[${${pkg_FOUND}}][${${pkg}_DIR}][${${pkg}_VERSION}]")
else()
FIND_PACKAGE_MESSAGE(${pkg} "Could not find ${pkg}" "[${${pkg_FOUND}}][${${pkg}_DIR}][${${pkg}_VERSION}]")
endif()
ENDMACRO()
# Check for Qt5 by default
IF (NOT DESIRED_QT_VERSION OR DESIRED_QT_VERSION MATCHES 5)
find_package(Qt5Widgets QUIET)
find_package(Qt5Gui QUIET)
find_package(Qt5UiTools QUIET)
find_package(Qt5Concurrent QUIET)
find_package(Qt5Script QUIET)
find_package(Qt5ScriptTools QUIET)
find_package(Qt5Xml QUIET)
find_qt5_package(Qt5Widgets QUIET)
find_qt5_package(Qt5Gui QUIET)
find_qt5_package(Qt5UiTools QUIET)
find_qt5_package(Qt5Concurrent QUIET)
find_qt5_package(Qt5Script QUIET)
find_qt5_package(Qt5ScriptTools QUIET)
find_qt5_package(Qt5Xml QUIET)
find_qt5_package(Qt5LinguistTools QUIET)
IF ( UNIX AND NOT APPLE )
find_package(Qt5DBus QUIET)
find_qt5_package(Qt5DBus QUIET)
ENDIF ()
IF ( WITH_TESTS )
find_qt5_package(Qt5Test QUIET)
ENDIF ( WITH_TESTS )
IF(Qt5Widgets_FOUND AND Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5UiTools_FOUND AND Qt5Concurrent_FOUND AND Qt5Script_FOUND AND Qt5ScriptTools_FOUND AND Qt5Xml_FOUND AND (NOT UNIX OR APPLE OR Qt5DBus_FOUND))
IF(Qt5Widgets_FOUND AND Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5UiTools_FOUND AND Qt5Concurrent_FOUND AND Qt5Script_FOUND AND Qt5ScriptTools_FOUND AND Qt5Xml_FOUND AND Qt5LinguistTools_FOUND AND (NOT UNIX OR APPLE OR Qt5DBus_FOUND) AND (NOT WITH_TESTS OR Qt5Test_FOUND))
SET(QT5_FOUND TRUE)
SET(QT_LIBRARIES Qt5::UiTools Qt5::ScriptTools Qt5::Script Qt5::Concurrent Qt5::Xml ${Qt5DBus_LIBRARIES} Qt5::Widgets Qt5::Gui Qt5::Core)
SET(QT_LIBRARIES Qt5::UiTools Qt5::ScriptTools Qt5::Script Qt5::Concurrent Qt5::Xml ${Qt5DBus_LIBRARIES} Qt5::Widgets Qt5::Gui Qt5::Core ${Qt5Test_LIBRARIES})
# Note: Qt5 only sets Qt5Widgets_VERSION, etc., but not QT_VERSION_MAJOR,
# etc. which is used here.
......@@ -249,6 +301,20 @@ IF (NOT DESIRED_QT_VERSION OR DESIRED_QT_VERSION MATCHES 5)
)
LIST(INSERT QT_LIBRARIES 0 ${Qt5QWindows_LIBRARIES} ${Qt5FontDatabaseSupport_LIBRARIES} ${Qt5EventDispatcherSupport_LIBRARIES} ${Qt5ThemeSupport_LIBRARIES})
endif()
# Starting with Qt 5.11, WindowsUIAutomation was added
if (QT_VERSION_MAJOR EQUAL 5 AND QT_VERSION_MINOR GREATER 10)
FIND_LIBRARY(Qt5WindowsUIAutomation_LIBRARIES Qt5WindowsUIAutomationSupport
HINTS "${QT_LIB_DIR}"
)
LIST(APPEND QT_LIBRARIES ${Qt5WindowsUIAutomation_LIBRARIES})
endif()
# Starting with Qt 5.10, AccessibilitySupport was modularized
if (QT_VERSION_MAJOR EQUAL 5 AND QT_VERSION_MINOR GREATER 9)
FIND_LIBRARY(Qt5AccessibilitySupport_LIBRARIES Qt5AccessibilitySupport
HINTS "${QT_LIB_DIR}"
)
LIST(APPEND QT_LIBRARIES ${Qt5AccessibilitySupport_LIBRARIES})
endif()
ADD_DEFINITIONS(-DSTATIC_QT5)
ENDIF()
......@@ -264,6 +330,10 @@ IF (DESIRED_QT_VERSION MATCHES 4 OR NOT QT5_FOUND)
QtScriptTools
QtXml
)
IF( WITH_TESTS )
LIST(APPEND QT_COMPONENTS QtTest)
ENDIF( WITH_TESTS )
IF ( UNIX AND NOT APPLE )
LIST(APPEND QT_COMPONENTS QtDbus)
......@@ -273,6 +343,10 @@ IF (DESIRED_QT_VERSION MATCHES 4 OR NOT QT5_FOUND)
# with Qt-specific tasks such as compiling resources or running `moc`.
FIND_PACKAGE(Qt4 COMPONENTS ${QT_COMPONENTS} REQUIRED)
INCLUDE(UseQt4)
# TODO: QtTest is included in the list of "normal" libraries.
# Therefore, QT_TEST_LIBRARIES is not set here. Can we improve this somehow
# (i.e., can we pull in QtTest only for programs that actually use it)?
ENDIF()
IF (NOT QT4_FOUND AND NOT QT5_FOUND)
......@@ -289,22 +363,16 @@ INCLUDE( TranslationMacros )
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(Hunspell REQUIRED)
IF ( NOT PREFER_BUNDLED_SYNCTEX )
FIND_PACKAGE(Synctex QUIET)
ENDIF ( NOT PREFER_BUNDLED_SYNCTEX )
FIND_PACKAGE(Synctex QUIET)
# Aggregate library names and include directories into variables for easy
# access.
SET(TeXworks_INCLUDE_DIRS
${SYNCTEX_INCLUDE_DIR}
${QT_INCLUDE_DIR}
${HUNSPELL_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
)
IF ( SYNCTEX_FOUND AND NOT PREFER_BUNDLED_SYNCTEX )
LIST(APPEND TeXworks_INCLUDE_DIRS ${SYNCTEX_INCLUDE_DIR})
ENDIF ()
SET(TeXworks_LIB_DIRS ${QT_LIBRARY_DIR})
set(TEXWORKS_ADDITIONAL_LIBS "" CACHE STRING "Additional libraries not found by CMake")
......@@ -312,15 +380,13 @@ MARK_AS_ADVANCED(TEXWORKS_ADDITIONAL_LIBS)
SET(TeXworks_LIBS
${HUNSPELL_LIBRARIES}
${SYNCTEX_LIBRARIES}
hunspell
${QT_LIBRARIES}
${ZLIB_LIBRARIES}
${TEXWORKS_ADDITIONAL_LIBS}
)
IF ( SYNCTEX_FOUND AND NOT PREFER_BUNDLED_SYNCTEX )
LIST(APPEND TeXworks_LIBS ${SYNCTEX_LIBRARIES})
ENDIF ()
# Configure Optional Dependencies
......@@ -414,6 +480,12 @@ IF ( PYTHONLIBS_FOUND AND WITH_PYTHON )
ADD_SUBDIRECTORY(${TeXworks_SOURCE_DIR}/plugins-src/TWPythonPlugin)
ENDIF ()
# Tests
# -----
IF (WITH_TESTS)
ADD_SUBDIRECTORY(unit-tests)
ENDIF (WITH_TESTS)
# Packaging
# =========
......
// This file is used to identify the latest git commit. Please do not touch.
#define GIT_COMMIT_HASH "7ecce17"
#define GIT_COMMIT_DATE "2017-04-29 18:23:51 +0200"
#define GIT_COMMIT_HASH "1e0a134"
#define GIT_COMMIT_DATE "2019-03-05 22:02:03 +0100"
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="es_MX">
<context>
<name>QtPDF</name>
<message>
<source>[language name]</source>
<translation>español</translation>
</message>
<message>
<source>[translator&apos;s name/email]</source>
<translation>Luis Montgomery Antelo/monty.luis@gmail.com</translation>
</message>
</context>
<context>
<name>QtPDF::PDFDocumentScene</name>
<message>
<source>rendering page</source>
<translation>renderizando de páginas</translation>
</message>
<message>
<source>Unlock PDF</source>
<translation>Desbloquear PDF</translation>
</message>
<message>
<source>Please enter the password to unlock the PDF</source>
<translation>Por favor, introduzca la contraseña para desbloquear el PDF</translation>
</message>
<message>
<source>Incorrect password</source>
<translation>Contraseña incorrecta</translation>
</message>
<message>
<source>The password you entered was incorrect.</source>
<translation>La contraseña es incorrecta.</translation>
</message>
<message>
<source>This document is locked. You need a password to open it.</source>
<translation>Este documento está bloqueado. Necesita una contraseña para abrirlo.</translation>
</message>
<message>
<source>Unlock</source>
<translation>Desbloquear</translation>
</message>
</context>
<context>
<name>QtPDF::PDFDocumentView</name>
<message>
<source>Insufficient permission</source>
<translation>Permisos insuficientes</translation>
</message>
<message>
<source>Text extraction is not allowed for this document.</source>
<translation>Documento sin permiso para la extracción de texto.</translation>
</message>
<message>
<source>Goto page %1</source>
<translation>Ir a página %1</translation>
</message>
<message>
<source