Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions flatpak/lockbook.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not sure what goes here, you'll have to read a bit more

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know what we need to put on this file so that's why i put that line there wezterm example

52 changes: 52 additions & 0 deletions flatpak/org.lockbook.Lockbook.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"app-id": "org.lockbook.Lockbook",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to use net.lockbook.Lockbook we own https://lockbook.net, and don't have .org.

"runtime": "org.freedesktop.Platform",
"runtime-version": "23.08",
"sdk": "org.freedesktop.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-stable"
],
"command": "lockbook-linux",
"finish-args": [
"--share=ipc",
"--filesystem=home:ro",
"--filesystem=xdg-config/wezterm",
"--socket=fallback-x11",
"--socket=wayland",
"--device=dri",
"--talk-name=org.freedesktop.Flatpak",
"--talk-name=org.freedesktop.Notifications",
"--share=network"
Comment on lines +11 to +19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs more scrutiny, most of these are not valid for lockbook

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i copied them from wezterm and before i read on the flatpak docs here

finish-args:
  # X11 + XShm access
  - --share=ipc
  - --socket=fallback-x11
  # Wayland access
  - --socket=wayland
  # GPU acceleration if needed
  - --device=dri
  # Needs to talk to the network:
  - --share=network
  # Needs to save files locally
  - --filesystem=xdg-documents

],
"modules": [
{
"name": "lockbook",
"buildsystem": "simple",
"build-options": {
"append-path": "/usr/lib/sdk/rust-stable/bin",
"env": {
"CARGO_HOME": "/run/build/lockbook/cargo"
}
},
"build-commands": [
"cargo --offline fetch --manifest-path Cargo.toml --verbose",
"cargo --offline build --release --verbose",
"mkdir -p /app/share/icons/hicolor/128x128/apps/",
"cp ./clients/linux/lockbook.png /app/share/icons/hicolor/128/apps/org.lockbook.Lockbook.png",
"mkdir -p /app/share/metainfo/",
"cp ./utils/dev/flatpak/lockbook.appdata.xml /app/share/metainfo/org.lockbook.Lockbook.appdata.xml",
"mkdir -p /app/share/applications/",
"cp ./utils/dev/snap-packages/lockbook-desktop/snap/gui/lockbook-desktop.desktop /app/shareapplications/org.lockbook.Lockbook.desktop"
],
"sources": [
{
"type": "dir",
"path": "../.."
},
"generated-sources.json"
]
}
]
}


55 changes: 55 additions & 0 deletions flatpak/org.lockbook.Lockbook.template.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling that this is a file that wezterm uses to generate the json file we're dealing with above, you should verify this, but I think if you look at those files that you linked me initially you'll find them using this template to substitute in the values for @URL@.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"app-id": "org.lockbook.Lockbook",
"runtime": "org.freedesktop.Platform",
"runtime-version": "23.08",
"sdk": "org.freedesktop.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-stable"
],
"command": "lockbook-linux",
"finish-args": [
"--share=ipc",
"--filesystem=home:ro",
"--filesystem=xdg-config/wezterm",
"--socket=fallback-x11",
"--socket=wayland",
"--device=dri",
"--talk-name=org.freedesktop.Flatpak",
"--talk-name=org.freedesktop.Notifications",
"--share=network"
],
"modules": [
{
"name": "lockbook",
"buildsystem": "simple",
"build-options": {
"append-path": "/usr/lib/sdk/rust-stable/bin",
"env": {
"CARGO_HOME": "/run/build/lockbook/cargo"
}
},
"build-commands": [
"cargo --offline fetch --manifest-path Cargo.toml --verbose",
"cargo --offline build --release --verbose",
"install -Dm644 ./clients/linux/lockbook.png /app/share/icons/hicolor/128/apps/org.lockbook.Lockbook.png",
"install -Dm644 ./utils/dev/flatpak/lockbook.appdata.xml /app/share/metainfo/org.lockbook.Lockbook.appdata.xml",
"install -Dm644 ./utils/dev/snap-packages/lockbook-desktop/snap/gui/lockbook-desktop.desktop /app/shareapplications/org.lockbook.Lockbook.desktop",
],
"sources": [
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "@URL@",
"sha256": "@SHA256@"
},
{
"type": "file",
"path": "org.lockbook.Lockbook.appdata.xml"
},
"generated-sources.json"
]
}
]
}


9 changes: 9 additions & 0 deletions rust-flatpak/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "rust-flatpak"
version = "0.1.0"
authors = ["Amumug <fabriali4@gmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
1 change: 1 addition & 0 deletions rust-flatpak/src/lockbook-appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
8 changes: 8 additions & 0 deletions rust-flatpak/src/lockbook-desktop.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
Type=Application
Comment=The private, polished note-taking platform.
Terminal=false
Exec=/home/amumu/.cargo/bin/lockbook-linux
Name=Lockbook
Icon=/home/amumu/Documents/lockbook/utils/dev/snap-packages/lockbook-desktop/snap/gui/logo.svg
8 changes: 8 additions & 0 deletions rust-flatpak/src/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions rust-flatpak/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
43 changes: 43 additions & 0 deletions rust-flatpak/src/net.lockbook.Lockbook.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"app-id": "net.lockbook.Lockbook",
"runtime": "org.freedesktop.Platform",
"runtime-version": "25.08",
"sdk": "org.freedesktop.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-stable"
],
"build-options": {
"append-path": "usr/lib/sdk/rust-stable/bin"
},
"command": "lockbook",
"finish-args": [
"--socket=x11",
"--device=dri",
"--share=network"
],
"modules": [
{
"name": "lockbook",
"buildsystem": "cmake",
"build-commands": [
"cargo --offline fetch --manifest-path Cargo.toml --verbose",
"cargo --offline build --release --verbose",
"cargo install --locked --path .",
"mkdir -p /app/share/icons/hicolor/128x128/apps/",
"cp /logo.svg /app/share/icons/hicolor/128x128/apps/net.lockbook.Lockbook.svg",
"mkdir -p /app/share/metainfo/",
"cp /lockbook-appdata.xml /app/share/metainfo/net.lockbook.Lockbook.appdata.xml",
"mkdir -p /app/share/applications",
"cp /lockbook-desktop.desktop /app/share/applications/net.lockbook.Lockbook.desktop"
],
"sources": [
{
"type": "git",
"url": "https://github.com/lockbook/lockbook/releases/download/25.12.15/lockbook-linux",
"tag": "0.9.3",
"commit": "010423e09dd64c250f8d63a2906aca80e2a0de5f"
}
]
}
]
}