@@ -4,27 +4,32 @@ class Paperjam < Formula
44 url "https://mj.ucw.cz/download/linux/paperjam-1.2.1.tar.gz"
55 sha256 "bd38ed3539011f07e8443b21985bb5cd97c656e12d9363571f925d039124839b"
66 license "GPL-2.0-or-later"
7+ revision 1
78
89 livecheck do
910 url :homepage
1011 regex ( /href=.*?paperjam[._-]v?(\d +(?:\. \d +)+)\. t/i )
1112 end
1213
1314 bottle do
14- sha256 cellar : :any , arm64_sequoia : "1173139f00d87d9853a76d10a2c05b0ab451e5d5388582cf3d10291d8b70a66e "
15- sha256 cellar : :any , arm64_sonoma : "39c2d7a60e6ccc75a168b7e0be8696b91a033fd360d426403ab50e20df7043ee "
16- sha256 cellar : :any , arm64_ventura : "e879f41bf1c0ef0f824e302e2515b921fe9009de00de18c2ba2035c259b2f90c "
17- sha256 cellar : :any , sonoma : "a6d35687e6f83ac011a32b169878d55656477a5db46531a5d9a80e46ffafa303 "
18- sha256 cellar : :any , ventura : "7823de97267e2efebc6efaba7ae5c4448269d79c98ab613c6115c1d033cfce5e "
19- sha256 cellar : :any_skip_relocation , x86_64_linux : "ecb416231708d36a49ec9dd59319a9cf9ae1443d3c962f16b8b4d514d3b12d7d "
15+ sha256 cellar : :any , arm64_sequoia : "271b0d2b33c3f06f81fac58248a81a95eef0bcc36929230e2bad7b4d38ff34db "
16+ sha256 cellar : :any , arm64_sonoma : "4df949ea647a2056ea7d7ab0ea2d298f45da5643ae92c25aaac80aad7e1301c7 "
17+ sha256 cellar : :any , arm64_ventura : "1fd3b138f16296ab6107a43387eb5ea3b54e5dac2358b7b5b6e8bc6c7951f512 "
18+ sha256 cellar : :any , sonoma : "0d6af7df1e10f96f42f56cf222c6bfb35d384ed547f1b8b0e11352906a5af41c "
19+ sha256 cellar : :any , ventura : "2fc406ca453bf24ade3b65111f80bb3fd0b1a761c316ee48540ed8341afc6d63 "
20+ sha256 cellar : :any_skip_relocation , x86_64_linux : "05712c9aeabd27e0ca3dd38ce377228044e31bccb7ee9bfb0a218b239f4838be "
2021 end
2122
2223 depends_on "asciidoc" => :build
2324 depends_on "docbook-xsl" => :build
2425 depends_on "libpaper"
2526 depends_on "qpdf"
27+
2628 uses_from_macos "libxslt"
2729
30+ # notified the upstream about the patch
31+ patch :DATA
32+
2833 def install
2934 ENV [ "XML_CATALOG_FILES" ] = "#{ etc } /xml/catalog"
3035 ENV . append "LDLIBS" , "-liconv" if OS . mac?
@@ -37,3 +42,42 @@ def install
3742 assert_path_exists testpath /"output.pdf"
3843 end
3944end
45+
46+ __END__
47+ diff --git a/pdf-tools.cc b/pdf-tools.cc
48+ index 0d74ca3..23d5ee4 100644
49+ --- a/pdf-tools.cc
50+ +++ b/pdf-tools.cc
51+ @@ -7,6 +7,7 @@
52+ #include <cstdio>
53+ #include <cstdlib>
54+ #include <cstring>
55+ +#include <memory>
56+
57+ #include <iconv.h>
58+
59+ @@ -229,7 +230,7 @@ QPDFObjectHandle page_to_xobject(QPDF *out, QPDFObjectHandle page)
60+ }
61+
62+ vector<QPDFObjectHandle> contents = page.getPageContents();
63+ - auto ph = PointerHolder<QPDFObjectHandle::StreamDataProvider>(new CombineFromContents_Provider(contents));
64+ + auto ph = std::shared_ptr<QPDFObjectHandle::StreamDataProvider>(new CombineFromContents_Provider(contents));
65+ xo_stream.replaceStreamData(ph, QPDFObjectHandle::newNull(), QPDFObjectHandle::newNull());
66+ return xo_stream;
67+ }
68+ diff --git a/pdf.cc b/pdf.cc
69+ index 9f8dc12..41a158b 100644
70+ --- a/pdf.cc
71+ +++ b/pdf.cc
72+ @@ -185,7 +185,11 @@ static void make_info_dict()
73+ {
74+ const string to_copy[] = { "/Title", "/Author", "/Subject", "/Keywords", "/Creator", "/CreationDate" };
75+ for (string key: to_copy)
76+ - info.replaceOrRemoveKey(key, orig_info.getKey(key));
77+ + {
78+ + QPDFObjectHandle value = orig_info.getKey(key);
79+ + if (!value.isNull())
80+ + info.replaceKey(key, value);
81+ + }
82+ }
83+ }
0 commit comments