Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
894d181
Replace Evince with Papers
ryonakano Apr 18, 2025
839a5a9
Fix syntax
ryonakano Apr 19, 2025
98054c4
Update Flatpak runtime to 8.1
ryonakano Apr 19, 2025
c34eb1b
Use daily runtime for now
ryonakano Apr 19, 2025
a05bdc6
Fix poppler-glib not found
ryonakano Apr 19, 2025
43c2be0
Explicit libdir
ryonakano Apr 19, 2025
aa72292
Add granite::init() patch
ryonakano Apr 19, 2025
59e60f4
Update with flatpak-cargo-generator
ryonakano Apr 19, 2025
a62a74a
Fix panic at runtime
ryonakano Apr 19, 2025
e885994
Do not use the deprecated app-id
ryonakano Apr 19, 2025
db6dff3
Split patches
ryonakano Apr 19, 2025
fca1987
Remove problematic comment
ryonakano Apr 19, 2025
0dc289c
Actions: Install Rust SDK extension
ryonakano Apr 19, 2025
469008d
Document how to update generated-sources.json
ryonakano Apr 19, 2025
987e625
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano May 15, 2025
aedc0b4
Bump Flatpak platform to 8.2
ryonakano May 15, 2025
6627534
build: Add BMP support to Flatpak
hadess May 15, 2025
0d5d0cc
Update papers to 48.2
ryonakano May 15, 2025
d2d7b33
Fix build error
ryonakano May 18, 2025
02a80f8
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano Jun 6, 2025
0d70c63
Merge branch 'main' into ryonakano/papers
danirabbit Jun 30, 2025
78ce259
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano Jul 2, 2025
38a0b11
Sync with upstream Flathub manifest
ryonakano Jul 2, 2025
b118e74
Fix typo
ryonakano Jul 2, 2025
0f08a2e
Fix wrong sync
ryonakano Jul 2, 2025
661dbc0
Bump runtime version in Actions
ryonakano Jul 15, 2025
eea3186
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano Jul 15, 2025
ea36061
Update comment
ryonakano Jul 19, 2025
e289eb2
Update README
ryonakano Jul 19, 2025
6f82320
Add a patch to rename css; disable previwer
ryonakano Jul 19, 2025
e830fdd
Add a patch to fix sidebar icon
ryonakano Jul 19, 2025
04e784f
Make patches directory
ryonakano Jul 19, 2025
ae911bd
Rust-style method
ryonakano Jul 19, 2025
3541107
Disable nautilus support
ryonakano Jul 19, 2025
6df16f4
Update README
ryonakano Jul 19, 2025
45a2fd2
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano Aug 9, 2025
d282dd5
Update granite-rs to 3.0.0
ryonakano Sep 26, 2025
097c8bf
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano Sep 26, 2025
b99fe98
Sync with upstreams
ryonakano Sep 26, 2025
58bfc90
Bump rust-stable
ryonakano Sep 26, 2025
9a59527
Fix up CSS
danirabbit Sep 30, 2025
5d54c50
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano Oct 6, 2025
1bef774
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano Nov 24, 2025
3d2512c
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano Jan 12, 2026
e358616
Update Papers to 49.3
ryonakano Jan 12, 2026
8d9ddc5
Merge remote-tracking branch 'origin/main' into ryonakano/papers
ryonakano Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v6

- name: Install Rust SDK extension
run: |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y --arch=${{ matrix.configuration.arch }} org.freedesktop.Sdk.Extension.rust-stable//25.08

- name: Build
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.6
with:
bundle: org.gnome.evince.flatpak
manifest-path: org.gnome.evince.json
bundle: org.gnome.papers.flatpak
manifest-path: org.gnome.papers.json
repository-name: appcenter
repository-url: https://flatpak.elementary.io/repo.flatpakrepo
cache-key: "flatpak-builder-${{ github.sha }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flatpak-x-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
EMAIL: builds@elementary.io
GITHUB_TOKEN: ${{ secrets.GIT_USER_TOKEN }}
with:
args: --update --never-fork org.gnome.evince.json
args: --update --never-fork org.gnome.papers.json
9 changes: 7 additions & 2 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v6

- name: Install Rust SDK extension
run: |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y --arch=${{ matrix.configuration.arch }} org.freedesktop.Sdk.Extension.rust-stable//25.08

- name: Build
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.6
with:
bundle: evince.flatpak
manifest-path: org.gnome.evince.json
bundle: papers.flatpak
manifest-path: org.gnome.papers.json
run-tests: true
repository-name: appcenter
repository-url: https://flatpak.elementary.io/repo.flatpakrepo
Expand Down
54 changes: 52 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
# evince
Evince Document Viewer flatpak built against the elementary platform
# papers
Papers Document Viewer flatpak built against the elementary platform

## Building, Testing, and Installation
Run `flatpak-builder` to configure the build environment, download dependencies, build, and install

```bash
flatpak-builder build org.gnome.papers.json --user --install --force-clean --install-deps-from=appcenter --install-deps-from=flathub
```

Then execute with

```bash
flatpak run org.gnome.Papers
```

## How to generate `generated-sources.json`
Some code of Papers is written in Rust so it uses Cargo to resolve dependencies of it. However, network access during
the build process is not recommended in Flatpak.
[flatpak-cargo-generator](https://github.com/flatpak/flatpak-builder-tools/tree/master/cargo) resolves this problem
by converting all necessary dependencies listed in the Cargo.lock into a Flatpak manifest file to download them
as modules at the beginning of the build process.

You'll need:

- git
- python3-toml
- python3-tomlkit
- python3-aiohttp
- pipx

First prepare the Cargo.lock of Papers. We patch Cargo.lock to add granite, so we need to apply our patch against
the original source code of Papers:

```
# The tag name matches with the version of papers in our manifest file
git clone https://gitlab.gnome.org/GNOME/papers.git -b 48.4 --depth=1
cd papers/
git apply <path to add-granite.patch>
cd ../
```

Now, we can use flatpak-cargo-generator to generate `generated-sources.json`:

```
git clone https://github.com/flatpak/flatpak-builder-tools.git --depth=1
cd flatpak-builder-tools/cargo/
pipx install poetry
exec $SHELL -l
poetry env activate
python3 ./flatpak-cargo-generator.py ../../papers/Cargo.lock -o generated-sources.json
```
62 changes: 62 additions & 0 deletions add-granite.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
diff --git a/Cargo.lock b/Cargo.lock
index b56566d06..bee57b8d4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -935,6 +935,37 @@ dependencies = [
"system-deps",
]

+[[package]]
+name = "granite-rs"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "583445f6e01a930b829d1a7724f09af98efe8a9e6928c1953e7b7fcf16547db0"
+dependencies = [
+ "bitflags 2.9.3",
+ "gdk4",
+ "gio",
+ "glib",
+ "granite-rs-sys",
+ "gtk4",
+ "libc",
+ "once_cell",
+]
+
+[[package]]
+name = "granite-rs-sys"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06f728c0929dcdfec5d5ea5b61b2b10c4b193cdaf1ec6fd8de7c566982c34340"
+dependencies = [
+ "gdk4-sys",
+ "gio-sys",
+ "glib-sys",
+ "gobject-sys",
+ "gtk4-sys",
+ "libc",
+ "system-deps",
+]
+
[[package]]
name = "graphene-rs"
version = "0.21.1"
@@ -1615,6 +1646,7 @@ dependencies = [
"futures",
"gettext-rs",
"git-version",
+ "granite-rs",
"gtk4",
"libadwaita",
"log",
diff --git a/shell/Cargo.toml b/shell/Cargo.toml
index 50262bd35..c9c0aab2e 100644
--- a/shell/Cargo.toml
+++ b/shell/Cargo.toml
@@ -23,6 +23,7 @@ gettext-rs = { version = "0.7", features = ["gettext-system"] }
lru = "0.16"
futures = "0.3"
git-version = "0.3"
+granite = { version = "3.0.0", package = "granite-rs", features = ["v7_2"] }

[dependencies.oo7]
version = "0.4"
58 changes: 58 additions & 0 deletions css.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
diff --git a/shell/resources/papers.css b/shell/resources/papers.css
index b4effb5cc..ba491a2a8 100644
--- a/shell/resources/papers.css
+++ b/shell/resources/papers.css
@@ -1,3 +1,53 @@
+:root {
+ --window-bg-color: @bg_color;
+ --window-fg-color: @fg_color;
+ --accent-color: @accent_color;
+ --shade-color: alpha(@fg_color, 0.15);
+ --yellow-4: @BANANA_500;
+}
+
+.sidebar-pane,
+.navigation-sidebar {
+ background: @insensitive_bg_color;
+}
+
+.sidebar-pane:dir(ltr) {
+ border-right: 1px solid @menu_separator;
+}
+
+.sidebar-pane:dir(rtl) {
+ border-left: 1px solid @menu_separator;
+}
+
+separator.spacer {
+ border-color: transparent;
+}
+
+/* TODO Remove when https://github.com/elementary/granite/issues/897 is fixed */
+button.osd {
+ background: @bg_color;
+ border: transparent;
+ box-shadow:
+ inset 0 -1px 0 0 rgba(255, 255, 255, 0.2),
+ inset 0 1px 0 0 rgba(255, 255, 255, 0.3),
+ inset 1px 0 0 0 rgba(255, 255, 255, 0.07),
+ inset -1px 0 0 0 rgba(255, 255, 255, 0.07),
+ 0 0 0 1px rgba(0, 0, 0, 0.1),
+ 0 3px 4px rgba(0, 0, 0, 0.15),
+ 0 3px 3px -3px rgba(0, 0, 0, 0.35);
+ color: @text_color;
+ min-height: 2em;
+ min-width: 2em;
+}
+
+button.osd:active {
+ background: @insensitive_bg_color;
+}
+
+separator.spacer {
+ border-color: transparent;
+}
+
image.symbolic-circular {
background-color: color-mix(in srgb, currentColor 8%, transparent);
min-width: 32px;
13 changes: 13 additions & 0 deletions fix-missing-sidebar-icon.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/shell/resources/pps-document-view.blp b/shell/resources/pps-document-view.blp
index b839b7ce0..3d357d4cf 100644
--- a/shell/resources/pps-document-view.blp
+++ b/shell/resources/pps-document-view.blp
@@ -192,7 +192,7 @@ template $PpsDocumentView: Adw.BreakpointBin {

[start]
ToggleButton sidebar_button {
- icon-name: "sidebar-show-symbolic";
+ icon-name: "view-sidebar-start-symbolic";
action-name: "doc.show-sidebar";
tooltip-text: _("Toggle Sidebar");
}
Loading
Loading