From nobody Thu Jan 04 01:16:53 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T57wP1wtYz559hd; Thu, 4 Jan 2024 01:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T57wP1Twkz40mZ; Thu, 4 Jan 2024 01:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704331013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5y2JbnGye3qH5J1C+rubi+Kk9DDYuTAUFny/flBzxj4=; b=chb6Pei1nMDgxWu40ObVsac/ALHWOok5oiOo3md/Hj0oJ//2qnpIlXp3dbAm+D3co/lZPB O2N/MQ5Ru8odKdTRNtKipluAl8RceIZJxkpdYkirWT2pHx28tWQACG3WiUwmbIiwb/c4ml 1ufd/wSu5QRjRbkJRtqbUJmzrQrrZ1YeY9Aj6BAw01uZqZzMrmZYStusZKbor8U7sIZ+4l FH0NZGxpT6J7AXlhD3ECkGLxyuS20eZEovm5CemLWhMYDAF7qJ7qnh1J1308YXJjmfwdaJ zJkiaa2CR/XHAHh6sIvXQJEDwBYU1i9Y76S4UYhyi2Y8uqYX1J3HxWbOSuNruw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704331013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5y2JbnGye3qH5J1C+rubi+Kk9DDYuTAUFny/flBzxj4=; b=RgiHoi9tWQbywW5xrOzWOptuxdLTC4XAcGlWW53xf9TE73mjsOgVxXyigMzsH9fFfPh/CH 22QgzCzUcg/2VUqvUanLoFUC6PWTU7oDfSWZ/LkJS682r4ee3kBKEpjFDtml391BZFOcF/ wMmGHFqdfHBdCJMixOxHreUTMndQUue1YIB1g2VoYyk0Aq1YVqp5rsdtnB1ZvDb0/Q/XR/ 7dAbhDXv+GZ0nq491zA9p3w/1Vr9UVNlKX97DDEs3LjePzAIbB1M3MSkBr+FOIP+iJpu0O W9o+YQii7Miq9mbcjCCv6SPQOJBugWmq7AskFwqCtDWyyvqLqAy2kN1x8tQJMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704331013; a=rsa-sha256; cv=none; b=jRZvHngSQ3aEJ9nKspRY0WmSNoQ4iK7VKg9uKkwFm0XHFxVzWOHnMNe6lDSt9Dot1S/xPL T5A8svNimn60Bh8lmvxEz8pnrqcr2LKDmnxOxktJYgFPB/HmiJcf88w9u/mz2mQJCv/b2P e7oQLy+wK4Z22TPpAxUMm0JEwllEW1vwqnzsxHnJvGWuL+JyyLtwAodqN0I0n8axaTXD/9 mjSeGcAXre/NhUe55RR4jThnl2AqhuP2FpYNy01gNJK0DXkYZAiypXro8/KdKxeQfBhcWt N4XZj+ClHxAd66y4A957r72TAPngyu1QVZMCw3SlRjdxPFqcyQmCu3O43QtwXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T57wP0Zkdz17hc; Thu, 4 Jan 2024 01:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4041GrPW091326; Thu, 4 Jan 2024 01:16:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4041GrhS091323; Thu, 4 Jan 2024 01:16:53 GMT (envelope-from git) Date: Thu, 4 Jan 2024 01:16:53 GMT Message-Id: <202401040116.4041GrhS091323@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: b7afa2280b51 - main - print/sioyek: unbreak with mupdf 0.23 and unbundle synctex List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7afa2280b51d1abc3035f75799c8859534b149c Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=b7afa2280b51d1abc3035f75799c8859534b149c commit b7afa2280b51d1abc3035f75799c8859534b149c Author: Robert Clausecker AuthorDate: 2024-01-02 13:42:52 +0000 Commit: Robert Clausecker CommitDate: 2024-01-04 01:16:35 +0000 print/sioyek: unbreak with mupdf 0.23 and unbundle synctex - mupdf 0.23 dropped a symbol we need; apply a Debian patch to not require it - unbundle synctex See also: https://github.com/ahrm/sioyek/issues/804 Obtained from: https://salsa.debian.org/viccie30/sioyek/-/blob/debian/latest/debian/patches/0007-fix-build-with-mupdf-0.23.0.patch MFH: 2024Q1 --- print/sioyek/Makefile | 5 +- .../files/patch-pdf__viewer__build__config.pro | 20 ++++- print/sioyek/files/patch-pdf_parse_link_uri | 88 ++++++++++++++++++++++ 3 files changed, 108 insertions(+), 5 deletions(-) diff --git a/print/sioyek/Makefile b/print/sioyek/Makefile index 481313cb4270..6d4903679dd9 100644 --- a/print/sioyek/Makefile +++ b/print/sioyek/Makefile @@ -1,7 +1,7 @@ PORTNAME= sioyek DISTVERSIONPREFIX= v DISTVERSION= 2.0.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= print MAINTAINER= fuz@FreeBSD.org @@ -16,7 +16,8 @@ LIB_DEPENDS= libmupdf.so:graphics/mupdf \ libfreetype.so:print/freetype2 \ libjbig2dec.so:graphics/jbig2dec \ libmujs.so:lang/mujs \ - libopenjp2.so:graphics/openjpeg + libopenjp2.so:graphics/openjpeg \ + libsynctex.so:devel/tex-synctex USES= desktop-file-utils jpeg gl qmake qt:5 sqlite USE_GITHUB= yes diff --git a/print/sioyek/files/patch-pdf__viewer__build__config.pro b/print/sioyek/files/patch-pdf__viewer__build__config.pro index c70267963043..7270a1f80e8a 100644 --- a/print/sioyek/files/patch-pdf__viewer__build__config.pro +++ b/print/sioyek/files/patch-pdf__viewer__build__config.pro @@ -9,7 +9,16 @@ pdf_viewer/ui.h \ pdf_viewer/path.h \ pdf_viewer/utf8.h \ -@@ -55,7 +53,6 @@ SOURCES += pdf_viewer/book.cpp \ +@@ -37,8 +35,6 @@ HEADERS += pdf_viewer/book.h \ + pdf_viewer/utf8/checked.h \ + pdf_viewer/utf8/core.h \ + pdf_viewer/utf8/unchecked.h \ +- pdf_viewer/synctex/synctex_parser.h \ +- pdf_viewer/synctex/synctex_parser_utils.h \ + pdf_viewer/RunGuard.h \ + pdf_viewer/OpenWithApplication.h + +@@ -55,12 +51,9 @@ SOURCES += pdf_viewer/book.cpp \ pdf_viewer/checksum.cpp \ pdf_viewer/new_file_checker.cpp \ pdf_viewer/coordinates.cpp \ @@ -17,12 +26,17 @@ pdf_viewer/ui.cpp \ pdf_viewer/path.cpp \ pdf_viewer/utils.cpp \ -@@ -82,7 +79,7 @@ unix:!mac { +- pdf_viewer/synctex/synctex_parser.c \ +- pdf_viewer/synctex/synctex_parser_utils.c \ + pdf_viewer/RunGuard.cpp \ + pdf_viewer/OpenWithApplication.cpp + +@@ -82,7 +75,7 @@ unix:!mac { } else { DEFINES += NON_PORTABLE DEFINES += LINUX_STANDARD_PATHS - LIBS += -ldl -lmupdf -lmupdf-third -lgumbo -lharfbuzz -lfreetype -ljbig2dec -ljpeg -lmujs -lopenjp2 -lz -+ LIBS += -ldl -lmupdf -lmupdf-third -lharfbuzz -lfreetype -ljbig2dec -ljpeg -lmujs -lopenjp2 -lz -lsqlite3 ++ LIBS += -ldl -lmupdf -lmupdf-third -lharfbuzz -lfreetype -ljbig2dec -ljpeg -lmujs -lopenjp2 -lz -lsqlite3 -lsynctex } isEmpty(PREFIX){ diff --git a/print/sioyek/files/patch-pdf_parse_link_uri b/print/sioyek/files/patch-pdf_parse_link_uri new file mode 100644 index 000000000000..086ed17f9a0b --- /dev/null +++ b/print/sioyek/files/patch-pdf_parse_link_uri @@ -0,0 +1,88 @@ +From: Patrycja Rosa +Date: Fri, 25 Aug 2023 22:44:26 +0200 +Subject: fix build with mupdf-0.23.0 + +Fix for disappeared symbol in mupdf 0.23. + +Origin: vendor, https://git.alpinelinux.org/aports/commit/?id=86e913eccf19b97a16f25d9b6cdf0f50232f1226 +Bug: https://github.com/ahrm/sioyek/issues/804 +--- + pdf_viewer/document_view.cpp | 2 +- + pdf_viewer/main_widget.cpp | 6 +++--- + pdf_viewer/utils.cpp | 5 +++-- + pdf_viewer/utils.h | 2 +- + 4 files changed, 8 insertions(+), 7 deletions(-) + +diff --git pdf_viewer/document_view.cpp pdf_viewer/document_view.cpp +index f48d05e..0bc3855 100644 +--- pdf_viewer/document_view.cpp ++++ pdf_viewer/document_view.cpp +@@ -1121,7 +1121,7 @@ std::vector DocumentView::find_line_definitions() { + + std::optional 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(mupdf_context, pdf_link.value().uri); ++ auto parsed_uri = parse_uri(mupdf_context, current_document->doc, pdf_link.value().uri); + result.push_back({ parsed_uri.page - 1, parsed_uri.x, parsed_uri.y }); + return result; + } +diff --git pdf_viewer/main_widget.cpp pdf_viewer/main_widget.cpp +index 19b568b..335a93f 100644 +--- pdf_viewer/main_widget.cpp ++++ pdf_viewer/main_widget.cpp +@@ -170,7 +170,7 @@ void MainWidget::set_overview_position(int page, float offset) { + + void MainWidget::set_overview_link(PdfLink link) { + +- auto [page, offset_x, offset_y] = parse_uri(mupdf_context, link.uri); ++ auto [page, offset_x, offset_y] = parse_uri(mupdf_context, doc()->doc, link.uri); + if (page >= 1) { + set_overview_position(page - 1, offset_y); + } +@@ -3178,7 +3178,7 @@ void MainWidget::handle_pending_text_command(std::wstring text) { + open_web_url(utf8_decode(selected_link->uri)); + } + else{ +- auto [page, offset_x, offset_y] = parse_uri(mupdf_context, selected_link->uri); ++ auto [page, offset_x, offset_y] = parse_uri(mupdf_context, doc()->doc, selected_link->uri); + long_jump_to_destination(page-1, offset_y); + } + } +@@ -3863,7 +3863,7 @@ void MainWidget::handle_link_click(const PdfLink& link) { + return; + } + +- auto [page, offset_x, offset_y] = parse_uri(mupdf_context, link.uri); ++ auto [page, offset_x, offset_y] = parse_uri(mupdf_context, doc()->doc, link.uri); + + // convert one indexed page to zero indexed page + page--; +diff --git pdf_viewer/utils.cpp pdf_viewer/utils.cpp +index 22d4265..3150e66 100644 +--- pdf_viewer/utils.cpp ++++ pdf_viewer/utils.cpp +@@ -116,8 +116,9 @@ bool rects_intersect(fz_rect rect1, fz_rect rect2) { + return range_intersects(rect1.x0, rect1.x1, rect2.x0, rect2.x1) && range_intersects(rect1.y0, rect1.y1, rect2.y0, rect2.y1); + } + +-ParsedUri parse_uri(fz_context* mupdf_context, std::string uri) { +- fz_link_dest dest = pdf_parse_link_uri(mupdf_context, uri.c_str()); ++ParsedUri parse_uri(fz_context* mupdf_context, fz_document* fz_doc, std::string uri) { ++ pdf_document* doc = pdf_document_from_fz_document(mupdf_context, fz_doc); ++ fz_link_dest dest = pdf_resolve_link_dest(mupdf_context, doc, uri.c_str()); + return { dest.loc.page + 1, dest.x, dest.y }; + } + +diff --git pdf_viewer/utils.h pdf_viewer/utils.h +index 2a12211..643b030 100644 +--- pdf_viewer/utils.h ++++ pdf_viewer/utils.h +@@ -55,7 +55,7 @@ void get_flat_toc(const std::vector& roots, std::vector& + 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(fz_context* mupdf_context, std::string uri); ++ParsedUri parse_uri(fz_context* mupdf_context, fz_document* fz_doc, std::string uri); + char get_symbol(int key, bool is_shift_pressed, const std::vector&special_symbols); + + template