Compare commits

...

245 Commits
0.1.3 ... main

Author SHA1 Message Date
tastytea 1058903def
Add more information about RPMs to readme. 10 months ago
tastytea 5d28b1f4ef
CI: Modify zypper repos more elegantly. 10 months ago
tastytea bb37e53207
CI: refresh zypper data, resolve build dir conflict. 10 months ago
tastytea 1bddad7083
CI: Fix openSUSE dependencies. 10 months ago
tastytea 7daade6425
CI: Fix sed command. 10 months ago
tastytea c41f3a2485
CI: Add package generation for openSUSE Leap 15. 10 months ago
tastytea 3e23dc2cd9
CI: Build apt and zypper steps in parallel. 10 months ago
tastytea 9c6dd5ca64
CI: Add rpm package cache. 10 months ago
tastytea c62799e00f
CI Add openSUSE with GCC 9. 10 months ago
tastytea 636e84408c
Compile with debug flags and sanitizers in CI. 10 months ago
tastytea ef77a9e4fb
Make sanitizers optional. 10 months ago
tastytea 552df1a49e
Don't crash if language detection fails. 10 months ago
tastytea 1e0cde8a4b
Fix test, print exceptions. 10 months ago
tastytea 2bede91fb7
Remove some superfluous “std::”. 10 months ago
tastytea 165592982a
Update german translation. 10 months ago
tastytea b1dcdea95e
Add language attribute to HTML output. 10 months ago
tastytea 299063e02c
Add language to books, documents and matches. 10 months ago
tastytea fca719634a
Move OPF file path detection into own function. 10 months ago
tastytea d2aff45018
Move spine_filepaths() from zip:: to book::. 10 months ago
tastytea b134bd0301
Add pointer to preferred text version (raw or cleaned) to document. 10 months ago
tastytea d0738891c2
Ensure the correct order of files and the TOC. 11 months ago
tastytea b53e99306c
Re-add support for raw text searching. 11 months ago
tastytea 84ef5d1bf3
Move book processing into own file. 11 months ago
tastytea 97fecd37f0
Revert "Remove generator from CMake presets." – it is required. 11 months ago
tastytea e154b62201
Add “Similar projects” to readme. 12 months ago
tastytea 90eb30fa3e
Add sub-headings for option categories in man page. 1 year ago
tastytea 9cc1823b3b
clang-tidy: Set cognitive complexity threshold to 30. 1 year ago
tastytea 2489c444df
Add experimental RPM packe config to CMake config. 1 year ago
tastytea c99c01162d
Silence some clang-tidy warnings. 1 year ago
tastytea 49de44f729
Remove generator from CMake presets. 1 year ago
tastytea bdcf153b47
Fix usage quick-help. 1 year ago
tastytea 57c87ca5e7
Fix typo in german translation. 1 year ago
tastytea 5c0ca46c9d
Version bump 0.6.0. 1 year ago
tastytea 691dea092d
typo. 1 year ago
tastytea 07ec6f789f
Update german translation. 1 year ago
tastytea 979dc9334c
Re-order --help messages. 1 year ago
tastytea 961deff41d
Add --status and --status-interval. 1 year ago
tastytea 1cf6306f4b
Add linter-exception for EXIT_FATAL. 1 year ago
tastytea 822bff1955
Don't crash on regex errors. 1 year ago
tastytea 18c3d8f58d
Do not show prefix in output if there is no metadata. 1 year ago
tastytea b2a6f9217b
Add examples to man page. 1 year ago
tastytea babd7e4f61
Ignore dap-mode file. 1 year ago
tastytea ed86f3a56d
Add link to HTML version of of the man page. 1 year ago
tastytea f8270369b6
Make whitespace-reduction a bit more efficient. 1 year ago
tastytea 3966b99c3f
Update german translation. 1 year ago
tastytea 37c2fe1bb1
Add HTML output. 1 year ago
tastytea a77b90c8b1
Document output::json_all(). 1 year ago
tastytea 42e5e52e1b
Update dependencies-on-debian section in readme. 1 year ago
tastytea 1eb763fc37
Mention bullseye-packages in apt-repo. 1 year ago
tastytea 633274e3dd
Version bump 0.5.1. 1 year ago
tastytea 51f8422929
Make HTML entity map static. 1 year ago
tastytea 8b5c0d289e
print_matches(): Don't check file name for each match. 1 year ago
tastytea 7b817c42d1
Remove pseudo-HTML bug from man page. 1 year ago
tastytea be4d8aecd0
Mixed up types. 1 year ago
tastytea 1c8279f96f
Add test that asks for more context than is available. 1 year ago
tastytea f59c86e20d
Don't search for whitespace beyond the start/end of the text. 1 year ago
tastytea 0470acb00e
Make --raw work again. 1 year ago
tastytea 1e29608c7e
Fix positioning of matches in search::search(). 1 year ago
tastytea 5e89a71e00
Update tests for search::headline() and search::page(). 1 year ago
tastytea 9708bb69c8
Don't attempt to access a pointer to nowhere. 1 year ago
tastytea b8431019b7
Don't inject page numbers and headline-markers into the text. 1 year ago
tastytea ebb8b63830
Mention inserted page markers in man page. 1 year ago
tastytea a49c500d0f
Fix <style> and <script> erasure. 1 year ago
tastytea 262aab6671
Add debug log for replacements. 1 year ago
tastytea 9067b387ef
Fix pagebreak-iterators. 1 year ago
tastytea 99e1cd8e98
Re-enabled address sanitizer. 1 year ago
tastytea bdf9a86651
Fix pagebreak-regex and range in which pagebreaks are searched. 1 year ago
tastytea f1a0015f28
Disable address sanitizer. 1 year ago
tastytea fbf86f51d1
CMake: Add presets for GCC and clang. 1 year ago
tastytea 12e1c64fc0
Make text formatting more readable. 1 year ago
tastytea 4026937f08
Don't return pointer to freed memory address. 1 year ago
tastytea cb2aee847f
Add address sanitizer to debug flags. 1 year ago
tastytea 4b09158037
Add automatic package generation for Debian bullseye (11). 1 year ago
tastytea 226b66b77b
Update maximum supported CMake version. 1 year ago
tastytea 92b8281242
Fix CI recipe. 1 year ago
tastytea 2b51229518
Change ctest verbosity to default. 1 year ago
tastytea bc34a3a515
Make ctest work from build directory. 1 year ago
tastytea 85a00bb23c
Add CMake presets. 1 year ago
tastytea d83f485fb4
Ignore CMake user presets. 1 year ago
tastytea 7252463fbb
Update rebuild-commands in translator guide. 1 year ago
tastytea 7d8cf7de91
Cosmetic fixes. 1 year ago
tastytea 5af10f6767
Fix configuration file example. 1 year ago
tastytea d1c74d244d
Update screenshot. 1 year ago
tastytea 21cd476be0
Bump version of german translation. 1 year ago
tastytea cfa850b020
Fix lowest tested nlohmann_json version. 1 year ago
tastytea de2001a442
Fix nlohmann_json error with old versions. 1 year ago
tastytea ba2161fa47
Fix explanation for --json in man page. 1 year ago
tastytea 5d6fdc599f
Version bump 0.5.0. 1 year ago
tastytea d56cf4de56
Update german translation. 1 year ago
tastytea 6a4511099f
Do not add empty matches to matches_all. 1 year ago
tastytea 21989aabfe
Fix JSON output. 1 year ago
tastytea f1cb16f6d0
Add JSON output. 1 year ago
tastytea 7b4b9edfe5
Rename file names in search::matches to make it more clear. 1 year ago
tastytea ffec9578e6
Add note for Debians weird package naming. 1 year ago
tastytea 3166c7a823
Update credits. 1 year ago
tastytea 88e4e78db8
Add nlohmann_json dependency. 1 year ago
tastytea b0b6c00a90
Log application exit. 1 year ago
tastytea a7fae314b3
Log some progress info to log file. 1 year ago
tastytea 6278779029
Don't mask previous failures. 1 year ago
tastytea 40e39dc0e7
Umm… nothing to see here… 😄 1 year ago
tastytea 1dd6235260
Mention --debug in bug reporting guideline. 1 year ago
tastytea 892d757aa4
Add --debug to manpage. 1 year ago
tastytea 07915bdf87
Add lots of debug output. 1 year ago
tastytea 017059cb5b
Make options::options printable (for use in debug output). 1 year ago
tastytea a8db304bf1
Add DEBUGLOG macro. 1 year ago
tastytea 580f08b823
Output info messages to stderr with --debug. 1 year ago
tastytea 28c0a5a797
Add --debug switch and enable debugging if it is on. 1 year ago
tastytea b12f88003b
Fix text logging and debug logging. 1 year ago
tastytea 17b6017fe0
Rename init_debug() → enable_debug(), add documentation. 1 year ago
tastytea 12a1c47259
Make log_path a variable again. 1 year ago
tastytea a8f2b7dfb6
Add equipment for debug logs. 1 year ago
tastytea c35434e745
Simplify LOG macro. 1 year ago
tastytea 5250b2974d
Update german translation. 1 year ago
tastytea 4c1bae86ba
Add fatal errors. 1 year ago
tastytea 1fee4f5afd
Fix file error reporting. 1 year ago
tastytea 80e2e9d05d
Re-add -DBOOST_LOG_DYN_LINK 1 year ago
tastytea c30a8b40be
Older Boost version need log_setup in addition to log. 1 year ago
tastytea 1d02c3bd6d
Add workaround for old CMake←→Boost combinations. 1 year ago
tastytea f184a19832
Add log file location to man page. 1 year ago
tastytea 1d70b16596
Add libboost-log-dev dependency to CI and readme. 1 year ago
tastytea 77d013c12a
Change config file path. 1 year ago
tastytea b966be3021
Log suppressed errors to log file. 1 year ago
tastytea 7a68ec6191
Add note about the log file to bug report info. 1 year ago
tastytea 18f8600174
Change log file directory. 1 year ago
tastytea 11572d5b29
Use logger for warnings end errors. 1 year ago
tastytea ac5b31f2d5
Add logger. 1 year ago
tastytea cf583c6d7f
Don't compile sources twice. 1 year ago
tastytea 78ada56226
Make input files required. 1 year ago
tastytea 11a8989370
CMake: Make GLOB work with new files (most of the time). 1 year ago
tastytea ea2fbc8dd7
Update build instructions. 1 year ago
tastytea 76ed0c9dbf
Un-escape named and numbered entities in documents before searching. 1 year ago
tastytea 8a9be5d45b
Add helpers::unescape_html() &amp; tests. 1 year ago
tastytea 7f31d897cf
Add/move tests for helpers. 1 year ago
tastytea 7ddfe32e30
Move is_whitespace() and urldecode() to helpers. 1 year ago
tastytea af9563e669
Typo. 1 year ago
tastytea 94564fa914
Strip whitespace from headlines. 1 year ago
tastytea da22a54a8a
Update german translation. 1 year ago
tastytea 22cae4c3cd
Output metadata italic, chapters underlined. 1 year ago
tastytea fe23fcf04b
Rename prefix to metadata in print_matches(). 1 year ago
tastytea 03138c1dbf
Remove unnecessary include. 1 year ago
tastytea e7633fe134
Rename prefix to before and suffix to after. 1 year ago
tastytea 6255d665af
Replace tabs with a space in search::cleanup(). 1 year ago
tastytea 4eb210710b
CI: Don't install catch for package generation. 1 year ago
tastytea 82193d529c
Fix tests. 1 year ago
tastytea d7ad180721
Use iterators in search::context() and don't return extra whitespace 1 year ago
tastytea ded11af5fb
Add tests for EPUB files. 1 year ago
tastytea c1613a8f52
Add test for zip::urldecode(). 1 year ago
tastytea 59ceaa7cdc
Add another test for search::headline(). 1 year ago
tastytea 790e60a055
Fix end-of-headline detection. 1 year ago
tastytea 0accd77a2c
Version bump 0.4.0. 1 year ago
tastytea 160ff20387
Revert "Fix pugixml target." 1 year ago
tastytea 6f934470c7
Add type to drone config. 1 year ago
tastytea c1d2e8fa21
Clean up .editorconfig. 1 year ago
tastytea 2a3e3f87b5
Fix pugixml target. 1 year ago
tastytea 92d1b66c76
CI: Workaround for pugixml on bionic. 1 year ago
tastytea e7756c8f87
Drop minimum pugixml version. 1 year ago
tastytea df55ed9dba
CI: Add pugixml_DIR 1 year ago
tastytea 37e868b3f2
Remove <style> and <script> snippets. 1 year ago
tastytea 737d0a10b6
Update german translation. 1 year ago
tastytea 2d65961688
Output XML errors. 1 year ago
tastytea ba5716c585
Skip in-epub file if it is not found, except it's the container. 1 year ago
tastytea 5bd1030ad8
Try opf: variants of XML tags if normal variants are not found. 1 year ago
tastytea 03b367ee98
Don't print same file path twice in error message. 1 year ago
tastytea 00e3edb9f2
Only search files in spine, in the right order. 1 year ago
tastytea c94d9de0db
Reformat error messages. 1 year ago
tastytea 26678812c9
Typo in man page. 1 year ago
tastytea 4ff796a590
Make regular expressions static variables. 1 year ago
tastytea 4df7b36dfc
Print matches while still searching. 1 year ago
tastytea 59759b5934
Put output stuff into own function in different file. 1 year ago
tastytea 65de7f7efb
Version bump 0.3.2. 1 year ago
tastytea 719018a0f6
CI: Verify CMake download with checksum, don't verify TLS cert. 1 year ago
tastytea 762d4b94cb
Update german translation. 1 year ago
tastytea 308e2d271f
Skip rest of file if encoding of files in EPUB is broken. 1 year ago
tastytea 65b46ca846
Do not allow more threads than max_threads. 1 year ago
tastytea b3f392e110
Update screenshot. 1 year ago
tastytea d9025d3c60
Update Debian & Ubuntu installation. 1 year ago
tastytea af30fae319
CI: Upload focal image. 1 year ago
tastytea e4b2e8ad98
CI: Fix GCC version in bionic. 1 year ago
tastytea 74d1713078
Fix CI recipe for focal packages. 1 year ago
tastytea f65d927680
CI: Download CMake in Packaging-pipeline. 1 year ago
tastytea 3f58b27709
Fix config file example in man page. 1 year ago
tastytea dc4b233c3e
Fix typos in manpage. 1 year ago
tastytea 40874c2d36
Update german translation. 1 year ago
tastytea 8fde3b7bd4
Version bump 0.3.1. 1 year ago
tastytea c3131e01f0
Add setting to suppress this-is-not-an-EPUB errors. 1 year ago
tastytea 84f600196c
Add error code to zip::exception. 1 year ago
tastytea b96315f8bb
Don't add extra newlines before errors. 1 year ago
tastytea 2b91a839cc
Add --raw and --context again. 1 year ago
tastytea 8d5565a72c
Don't write to matches_all simultaneously from different threads. 1 year ago
tastytea 38bf9be948
Fix some more memory leaks. 1 year ago
tastytea b24ea9b71e
Fix memory leak. 🤦 1 year ago
tastytea ef8fdced51
Update german translation. 1 year ago
tastytea fbb87cac81
Remove a few unnecessary .data(), remove unnecessary include. 1 year ago
tastytea 919da2ddb6
CI: Switch to GCC-8 in Ubuntu bionic. 1 year ago
tastytea c0cab0005f
Version bump 0.3.0. 1 year ago
tastytea c50659a339
Chunk error string to make it better translatable. 1 year ago
tastytea e64591f204
Rework option parsing, change --no-filename. 1 year ago
tastytea c376ce8466
Print the EPUB file name if more than 1 input file. 1 year ago
tastytea 0c45e7ac98
Add --recursive and --dereference-recursive. 1 year ago
tastytea b764f5423c
Put input files into a std::vector<filesystem::path>. 1 year ago
tastytea 29ae22cc4a
Make regex const. 1 year ago
tastytea 8ed72af8e9
Update german translation. 1 year ago
tastytea a3b0964873
Remove old comment. 1 year ago
tastytea d107ce5c31
Modify config file example. 1 year ago
tastytea 7dcf6d599c
Remove debug statements. 1 year ago
tastytea fe02b155f5
Import std::string into epubgrep::search namespace. 1 year ago
tastytea fc0aa02bc9
Use threads if more than one input file is searched. 1 year ago
tastytea 554caebcef
Make GETTEXT_CREATE_TRANSLATIONS-hack silent. 1 year ago
tastytea 10396f0d81
CMake: Prefer Config, make Termcolor-message more visible. 1 year ago
tastytea 6a612caa14
Don't generate checksums. We do that in the CI. 1 year ago
tastytea f20f95ff21
Set up drone CI for Debian / Ubuntu package uploading. 1 year ago
tastytea 8114d1a200
Set up recipe for Debian package generation. 1 year ago
tastytea ab3b98c1b7
Add HOMEPAGE_URL to CMake recipe. 1 year ago
tastytea 694cb3bc44
Add --no-filename switch. 1 year ago
tastytea 9c307ab0fd
Add test for HTML tags in titles. 1 year ago
tastytea 785fba691f
Debian repo doesn't work for 18.04. 1 year ago
tastytea 710bf42e0b
Clarify that the pot-file is created during build. 1 year ago
tastytea c59474d589
Fix wrong headline level in readme, clarify version requirements. 1 year ago
tastytea 759e065264
Add Ubuntu info to Debian repo info. 1 year ago
tastytea 95afc2289d
Add installation instructions for Debian buster. 1 year ago
tastytea e1356644c4
Add sudo to commands in readme. 1 year ago
tastytea 55678a8d03
Output message if bundled version of Termcolor is used. 1 year ago
tastytea 81f16bef7d
Improve compile instructions. 1 year ago
tastytea 96a3a8fe76
Fix typo in alt text of screenshot. 1 year ago
tastytea 9d5f771eaa
Remove redundant “license”. 1 year ago
tastytea 1c1cccbcd3
Update german translation. 1 year ago
tastytea 2372dd36ad
Version bump 0.2.0. 1 year ago
tastytea 85a4991775
Fix unterminated ` in readme. 1 year ago
tastytea cf82aa2247
Move screenshot a bit further down. 1 year ago
tastytea b6347aeab4
Add --nocolor to man page. 1 year ago
tastytea 488573e349
Clarify that the bundled version of Terminfo may be used. 1 year ago
tastytea a99ccb6469
Add installation instructions for Gentoo. 1 year ago
tastytea fd8db544bd
Add --nocolor switch. 1 year ago
tastytea 8d361f88d7
Add screenshot. 1 year ago
tastytea 382bd71676
Don't install files from bundles termcolor. 1 year ago
tastytea 165d8597b6
Improve short description and add license information to readme. 1 year ago
tastytea b9df8a8279
Typo in readme, add Termcolor to CREDITS. 1 year ago
tastytea b72d3f3420
Color matches bright magenta. 1 year ago
tastytea d3c3062cc0
Add Termcolor dependency and bundle it in dist/. 1 year ago
tastytea b557656649 Merge commit '6c33fb4dcebd5464d89ca3fb98bdf23847d81fbf' as 'dist/termcolor' 1 year ago
tastytea 6c33fb4dce Squashed 'dist/termcolor/' content from commit 9a832a1 1 year ago
tastytea ce015954ea
Only initialize search::options once. 1 year ago
tastytea af58d6e35a
Make file paths in pot-file relative to project directory. 1 year ago
tastytea 15a6436597
Update german translation. 1 year ago
tastytea 01464bef50
Bump version to 0.1.3, fix typos. 1 year ago
  1. 3
      .clang-tidy
  2. 263
      .drone.yml
  3. 4
      .editorconfig
  4. 2
      .gitignore
  5. 28
      CMakeLists.txt
  6. 62
      CMakePresets.json
  7. 15
      CONTRIBUTING.adoc
  8. 15
      CREDITS
  9. 121
      README.adoc
  10. 13
      cmake/debug_flags.cmake
  11. 57
      cmake/packages.cmake
  12. 3
      dist/termcolor/.gitignore
  13. 1
      dist/termcolor/.mailmap
  14. 156
      dist/termcolor/.travis.yml
  15. 55
      dist/termcolor/CMakeLists.txt
  16. 31
      dist/termcolor/LICENSE
  17. 236
      dist/termcolor/README.rst
  18. 4
      dist/termcolor/cmake/config.cmake.in
  19. BIN
      dist/termcolor/docs/_static/example.png
  20. 36
      dist/termcolor/docs/conf.py
  21. 11
      dist/termcolor/docs/index.rst
  22. 23
      dist/termcolor/examples/cmake-external/CMakeLists.txt
  23. 10
      dist/termcolor/examples/cmake-external/example.cpp
  24. 17
      dist/termcolor/examples/cmake-fetch/CMakeLists.txt
  25. 10
      dist/termcolor/examples/cmake-fetch/example.cpp
  26. 7
      dist/termcolor/examples/cmake-package/CMakeLists.txt
  27. 10
      dist/termcolor/examples/cmake-package/example.cpp
  28. 7
      dist/termcolor/examples/cmake-submodule/CMakeLists.txt
  29. 10
      dist/termcolor/examples/cmake-submodule/example.cpp
  30. 911
      dist/termcolor/include/termcolor/termcolor.hpp
  31. 151
      dist/termcolor/test/test.cpp
  32. 113
      man/epubgrep.1.adoc
  33. BIN
      screenshot.png
  34. 20
      src/CMakeLists.txt
  35. 306
      src/book.cpp
  36. 73
      src/book.hpp
  37. 53
      src/files.cpp
  38. 34
      src/files.hpp
  39. 196
      src/helpers.cpp
  40. 23
      src/helpers.hpp
  41. 95
      src/log.cpp
  42. 57
      src/log.hpp
  43. 278
      src/main.cpp
  44. 223
      src/options.cpp
  45. 45
      src/options.hpp
  46. 225
      src/output.cpp
  47. 41
      src/output.hpp
  48. 197
      src/search.cpp
  49. 50
      src/search.hpp
  50. 61
      src/zip.cpp
  51. 3
      src/zip.hpp
  52. 6
      tests/CMakeLists.txt
  53. BIN
      tests/test.epub2
  54. BIN
      tests/test.epub3
  55. 111
      tests/test_helpers.cpp
  56. 191
      tests/test_search_epub.cpp
  57. 66
      tests/test_search_helpers.cpp
  58. 64
      tests/test_search_zip.cpp
  59. 11
      translations/CMakeLists.txt
  60. 201
      translations/de.po

3
.clang-tidy

@ -39,9 +39,10 @@ CheckOptions: # ↓ Clashes with static private member prefix. (static int _va
- { key: readability-identifier-naming.ProtectedMemberCase, value: lower_case }
- { key: readability-identifier-naming.ProtectedMemberPrefix, value: _ }
- { key: readability-identifier-naming.ClassCase, value: lower_case }
- { key: readability-identifier-naming.ClassCase, value: lower_case }
- { key: readability-identifier-naming.StructCase, value: lower_case }
- { key: readability-identifier-naming.EnumCase, value: lower_case }
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
- { key: readability-function-cognitive-complexity.Threshold, value: 30 }
...

263
.drone.yml

@ -1,11 +1,15 @@
# -*- fill-column: 1000 -*-
kind: pipeline
name: Build x86_64
kind: pipeline
type: docker
volumes:
- name: debian-package-cache
- name: deb-package-cache
host:
path: /var/cache/debian-package-cache
path: /var/cache/deb-package-cache
- name: rpm-package-cache
host:
path: /var/cache/rpm-package-cache
trigger:
event:
@ -13,7 +17,7 @@ trigger:
- tag
steps:
- name: GCC 10 / clang 11
- name: GCC 10 / clang 11 (debug)
image: debian:bullseye-slim
pull: always
environment:
@ -26,20 +30,20 @@ steps:
- alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get'
- apt-get update -q
- apt-get install -qq build-essential cmake clang locales
- apt-get install -qq catch libboost-program-options-dev libboost-locale-dev libboost-regex-dev gettext libarchive-dev libfmt-dev asciidoc
- rm -rf build && mkdir -p build && cd build
- cmake -G "Unix Makefiles" -DWITH_TESTS=YES ..
- apt-get install -qq catch libboost-program-options-dev libboost-locale-dev libboost-regex-dev libboost-log-dev gettext libarchive-dev libfmt-dev asciidoc libpugixml-dev nlohmann-json3-dev
- rm -rf build_deb && mkdir -p build_deb && cd build_deb
- cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" -DWITH_TESTS=YES -DWITH_SANITIZERS=YES ..
- make VERBOSE=1
- make install DESTDIR=install
- cd tests && ctest -V
- cd ../../
- rm -rf build && mkdir -p build && cd build
- CXX="clang++" cmake -G "Unix Makefiles" -DWITH_TESTS=YES ..
- ctest -V
- cd ../
- rm -rf build_deb && mkdir -p build_deb && cd build_deb
- CXX="clang++" cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" -DWITH_TESTS=YES -DWITH_SANITIZERS=YES ..
- make VERBOSE=1
- make install DESTDIR=install
- cd tests && ctest -V
- ctest -V
volumes:
- name: debian-package-cache
- name: deb-package-cache
path: /var/cache/apt/archives
- name: Download CMake 3.12 installer
@ -47,36 +51,64 @@ steps:
settings:
source: https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.sh
destination: cmake_installer.sh
skip_verify: true
sha256: 052b7daa2adab40211c6644da200ef95096d2adbcebd4cc5e60230d9023168bd
- name: GCC 7 / clang 6
- name: GCC 8 / clang 6
image: ubuntu:bionic
pull: always
environment:
CXX: g++-7
CXX: g++-8
CXXFLAGS: -pipe -O2
DEBIAN_FRONTEND: noninteractive
LANG: C.UTF-8
pugixml_DIR: "/usr/share/libpugixml-dev/cmake"
nlohmann_json_DIR: "/usr/lib/cmake"
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get'
- apt-get update -q
- apt-get install -qq build-essential clang locales
- apt-get install -qq catch libboost-program-options-dev libboost-locale-dev libboost-regex-dev gettext libarchive-dev libfmt-dev asciidoc
- apt-get install -qq g++-8 build-essential clang locales
- apt-get install -qq catch libboost-program-options-dev libboost-locale-dev libboost-regex-dev libboost-log-dev gettext libarchive-dev libfmt-dev asciidoc libpugixml-dev nlohmann-json-dev
- sh cmake_installer.sh --skip-license --exclude-subdir --prefix=/usr/local
- rm -rf build && mkdir -p build && cd build
- cp /usr/lib/x86_64-linux-gnu/libpugixml* /lib/x86_64-linux-gnu/
- rm -rf build_deb && mkdir -p build_deb && cd build_deb
- cmake -G "Unix Makefiles" -DWITH_TESTS=YES ..
- make VERBOSE=1
- make install DESTDIR=install
- cd tests && ctest -V
- cd ../../
- rm -rf build && mkdir -p build && cd build
- ctest -V
- cd ../
- rm -rf build_deb && mkdir -p build_deb && cd build_deb
- CXX="clang++" cmake -G "Unix Makefiles" -DWITH_TESTS=YES ..
- make VERBOSE=1
- make install DESTDIR=install
- cd tests && ctest -V
- ctest -V
volumes:
- name: debian-package-cache
- name: deb-package-cache
path: /var/cache/apt/archives
depends_on:
- GCC 10 / clang 11 (debug)
- Download CMake 3.12 installer
- name: GCC 9
image: opensuse/leap:15
pull: always
environment:
CXX: g++-9
CXXFLAGS: -pipe -O2
LANG: C.UTF-8
commands:
- zypper --non-interactive modifyrepo --all --keep-packages
- zypper --non-interactive install cmake gcc9-c++ rpm-build
- zypper --non-interactive install Catch2-devel libboost_program_options1_75_0-devel libboost_locale1_75_0-devel libboost_log1_75_0-devel fmt-devel libarchive-devel pugixml-devel nlohmann_json-devel asciidoc
- rm -rf build_rpm && mkdir -p build_rpm && cd build_rpm
- cmake -G "Unix Makefiles" -DWITH_TESTS=YES ..
- make VERBOSE=1
- make install DESTDIR=install
- ctest -V
volumes:
- name: rpm-package-cache
path: /var/cache/zypp/packages
- name: notify
image: drillster/drone-email
@ -90,3 +122,188 @@ steps:
from_secret: email_password
when:
status: [ changed, failure ]
---
name: Packages x86_64
kind: pipeline
type: docker
volumes:
- name: deb-package-cache
host:
path: /var/cache/deb-package-cache
trigger:
event:
- tag
steps:
- name: Debian bullseye
image: debian:bullseye-slim
pull: always
environment:
CXX: g++-10
CXXFLAGS: -pipe -O2
DEBIAN_FRONTEND: noninteractive
LANG: C.UTF-8
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get'
- apt-get update -q
- apt-get install -qq build-essential cmake clang locales lsb-release
- apt-get install -qq libboost-program-options-dev libboost-locale-dev libboost-regex-dev libboost-log-dev gettext libarchive-dev libfmt-dev asciidoc libpugixml-dev nlohmann-json3-dev
- rm -rf build_deb && mkdir -p build_deb && cd build_deb
- cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ..
- make VERBOSE=1
- make install DESTDIR=install
- cpack -G DEB
- cp -v epubgrep_${DRONE_TAG}-0_amd64_bullseye.deb ..
volumes:
- name: deb-package-cache
path: /var/cache/apt/archives
- name: Debian buster
image: debian:buster-slim
pull: always
environment:
CXX: g++-8
CXXFLAGS: -pipe -O2
DEBIAN_FRONTEND: noninteractive
LANG: C.UTF-8
nlohmann_json_DIR: "/usr/lib/cmake"
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get'
- apt-get update -q
- apt-get install -qq build-essential cmake clang locales lsb-release
- apt-get install -qq libboost-program-options-dev libboost-locale-dev libboost-regex-dev libboost-log-dev gettext libarchive-dev libfmt-dev asciidoc libpugixml-dev nlohmann-json-dev
- rm -rf build_deb && mkdir -p build_deb && cd build_deb
- cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ..
- make VERBOSE=1
- make install DESTDIR=install
- cpack -G DEB
- cp -v epubgrep_${DRONE_TAG}-0_amd64_buster.deb ..
volumes:
- name: deb-package-cache
path: /var/cache/apt/archives
depends_on:
- Debian bullseye
- name: Ubuntu focal
image: ubuntu:focal
pull: always
environment:
CXX: g++-9
CXXFLAGS: -pipe -O2
DEBIAN_FRONTEND: noninteractive
LANG: C.UTF-8
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get'
- apt-get update -q
- apt-get install -qq build-essential cmake clang locales lsb-release
- apt-get install -qq libboost-program-options-dev libboost-locale-dev libboost-regex-dev libboost-log-dev gettext libarchive-dev libfmt-dev asciidoc libpugixml-dev nlohmann-json3-dev
- rm -rf build_deb && mkdir -p build_deb && cd build_deb
- cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ..
- make VERBOSE=1
- make install DESTDIR=install
- cpack -G DEB
- cp -v epubgrep_${DRONE_TAG}-0_amd64_focal.deb ..
volumes:
- name: deb-package-cache
path: /var/cache/apt/archives
depends_on:
- Debian bullseye
- Ubuntu focal
- name: Download CMake 3.12 installer
image: plugins/download
settings:
source: https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.sh
destination: cmake_installer.sh
skip_verify: true
sha256: 052b7daa2adab40211c6644da200ef95096d2adbcebd4cc5e60230d9023168bd
- name: Ubuntu bionic
image: ubuntu:bionic
pull: always
environment:
CXX: g++-8
CXXFLAGS: -pipe -O2
DEBIAN_FRONTEND: noninteractive
LANG: C.UTF-8
pugixml_DIR: "/usr/share/libpugixml-dev/cmake"
nlohmann_json_DIR: "/usr/lib/cmake"
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get'
- apt-get update -q
- apt-get install -qq g++-8 build-essential clang locales lsb-release
- apt-get install -qq libboost-program-options-dev libboost-locale-dev libboost-regex-dev libboost-log-dev gettext libarchive-dev libfmt-dev asciidoc libpugixml-dev nlohmann-json-dev
- sh cmake_installer.sh --skip-license --exclude-subdir --prefix=/usr/local
- cp /usr/lib/x86_64-linux-gnu/libpugixml* /lib/x86_64-linux-gnu/
- rm -rf build_deb && mkdir -p build_deb && cd build_deb
- cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ..
- make VERBOSE=1
- make install DESTDIR=install
- cpack -G DEB
- cp -v epubgrep_${DRONE_TAG}-0_amd64_bionic.deb ..
volumes:
- name: deb-package-cache
path: /var/cache/apt/archives
depends_on:
- Debian bullseye
- Ubuntu focal
- Download CMake 3.12 installer
- name: openSUSE Leap 15
image: opensuse/leap:15
pull: always
environment:
CXX: g++-9
CXXFLAGS: -pipe -O2
LANG: C.UTF-8
commands:
- zypper --non-interactive modifyrepo --all --keep-packages
- zypper --non-interactive install cmake gcc9-c++ rpm-build lsb-release
- zypper --non-interactive install libboost_program_options1_75_0-devel libboost_locale1_75_0-devel libboost_log1_75_0-devel fmt-devel libarchive-devel pugixml-devel nlohmann_json-devel asciidoc
- rm -rf build_rpm && mkdir -p build_rpm && cd build_rpm
- cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ..
- make VERBOSE=1
- make install DESTDIR=install
- cpack -G RPM
- cp -v epubgrep-${DRONE_TAG}-0.x86_64.opensuse-$(lsb_release --release --short).rpm ..
volumes:
- name: rpm-package-cache
path: /var/cache/zypp/packages
- name: gitea_release
image: plugins/gitea-release
pull: always
settings:
base_url: https://schlomp.space
api_key:
from_secret: gitea_token
title: ${DRONE_TAG}
prerelease: true
files:
- epubgrep_${DRONE_TAG}-0_amd64_buster.deb
- epubgrep_${DRONE_TAG}-0_amd64_bullseye.deb
- epubgrep_${DRONE_TAG}-0_amd64_focal.deb
- epubgrep_${DRONE_TAG}-0_amd64_bionic.deb
- epubgrep-${DRONE_TAG}-0.x86_64.opensuse-$(lsb_release --release --short).rpm
checksum:
- sha512
- name: notification
image: drillster/drone-email
pull: always
settings:
host: mail.tzend.de
from: drone@tzend.de
username:
from_secret: email_username
password:
from_secret: email_password
when:
status: [ changed, failure ]

4
.editorconfig

@ -18,7 +18,3 @@ tab_width = 4
[{CMakeLists.txt,*.cmake}]
indent_size = 2
tab_width = 2
[{*.qml,*.qrc}]
indent_size = 4
tab_width = 4

2
.gitignore vendored

@ -3,3 +3,5 @@
/examples/example99*
/translations/*.pot
/translations/de
/CMakeUserPresets.json
/launch.json

28
CMakeLists.txt

@ -1,18 +1,21 @@
cmake_minimum_required(VERSION 3.12...3.18)
cmake_minimum_required(VERSION 3.12...3.20)
# Global build options.
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build.")
set(XGETTEXT_CMD "xgettext" CACHE STRING "The command for xgettext.")
project(epubgrep
VERSION 0.1.2
DESCRIPTION "Search tool for EPUB ebooks"
VERSION 0.6.0
DESCRIPTION "Search tool for EPUB e-books"
HOMEPAGE_URL "https://schlomp.space/tastytea/epubgrep"
LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Project build options.
option(WITH_TESTS "Compile tests." NO)
option(FALLBACK_BUNDLED "Fall back to bundled libs." YES)
option(WITH_SANITIZERS "Use sanitizers in debug builds." NO)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -21,18 +24,35 @@ set(CMAKE_CXX_EXTENSIONS OFF)
include(cmake/debug_flags.cmake)
# All dependencies except test dependencies.
find_package(Boost 1.65.0 REQUIRED COMPONENTS locale program_options regex)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
find_package(Boost 1.65.0 REQUIRED
COMPONENTS locale log_setup log program_options regex)
find_package(Gettext REQUIRED)
find_package(Filesystem REQUIRED COMPONENTS Final Experimental)
find_package(LibArchive 3.2 REQUIRED)
find_package(fmt 4 REQUIRED CONFIG)
find_package(termcolor CONFIG)
if(NOT termcolor_FOUND)
if(FALLBACK_BUNDLED)
m