From 247d5d3bd6fec5350e498c2cb0eb1505f97abc2e Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 16 May 2024 17:36:45 +0900 Subject: [PATCH] Added libzlcore-data-tqt cmake files Signed-off-by: Michele Calgaro --- CMakeLists.txt | 77 +++++++++++++++++++ ConfigureChecks.cmake | 25 ++++++ config.h.cmake | 8 ++ debian/compat | 1 + debian/control | 6 +- debian/libzlcore-data-tqt.install | 2 +- debian/rules | 1 + zlibrary/CMakeLists.txt | 14 ++++ zlibrary/core/CMakeLists.txt | 24 ++++++ .../config.desktop.xml => config.xml} | 0 10 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 ConfigureChecks.cmake create mode 100644 config.h.cmake create mode 100644 debian/compat create mode 100644 zlibrary/CMakeLists.txt create mode 100644 zlibrary/core/CMakeLists.txt rename zlibrary/core/data/{default/config.desktop.xml => config.xml} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ce91642 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,77 @@ +############################################ +# # +# Improvements and feedbacks are welcome # +# # +# This file is released under GPL >= 3 # +# # +############################################ + + +##### set project version ######################## + +include( TDEVersion ) +cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} ) +tde_set_project_version( ) + + +#### general package setup + +project( tde-ebook-reader ) + + +#### include essential cmake modules + +include( FindPkgConfig ) +include( CheckSymbolExists ) +include( CheckIncludeFile ) +include( CheckLibraryExists ) +include( CheckCSourceCompiles ) +include( CheckCXXSourceCompiles ) + + +#### include our cmake modules + +include( TDEMacros ) + + +##### setup install paths + +include( TDESetupPaths ) +tde_setup_paths( ) + + +##### optional stuff + +option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) + +option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) + + +##### user requested modules + +option( BUILD_ALL "Build all" ON ) +option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) + + +##### configure checks + +include( ConfigureChecks.cmake ) + + +###### global compiler settings + +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) +set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" ) + + +##### directories + +add_subdirectory( zlibrary ) +#add_subdirectory( tde-ebook-reader ) + + +##### write configure files + +configure_file( config.h.cmake config.h @ONLY ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..6460319 --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,25 @@ +########################################### +# # +# Improvements and feedback are welcome # +# # +# This file is released under GPL >= 3 # +# # +########################################### + + +# required stuff +find_package( TQt ) + +tde_setup_architecture_flags( ) + +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + +tde_setup_largefiles( ) + + +##### check for gcc visibility support + +if( WITH_GCC_VISIBILITY ) + tde_setup_gcc_visibility( ) +endif( WITH_GCC_VISIBILITY ) diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 0000000..77aba21 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,8 @@ +#define VERSION "@VERSION@" + +// Defined if you have fvisibility and fvisibility-inlines-hidden support. +#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 + +// Define WORDS_BIGENDIAN to 1 if your processor stores words with the most +// significant byte first (like Motorola and SPARC, unlike Intel). +#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control index 31e4c8e..97e81ed 100644 --- a/debian/control +++ b/debian/control @@ -3,10 +3,10 @@ Section: text Priority: optional Maintainer: TDE Debian Team XSBC-Original-Maintainer: Debian QA Group -Standards-Version: 4.7.0 -Build-Depends: cdbs, debhelper (>= 10~), quilt, tde-cmake, ninja-build, libtqtinterface-dev +Build-Depends: cdbs, debhelper (>= 10~), quilt, tde-cmake, ninja-build, libtqtinterface-dev, libbz2-dev, libcurl4-gnutls-dev, libexpat1-dev, libfribidi-dev, - libjpeg-dev, libsqlite3-dev, libunibreak-dev, libz-dev, pkgconf + libjpeg-dev, libsqlite3-dev, libunibreak-dev, libz-dev, pkgconf +Standards-Version: 4.7.0 Package: tde-ebook-reader Architecture: any diff --git a/debian/libzlcore-data-tqt.install b/debian/libzlcore-data-tqt.install index b4c24af..01ddbe6 100644 --- a/debian/libzlcore-data-tqt.install +++ b/debian/libzlcore-data-tqt.install @@ -1 +1 @@ -#usr/share/zlibrary +/usr/share/zlibrary-tqt diff --git a/debian/rules b/debian/rules index a6797f1..0589ec4 100755 --- a/debian/rules +++ b/debian/rules @@ -7,6 +7,7 @@ include debian/cdbs/debian-tde.mk DEB_CMAKE_EXTRA_FLAGS := \ -DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \ -DCMAKE_INSTALL_PREFIX="/opt/trinity" \ + -DCMAKE_ZLIBRARY_INSTALL_PREFIX="/usr" \ -DCONFIG_INSTALL_DIR="/etc/trinity" \ -DSYSCONF_INSTALL_DIR="/etc/trinity" \ -DXDG_MENU_INSTALL_DIR="/etc/xdg/menus" \ diff --git a/zlibrary/CMakeLists.txt b/zlibrary/CMakeLists.txt new file mode 100644 index 0000000..fcd0b42 --- /dev/null +++ b/zlibrary/CMakeLists.txt @@ -0,0 +1,14 @@ + +##### zlibrary-tqt install path + +_tde_internal_setup_path( + ZLIB_SHARE_INSTALL_PREFIX "${CMAKE_ZLIBRARY_INSTALL_PREFIX}/share/zlibrary-tqt" + "Base directory for zlibrary-tqt files which go to share/" +) + + +##### subfolders + +add_subdirectory( core ) +#add_subdirectory( text ) +#add_subdirectory( ui ) diff --git a/zlibrary/core/CMakeLists.txt b/zlibrary/core/CMakeLists.txt new file mode 100644 index 0000000..6b17cdb --- /dev/null +++ b/zlibrary/core/CMakeLists.txt @@ -0,0 +1,24 @@ + +##### install data files + +install( + FILES data/languagePatterns.zip data/unicode.xml.gz + DESTINATION ${ZLIB_SHARE_INSTALL_PREFIX} +) + +install( + FILES data/config.xml + DESTINATION ${ZLIB_SHARE_INSTALL_PREFIX}/default +) + +file( GLOB _enconding_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/data/encodings/* ) +install( + FILES ${_enconding_files} + DESTINATION ${ZLIB_SHARE_INSTALL_PREFIX}/encodings +) + +file( GLOB _resources_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/data/resources/*.xml ) +install( + FILES ${_resources_files} + DESTINATION ${ZLIB_SHARE_INSTALL_PREFIX}/resources +) diff --git a/zlibrary/core/data/default/config.desktop.xml b/zlibrary/core/data/config.xml similarity index 100% rename from zlibrary/core/data/default/config.desktop.xml rename to zlibrary/core/data/config.xml