Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Flatpak support #203

Merged
merged 14 commits into from
Jan 20, 2021
Merged

Add Flatpak support #203

merged 14 commits into from
Jan 20, 2021

Conversation

TheEvilSkeleton
Copy link
Contributor

@TheEvilSkeleton TheEvilSkeleton commented Jan 13, 2021

Related to #15

I managed to make the GUI work, but I don't think it deletes the files when I tell it to. it works!

This is just an initial flatpak. I'll try to get it to work if others are willing to help.

If you want to test out the flatpak, make sure you have flatpak-builder installed, and run the following commands:

git clone https://github.com/TheEvilSkeleton/czkawka
cd czkawka/flatpak
flatpak-builder --force-clean --install-deps-from=flathub --install build-dir com.github.qarmin.Czkawka.yaml

P.S. if you have any suggestions, feel free to comment.

@TheEvilSkeleton TheEvilSkeleton marked this pull request as draft January 13, 2021 02:03
@TheEvilSkeleton TheEvilSkeleton changed the title Draft: Add czkawka flatpak Add czkawka flatpak Jan 13, 2021
@TheEvilSkeleton TheEvilSkeleton changed the title Add czkawka flatpak Draft: Add Czkawka flatpak Jan 13, 2021
@TheEvilSkeleton TheEvilSkeleton changed the title Draft: Add Czkawka flatpak Initial Czkawka flatpak Jan 13, 2021
@qarmin
Copy link
Owner

qarmin commented Jan 14, 2021

Great work!

I tested it and looks that everything works - file deletion, previews, cache, saving/loading config etc.

I was able to install it but without --user flag and with sudo permissions sudo flatpak-builder --force-clean --install-deps-from=flathub --install build-dir com.github.qarmin.Czkawka.yaml (Probably due outdated flatpak 1.6.5)

@TheEvilSkeleton
Copy link
Contributor Author

TheEvilSkeleton commented Jan 14, 2021

That's fine. When you want to install a flatpak in your user, you need to add the repository in your user as well. So in this case, you need to install Flathub with --user in order to install it as the user.

That was my fault. I usually install flatpaks with --user so I copy pasted.

Also, it's good to know it's working. I couldn't easily tell if it was working or not on my end.

@TheEvilSkeleton
Copy link
Contributor Author

@qarmin keep in mind that we made it easy to publish it in Flathub since the flatpak doesn't download during the build process (for redistribution purposes). I can help you with publishing it in Flathub if you want.

@TheEvilSkeleton TheEvilSkeleton marked this pull request as ready for review January 15, 2021 04:50
@qarmin
Copy link
Owner

qarmin commented Jan 15, 2021

I can help you with publishing it in Flathub if you want.

It would be great.

I published now a new Czkawka version, because adds Alsa dependency needed by external library(Czkawka doesn't play any sounds just decode audio),

New version will require rebuild of cargo-sources.json and probably will require also adding some --socket=pulseaudio or something things.

Sadly this commit with adding audio and zip dependencies broke Snap builds, so I think about reverting it.
EDIT: Nevermind, this is bug with snap, but I added a workaround

I tried to test it, but I couldn't find any method to create json cargo sources file.

@qarmin qarmin added the enhancement New feature or request label Jan 15, 2021
@TheEvilSkeleton
Copy link
Contributor Author

TheEvilSkeleton commented Jan 15, 2021

I published now a new Czkawka version, because adds Alsa dependency needed by external library(Czkawka doesn't play any sounds just decode audio),

New version will require rebuild of cargo-sources.json and probably will require also adding some --socket=pulseaudio or something things.

I updated its permissions and bumped it. Tell me how that goes.

I tried to test it, but I couldn't find any method to create json cargo sources file.

Here's how to do it:

Download the flatpak-cargo-generator Python file in the root of the source code of Czkawka at https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/cargo/flatpak-cargo-generator.py, then run the command

python ./flatpak-cargo-generator.py ./Cargo.lock -o flatpak/cargo-sources.json

Lastly run

flatpak-builder --force-clean --install-deps-from=flathub --install build-dir flatpak/com.github.qarmin.Czkawka.yaml

(from the root of the source code).

@TheEvilSkeleton TheEvilSkeleton marked this pull request as draft January 15, 2021 21:12
@TheEvilSkeleton TheEvilSkeleton marked this pull request as ready for review January 16, 2021 02:09
@qarmin
Copy link
Owner

qarmin commented Jan 16, 2021

Thanks, I checked --socket=pulseaudiooption and it doesn't change anything so can be safely removed.

Looks that for now this Flatpak package provides more functionality than current Snap package which have missing support for external drives and some hidden folders in /home/user

@TheEvilSkeleton TheEvilSkeleton changed the title Initial Czkawka flatpak Add Flatpak support Jan 16, 2021
@TheEvilSkeleton
Copy link
Contributor Author

@qarmin by default, cd6a589 won't work since it asks for cd6a589#diff-55e4c74d40f6d322fcee02c419923278516387286a39e8daa8de64e0039a3328R29, which will only be available once this MR is merged. You can either comment that line or change the last two lines to:

-     url: https://github.com/qarmin/czkawka.git
-     tag: 2.3.0
+     url: https://github.com/TheEvilSkeleton/czkawka.git

@TheEvilSkeleton
Copy link
Contributor Author

@qarmin feel free to merge it. I think it's good to go.

Also, I'm pretty sure this will be accepted in Flathub right off the bat.

@qarmin qarmin merged commit a5d37eb into qarmin:master Jan 20, 2021
@qarmin
Copy link
Owner

qarmin commented Jan 20, 2021

Thanks!

@TheEvilSkeleton
Copy link
Contributor Author

TheEvilSkeleton commented Jan 20, 2021

Keep in mind that this should be accepted in Flathub with minor changes needed at best. You just:

  1. fork https://github.com/flathub/flathub/
  2. change branch to new-pr
  3. copy everything inside the /flatpak directory of this project, and paste them in the newly created branch
  4. attempt to submit an MR, read all the prerequisites in the description, check everything you can in the description, and complete the prerequisites if not done already
  5. submit the MR

@TheEvilSkeleton
Copy link
Contributor Author

TheEvilSkeleton commented Jan 20, 2021

Oh right... I completely forgot that since the tag is from 2.3.0, which is a tag that did not include the flatpak/ directory, it won't work. It should work on the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants