diff --git a/.gitignore b/.gitignore index 9077082..20221dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /papers-47.0-vendor.tar.xz /papers-47.0.tar.xz +/papers-5de8d26c.tar.xz +/papers-5de8d26c-vendor.tar.xz diff --git a/0001-shell-rs-Use-RefCell-replace-rather-than-glib-Proper.patch b/0001-shell-rs-Use-RefCell-replace-rather-than-glib-Proper.patch deleted file mode 100644 index fc20af1..0000000 --- a/0001-shell-rs-Use-RefCell-replace-rather-than-glib-Proper.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 3c14c67a38db5ef124fa53c6d7a40ef272b9b229 Mon Sep 17 00:00:00 2001 -From: Kalev Lember -Date: Tue, 5 Nov 2024 12:58:15 +0100 -Subject: [PATCH] shell-rs: Use RefCell::replace rather than - glib::Property::set - -Since glib-macros 0.20.3, the glib::Property::set method now requires to -be explicitly imported. As .set() is a wrapper around RefCell::replace, -we can instead simply just call .replace() directly. - -Thanks to msandova for the idea how to best fix it! - -This regressed with -https://github.com/gtk-rs/gtk-rs-core/commit/795e2c5d25d45442c1f77ddabda21370365ccc45 - -Fixes https://gitlab.gnome.org/GNOME/Incubator/papers/-/issues/278 ---- - shell-rs/src/sidebar.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/shell-rs/src/sidebar.rs b/shell-rs/src/sidebar.rs -index 0d3443967..1e83d7a2d 100644 ---- a/shell-rs/src/sidebar.rs -+++ b/shell-rs/src/sidebar.rs -@@ -101,7 +101,7 @@ mod imp { - } - )); - -- self.model.set(Some(model)); -+ self.model.replace(Some(model)); - } - - fn document(&self) -> Option { --- -2.47.0 - diff --git a/papers-47.0-snapshot-5de8d26c.patch b/papers-47.0-snapshot-5de8d26c.patch new file mode 100644 index 0000000..bb1268b --- /dev/null +++ b/papers-47.0-snapshot-5de8d26c.patch @@ -0,0 +1,22 @@ +--- papers-47.0/meson.build ++++ papers-47.0/meson.build +@@ -140,7 +140,7 @@ po_dir = join_paths(source_root, 'po') + top_inc = include_directories('.') + + glib_req_version = '>= 2.75.0' +-gtk_req_version = '>= 4.17.1' ++gtk_req_version = '>= 4.16.7' + libaw_req_version = '>= 1.6' + exempi_req_version = '>= 2.0' + +--- papers-47.0/shell/resources/meson.build ++++ papers-47.0/shell/resources/meson.build +@@ -11,6 +11,6 @@ papers_resources = gnome.compile_resourc + source_dir: [data_dir, data_build_dir], + dependencies: metainfo_file, + gresource_bundle: true, +-)[0] ++) + +-config_h.set_quoted('RESOURCES_FILE', papers_resources.full_path()) ++config_h.set_quoted('RESOURCES_FILE', papers_resources[0].full_path()) diff --git a/papers.spec b/papers.spec index c15183e..d34de37 100644 --- a/papers.spec +++ b/papers.spec @@ -1,4 +1,5 @@ %global tarball_version %%(echo %{version} | tr '~' '.') +%global commit 5de8d26c %if 0%{?rhel} %global bundled_rust_deps 1 @@ -12,7 +13,7 @@ Name: papers Version: 47.0 -Release: %autorelease +Release: %autorelease -s git%{commit} Summary: View multipage documents # papers itself is: @@ -30,17 +31,16 @@ SourceLicense: GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.0-or-later AND # Unlicense OR MIT License: GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT AND libtiff AND (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND (Unlicense OR MIT) URL: https://gitlab.gnome.org/GNOME/Incubator/papers -Source: https://download.gnome.org/sources/papers/47/papers-%{tarball_version}.tar.xz +Source: papers-%{commit}.tar.xz %if 0%{?bundled_rust_deps} # To generate vendored cargo sources: # tar xf papers-%%{tarball_version}.tar.xz ; pushd papers-%%{tarball_version}/shell-rs ; \ # cargo vendor && tar Jcvf ../../papers-%%{tarball_version}-vendor.tar.xz ../shell-rs/vendor/ ; popd -Source1: papers-%{tarball_version}-vendor.tar.xz +Source1: papers-%{commit}-vendor.tar.xz %endif -# Fix the build with glib-macros 0.20.3 -# https://gitlab.gnome.org/GNOME/Incubator/papers/-/merge_requests/366 -Patch: 0001-shell-rs-Use-RefCell-replace-rather-than-glib-Proper.patch +# Patch to make Papers build with snapshot +Patch: papers-47.0-snapshot-5de8d26c.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} @@ -67,10 +67,8 @@ BuildRequires: pkgconfig(gtk4) BuildRequires: pkgconfig(gtk4-unix-print) BuildRequires: pkgconfig(libadwaita-1) BuildRequires: pkgconfig(libarchive) -BuildRequires: pkgconfig(libgxps) BuildRequires: pkgconfig(libnautilus-extension-4) BuildRequires: pkgconfig(libsecret-1) -BuildRequires: pkgconfig(libspectre) BuildRequires: pkgconfig(libtiff-4) BuildRequires: pkgconfig(poppler-glib) BuildRequires: pkgconfig(sysprof-capture-4) @@ -142,16 +140,16 @@ This package brings the Papers thumbnailer independently from Papers. %autosetup -p1 -n papers-%{tarball_version} %{?bundled_rust_deps:-a1} %if 0%{?bundled_rust_deps} -%cargo_prep -v shell-rs/vendor +%cargo_prep -v shell/vendor %else -rm shell-rs/Cargo.lock +rm shell/Cargo.lock %cargo_prep %endif %if !0%{?bundled_rust_deps} %generate_buildrequires -cd shell-rs +cd shell %cargo_generate_buildrequires -a -t cd ~- %endif @@ -161,16 +159,20 @@ cd ~- %meson \ -Ddjvu=%{?with_djvu:enabled}%{!?with_djvu:disabled} \ -Dintrospection=disabled \ + -Dspell_check=disabled \ -Dtests=false \ %{nil} %meson_build -cd shell-rs +cd shell %cargo_license_summary -a %{cargo_license -a} > LICENSE.dependencies %if 0%{?bundled_rust_deps} %cargo_vendor_manifest +# We need to remove paths of dependencies if listed. These break resolution +# of RPM dependencies +sed -i 's/ (.*)//' cargo-vendor.txt %endif cd ~- @@ -179,7 +181,6 @@ cd ~- %meson_install # Remove unused symbolic link -rm $RPM_BUILD_ROOT%{_libdir}/libppsshell-4.0.so %find_lang papers --with-gnome @@ -194,13 +195,12 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop %files -f papers.lang %doc README.md %license COPYING -%license shell-rs/LICENSE.dependencies +%license shell/LICENSE.dependencies %if 0%{?bundled_rust_deps} -%license shell-rs/cargo-vendor.txt +%license shell/cargo-vendor.txt %endif %{_bindir}/papers # internal library not used by other apps, which is why it is not in -libs -%{_libdir}/libppsshell-4.0.so.4{,.*} %{_datadir}/applications/org.gnome.Papers.desktop %{_datadir}/glib-2.0/schemas/org.gnome.Papers.gschema.xml %{_datadir}/icons/hicolor/scalable/apps/org.gnome.Papers.svg @@ -219,7 +219,6 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop %endif %{_metainfodir}/papers-pdfdocument.metainfo.xml %{_metainfodir}/papers-tiffdocument.metainfo.xml -%{_metainfodir}/papers-xpsdocument.metainfo.xml %files devel %{_includedir}/papers/ diff --git a/sources b/sources index f9e56cf..5421217 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (papers-47.0-vendor.tar.xz) = a61c8b5ead54ddb7521440736f2b130b38e94a387a3324d2f284fb4766af4cbd0f39d22cbb1316d2466fcf542c933fc70f7b8e8bd507fde24e36a3704141c828 -SHA512 (papers-47.0.tar.xz) = b95675083756bc54881e1317eaa5d14f0a41d10b915bcb20390cd4e1d6a9a87a855f0ec54e833913189cab8e11c4e332600c8b9532f7cd510a5a21107d7ab0a2 +SHA512 (papers-5de8d26c.tar.xz) = b456f9c871caf8fe217c234dc41cbbe772d95822a808af2aa95c0745b35a67fe41a4d76d9accbde51f212ec1185bef3dd33db015b83e93673cda8259f6d843ff +SHA512 (papers-5de8d26c-vendor.tar.xz) = 4eee4f04eb7ee77fb36ddba5d75bccfde47c398df5086a7ffa61e7b916d0f7779a44d6596bb16ec36107a7b84d2b2f56829358c55aeb7e3a7b0ca8f3fa2f1caf