diff --git a/community/sioyek/APKBUILD b/community/sioyek/APKBUILD index 8c5f521b1c7962b4d8f7e8796a12d075701574ab..aad8558013c33a4aaa87ffaaabe85146db00c94f 100644 --- a/community/sioyek/APKBUILD +++ b/community/sioyek/APKBUILD @@ -1,8 +1,8 @@ # Contributor: Jakub Jirutka <jakub@jirutka.cz> # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=sioyek -pkgver=1.5.0 -pkgrel=2 +pkgver=2.0.0 +pkgrel=0 pkgdesc="PDF viewer designed for reading research papers and technical books" url="https://sioyek.info" arch="all !aarch64 !armhf !armv7" # fails to build @@ -15,7 +15,6 @@ makedepends=" " subpackages="$pkgname-doc" source="https://github.com/ahrm/sioyek/archive/v$pkgver/sioyek-$pkgver.tar.gz - mupdf-1.20.patch fix-mupdf-libs.patch $pkgname.desktop " @@ -38,8 +37,7 @@ package() { } sha512sums=" -2bea4b9c2e7eff859768e88eedc6acf6a597e1df212c426b8974d8c92023d7b9ce920730f53a49de0d25cf2c56bcda3ec626cfd1b84cb4b0d20544ffe9a550d2 sioyek-1.5.0.tar.gz -37d9bbf3d15834b3ca78f5faf992d60d90638a75a4d53f1bbecb178a7feb71ea207c6c3d943135be4515b9572f0d7c83a11e3632878dbb4753ec91886567e80b mupdf-1.20.patch +3ed9959ddbc133b9c7bb241f8076da886b74790a475646911dc6d38724160ae8335020db308e405c60fce49b9260536861e8946199f1670dc8c2331e9fbd2e00 sioyek-2.0.0.tar.gz d2b802b75804a0986a2ad39b7609e503655780d96eec18e0f2dd378797f273d055d75265ad949f471b8befa287279be79e8b6215eb2ff63b168b574ca66d0e9c fix-mupdf-libs.patch 4ecc56d9a3448f420af502ac0428bb063680f41d99d468ac2a92034d2b107e010914708cbd7e006f524e24fe4e229849fb8e68a60e42f744057c9c02301fad9a sioyek.desktop " diff --git a/community/sioyek/mupdf-1.20.patch b/community/sioyek/mupdf-1.20.patch deleted file mode 100644 index 6471618736e8e0ce626595490ca94d99f95ebc8f..0000000000000000000000000000000000000000 --- a/community/sioyek/mupdf-1.20.patch +++ /dev/null @@ -1,124 +0,0 @@ -Patch-Source: https://aur.archlinux.org/cgit/aur.git/tree/mupdf-1.20.patch?h=sioyek --- -diff '--color=auto' --unified --recursive --text sioyek-1.5.0-original/pdf_viewer/document.cpp sioyek-1.5.0-patched/pdf_viewer/document.cpp ---- sioyek-1.5.0-original/pdf_viewer/document.cpp 2022-08-20 16:46:51.000000000 +0200 -+++ sioyek-1.5.0-patched/pdf_viewer/document.cpp 2022-08-28 05:37:44.991162090 +0200 -@@ -559,14 +559,14 @@ - current_node->title = utf8_decode(root->title); - current_node->x = root->x; - current_node->y = root->y; -- if (root->page == -1) { -+ if (root->page.page == -1) { - float xp, yp; - fz_location loc = fz_resolve_link(context, doc, root->uri, &xp, &yp); - int chapter_page = accum_chapter_pages[loc.chapter]; - current_node->page = chapter_page + loc.page; - } - else { -- current_node->page = root->page; -+ current_node->page = root->page.page; - } - convert_toc_tree(root->down, current_node->children); - -diff '--color=auto' --unified --recursive --text sioyek-1.5.0-original/pdf_viewer/document_view.cpp sioyek-1.5.0-patched/pdf_viewer/document_view.cpp ---- sioyek-1.5.0-original/pdf_viewer/document_view.cpp 2022-08-20 16:46:51.000000000 +0200 -+++ sioyek-1.5.0-patched/pdf_viewer/document_view.cpp 2022-08-28 05:38:37.022162775 +0200 -@@ -1050,7 +1050,7 @@ - - std::optional<PdfLink> pdf_link = current_document->get_link_in_page_rect(get_center_page_number(), line_rects[line_index]); - if (pdf_link.has_value()) { -- auto parsed_uri = parse_uri(pdf_link.value().uri); -+ auto parsed_uri = parse_uri(mupdf_context, pdf_link.value().uri); - result.push_back({ parsed_uri.page - 1, parsed_uri.x, parsed_uri.y }); - return result; - } -diff '--color=auto' --unified --recursive --text sioyek-1.5.0-original/pdf_viewer/main_widget.cpp sioyek-1.5.0-patched/pdf_viewer/main_widget.cpp ---- sioyek-1.5.0-original/pdf_viewer/main_widget.cpp 2022-08-20 16:46:51.000000000 +0200 -+++ sioyek-1.5.0-patched/pdf_viewer/main_widget.cpp 2022-08-28 05:39:56.916162839 +0200 -@@ -151,7 +151,7 @@ - - void MainWidget::set_overview_link(PdfLink link) { - -- auto [page, offset_x, offset_y] = parse_uri(link.uri); -+ auto [page, offset_x, offset_y] = parse_uri(mupdf_context, link.uri);; - if (page >= 1) { - set_overview_position(page - 1, offset_y); - } -@@ -2841,7 +2841,7 @@ - open_web_url(utf8_decode(selected_link->uri)); - } - else{ -- auto [page, offset_x, offset_y] = parse_uri(selected_link->uri); -+ auto [page, offset_x, offset_y] = parse_uri(mupdf_context, selected_link->uri); - long_jump_to_destination(page-1, offset_y); - } - } -@@ -3452,7 +3452,7 @@ - return; - } - -- auto [page, offset_x, offset_y] = parse_uri(link.uri); -+ auto [page, offset_x, offset_y] = parse_uri(mupdf_context, link.uri); - - // convert one indexed page to zero indexed page - page--; -diff '--color=auto' --unified --recursive --text sioyek-1.5.0-original/pdf_viewer/pdf_renderer.cpp sioyek-1.5.0-patched/pdf_viewer/pdf_renderer.cpp ---- sioyek-1.5.0-original/pdf_viewer/pdf_renderer.cpp 2022-08-20 16:46:51.000000000 +0200 -+++ sioyek-1.5.0-patched/pdf_viewer/pdf_renderer.cpp 2022-08-28 05:40:36.068162490 +0200 -@@ -315,7 +315,7 @@ - - const int max_hits_per_page = 20; - fz_quad hitboxes[max_hits_per_page]; -- int num_results = fz_search_page(mupdf_context, page, utf8_encode(req.search_term).c_str(), hitboxes, max_hits_per_page); -+ int num_results = fz_search_page(mupdf_context, page, utf8_encode(req.search_term).c_str(), nullptr, hitboxes, max_hits_per_page); - - if (num_results > 0) { - req.search_results_mutex->lock(); -diff '--color=auto' --unified --recursive --text sioyek-1.5.0-original/pdf_viewer/utils.cpp sioyek-1.5.0-patched/pdf_viewer/utils.cpp ---- sioyek-1.5.0-original/pdf_viewer/utils.cpp 2022-08-20 16:46:51.000000000 +0200 -+++ sioyek-1.5.0-patched/pdf_viewer/utils.cpp 2022-08-28 05:42:07.857280562 +0200 -@@ -23,6 +23,7 @@ - #include <qnetworkrequest.h> - #include <qnetworkreply.h> - #include <qscreen.h> -+#include <mupdf/pdf.h> - - extern std::wstring LIBGEN_ADDRESS; - extern std::wstring GOOGLE_SCHOLAR_ADDRESS; -@@ -106,21 +107,9 @@ - return range_intersects(rect1.x0, rect1.x1, rect2.x0, rect2.x1) && range_intersects(rect1.y0, rect1.y1, rect2.y0, rect2.y1); - } - --ParsedUri parse_uri(std::string uri) { -- int comma_index = -1; -- -- uri = uri.substr(1, uri.size() - 1); -- comma_index = static_cast<int>(uri.find(",")); -- int page = atoi(uri.substr(0, comma_index ).c_str()); -- -- uri = uri.substr(comma_index+1, uri.size() - comma_index-1); -- comma_index = static_cast<int>(uri.find(",")); -- float offset_x = atof(uri.substr(0, comma_index ).c_str()); -- -- uri = uri.substr(comma_index+1, uri.size() - comma_index-1); -- float offset_y = atof(uri.c_str()); -- -- return { page, offset_x, offset_y }; -+ParsedUri parse_uri(fz_context* mupdf_context, std::string uri) { -+ fz_link_dest dest = pdf_parse_link_uri(mupdf_context, uri.c_str()); -+ return { dest.loc.page + 1, dest.x, dest.y }; - } - - char get_symbol(int key, bool is_shift_pressed, const std::vector<char>& special_symbols) { -diff '--color=auto' --unified --recursive --text sioyek-1.5.0-original/pdf_viewer/utils.h sioyek-1.5.0-patched/pdf_viewer/utils.h ---- sioyek-1.5.0-original/pdf_viewer/utils.h 2022-08-20 16:46:51.000000000 +0200 -+++ sioyek-1.5.0-patched/pdf_viewer/utils.h 2022-08-28 05:42:31.572410725 +0200 -@@ -33,7 +33,7 @@ - int mod(int a, int b); - bool range_intersects(float range1_start, float range1_end, float range2_start, float range2_end); - bool rects_intersect(fz_rect rect1, fz_rect rect2); --ParsedUri parse_uri(std::string uri); -+ParsedUri parse_uri(fz_context* mupdf_context, std::string uri); - char get_symbol(int key, bool is_shift_pressed, const std::vector<char>&special_symbols); - - template<typename T>