Skip to content

Adding Flatpak Support#119

Draft
iamwacko wants to merge 18 commits into
burtonageo:masterfrom
iamwacko:master
Draft

Adding Flatpak Support#119
iamwacko wants to merge 18 commits into
burtonageo:masterfrom
iamwacko:master

Conversation

@iamwacko

@iamwacko iamwacko commented Jul 11, 2022

Copy link
Copy Markdown

I saw #105 and figured I would try to work on this. I haven't finished it yet. cargo fmt gives me a bunch of Warning: Unknown configuration option, so you might have to fix the code formatting

Todo

  • Generate .desktop
  • Generate .yml
  • Generate .appdata.xml
  • Icons
  • Vendor Dependencies
  • Create .flatpak

@Areopagitics

Copy link
Copy Markdown

Hi there,

Any update on this? This would be a really nice feature to have.

@iamwacko

Copy link
Copy Markdown
Author

If I'm honest, I just kinda forgot about it

@Areopagitics

Areopagitics commented Feb 21, 2024 via email

Copy link
Copy Markdown

@iamwacko

Copy link
Copy Markdown
Author

Thanks for your honesty! Would it be difficult to finish the pending feature?

I was basically done with it, the big thing is I'm going to have to deal with all the merge conflicts so it's up to date.

@iamwacko

Copy link
Copy Markdown
Author

Just gotta fix some small edge case type things, otherwise it's basically working

Comment thread src/bundle/linux/flatpak_bundle.rs Outdated
Comment thread src/bundle/linux/flatpak_bundle.rs Outdated
}

fn create_src_archive(settings: &Settings) -> crate::Result<()> {
Command::new("cargo").args(["vendor"]).output().ok();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One thing of note here is that this does not support path dependencies rust-lang/cargo#10134, so those will be missing when trying to build the flatpak in isolation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don't really think I'll be able to do much to fix this, but I'll make a warning that will show up if path dependencies are detected.

Comment thread src/bundle/linux/flatpak_bundle.rs Outdated
Comment on lines +255 to +257
tarfile
.append_dir_all("vendor/src", "src")
.chain_err(|| "src directory couldn't be put in archive")?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This isn't necessarily enough. For example, my project should include build.rs and ui/ui.slint.
I'm not sure what the best way to fix this would be, maybe a list like resources only that it isn't put into a separate directory, but kept the same?

[package.metadata.bundle]
additional_source_files = ["build.rs", "ui/*"]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think the best way to do this is to include everything in the workspace/project by default (except the target and .git folders), and then have a deny list of files and folders the user doesn't want to include. That way it'll just work, while still allowing them to trim the size.

Comment thread src/bundle/linux/flatpak_bundle.rs Outdated
"{description}",
settings
.long_description()
.unwrap_or("Flatpak Written in Rust"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be the actual description as well

@iamwacko

Copy link
Copy Markdown
Author

Ok, so now the work I still need to do is:

  • Make the file exclude option
  • Make it so the .desktop file has the icons, so they show up
  • Warning if path dependency is detected

@Areopagitics

Copy link
Copy Markdown

I'm wondering if it would be worth redirecting efforts over to the new kid on the block cargo-packager and adding Flatpak support over there, since there is much quicker development and support. Either way, thank you for all the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants