anyproto / anytype-ts

Official Anytype client for MacOS, Linux, and Windows
https://anytype.io
Other
4.42k stars 264 forks source link

Provide a Flatpak as software package — for Linux systems #74

Closed x80486 closed 1 month ago

x80486 commented 1 year ago

Flatpak is a technology for building, distributing, installing and running applications – primarily targeted at the Linux desktop and desktop applications.

Would be great (and convenient) to be able to install Anytype from Flathub. It would also acquire visibility in the app stores automatically.

Biepa commented 1 year ago

Hey @x80486 Thank you for the request. If you are a member to the forum, please upvote it here: https://community.anytype.io/t/alternative-installer-for-linux/985

vintprox commented 1 year ago

@Biepa Do you exclusively gather priority by looking into https://community.anytype.io forum or you also look in the Discussions?

Biepa commented 1 year ago

@vintprox Until now there was only the forum, so this was the single source of information for the priorities of the users. So I guess requests here will also influence it but as far as I know the forum is still the place to go for every request and feedback. So it can't hurt to upvote requests there.

fuksman commented 1 year ago

@vintprox the community on GitHub is one day old, so we give it more time to understand how it is best to manage it along with the user community. We track requests in both communities. For now, feel free to act as it best suits you, and we will notify everyone if there are any changes in the process ☀️

x80486 commented 1 year ago

This repository holds the actual source code for the client, right? The README is accurate, but the repository name is a little bit off.

If that's the case, and you are OK publishing to Flathub, I could probably take a look and see if I can start the Flatpak manifest. Sometimes is better to start by using the DEB file, and later try to build it from source — which is the ideal route.

ra3orblade commented 1 year ago

@x80486 would be great, if you need help contact me on telegram

x80486 commented 1 year ago

I have the application working, but I see some errors. For instance, when I try to close the applications using the windows' close button, I see these errors in the journal and the application doesn't actually terminate:

Jul 22 13:54:11 ubuntu-vm com.anytype.anytype.desktop[125441]: {"level":"INFO","ts":"2023-07-22T13:54:11.650-0400","logger":"common.commonspace.headsync","msg":"sync done:","spaceId":"bafyreicjtx3jp6332op5ocygt6qey7ouedsof7zx5gbi4xbib4voj6qmpu.2fnoe5hiybzqu","newIds":0,"changedIds":0,"removedIds":0,"already deleted ids":0,"peerId":"12D3KooWCywWYgfDZmamJxvWKAvMT5AYDdRG8MMhCpYLHjW8aX7K"}
Jul 22 13:54:20 ubuntu-vm com.anytype.anytype.desktop[125441]: 13:54:20.819 \u203a closeMain: undefined
Jul 22 13:54:20 ubuntu-vm com.anytype.anytype.desktop[125441]: closeMain: undefined

image

It works fine using the File > Quit option from the menu.

Those IDs are not my account (I created one for testing), but I'm not sure if they are meant to be logged either way. Are they public or private?

Besides that, I see everything working fine, though I see some other "suspicious" errors:

{"level":"INFO","ts":"2023-07-22T14:02:44.280-0400","logger":"common.commonspace.headsync","msg":"sync done:","spaceId":"bafyreicjtx3jp6332op5ocygt6qey7ouedsof7zx5gbi4xbib4voj6qmpu.2fnoe5hiybzqu","newIds":0,"changedIds":0,"removedIds":0,"already deleted ids":0,"peerId":"12D3KooWG7R2VEmeUoyh8vtHUNp6cmKdih7K31a6vDT8BHezgQ1b"}

14:04:07.121 \u203a [Api].exit, relaunch: false
[Api].exit, relaunch: false
14:04:07.137 \u203a {"level":"ERROR","ts":"2023-07-22T14:04:07.134-0400","logger":"anytype-mw-api","msg":"stream eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZWVkIjoibERZbU9xdHoifQ.pi6-tZrkgCITnxCjysZulrfsOkkwqH51C7Vmwy4uEIs interrupted"}

{"level":"ERROR","ts":"2023-07-22T14:04:07.134-0400","logger":"anytype-mw-api","msg":"stream eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZWVkIjoibERZbU9xdHoifQ.pi6-tZrkgCITnxCjysZulrfsOkkwqH51C7Vmwy4uEIs interrupted"}

stopping the library...
library has been successfully stopped

14:04:08.587 \u203a {"level":"ERROR","ts":"2023-07-22T14:04:08.587-0400","logger":"net.transport.yamux","msg":"listener closed with error","localAddr":"[::]:36477","error":"accept tcp [::]:36477: use of closed network connection"}

{"level":"ERROR","ts":"2023-07-22T14:04:08.587-0400","logger":"net.transport.yamux","msg":"listener closed with error","localAddr":"[::]:36477","error":"accept tcp [::]:36477: use of closed network connection"}

14:04:08.634 \u203a [Api].shutdown, relaunch: false
[Api].shutdown, relaunch: false

For a round one, if everything seems fine on your end, it would be great if:

ra3orblade commented 1 year ago

@x80486 could you please make a PR with everything that is required to be added? @fuksman Sergey can answer on licensing questions

fuksman commented 1 year ago

Hey @x80486, thank you for your activity! The software license is available in the repository's root: https://github.com/anyproto/anytype-ts/blob/main/LICENSE.md Metadata license — CC0-1.0

x80486 commented 1 year ago

@x80486 could you please make a PR with everything that is required to be added? @fuksman Sergey can answer on licensing questions

@ra3orblade, the SVG file should come from the Anytype team — and bundled correctly, ideally in share/icons/hicolor/scalable/apps/com.anytype.anytype.svg. I can wait for this to be released sometime.

Publishing the AppStream MetaInfo file is a really nice-to-have. It streamlines the Flatpak manifest, by just installing the required dependencies and placing the "resource" files in the correct locations. AppStream MetaInfo is generated with every release, but for the most part the content is static — except releases and description. Like I said, I made one to move things forward, but ideally it should be bundled with any desktop application. The licenses are specified inside this file as well.

Notice how the filenames are, ideally, named after the reverse DNS convention. I picked up com.anytype.anytype...but that's a guess. It's up to the Anytype team to confirm if that's the correct ID (based on the reverse DNS) to be used.

isle9 commented 1 year ago

@x80486 Hey, what's the progress on this issue? Is there a way for me to install it somehow right now?

x80486 commented 1 year ago

If you follow the link I provided in previous messages you should be able to get a fully functional Anytype install. I provided clear instructions in the README.

isle9 commented 1 year ago

If you follow the link I provided in previous messages you should be able to get a fully functional Anytype install. I provided clear instructions in the README.

How would I update the app? I'm guessing that the in-app updater doesn't work?

x80486 commented 1 year ago

In practice, you should install this one for your user (with --user) because you are building it in your machine. The auto-updater is not configured yet. Notice this is not published to Flathub...yet :sunglasses:

isle9 commented 1 year ago

The auto-updater is not configured yet. Notice this is not published to Flathub...yet 😎

Yeah, I thought so. That's not going to do it for me then unfortunately. I'd need the app to be up to date at all times.

yajo commented 1 year ago

El mié, 23-08-2023 a las 00:22 -0700, isle9 escribió:

Yeah, I thought so. That's not going to do it for me then unfortunately. I'd need the app to be up to date at all times. Usually you update flatpaks with the flatpak CLI or gnome-software or similar.

I don't se a need for a flathub release to include updates within the app...

isle9 commented 1 year ago

El mié, 23-08-2023 a las 00:22 -0700, isle9 escribió: Yeah, I thought so. That's not going to do it for me then unfortunately. I'd need the app to be up to date at all times. Usually you update flatpaks with the flatpak CLI or gnome-software or similar. I don't se a need for a flathub release to include updates within the app...

Yeah, I was thinking of how to update it automatically right now while it's still not on flathub.

dphaldes commented 1 year ago

@x80486 how is it going :) ? Do you need any help testing it?

dfarnand commented 1 year ago

I managed to build the app with @x80486's repo, but had to make some changes.

To start, the clone command in the readme won't actually work (since its trying to pull from the official github). For anyone attempting this, what you'll actually want to do is:

git clone https://github.com/x80486/flathub
cd flathub
git checkout com.anytype.anytype

The rest of the commands will work, but the app won't open, giving an error about libsecret. I searched a bit and found the same error had appeared in the bitwarden flatpak, so I copied and pasted the exact code from that PR. I also updated it to pull the newest stable version of anytype, as the older version couldn't sync with my newer data from other devices.

Here is my updated com.anytype.anytype.yaml ``` app-id: com.anytype.anytype base: org.electronjs.Electron2.BaseApp base-version: "22.08" command: anytype finish-args: - --device=dri - --share=ipc - --share=network - --socket=pulseaudio - --socket=wayland - --socket=x11 - --talk-name=org.freedesktop.Notifications # Evaluating Permissions - --filesystem=xdg-documents - --filesystem=xdg-download - --filesystem=xdg-music - --filesystem=xdg-pictures modules: - name: anytype buildsystem: simple build-commands: # TODO: Build from sources, but first release in this way - ar -o -x anytype_amd64.deb - tar --extract --file data.tar.xz - cp --preserve --recursive opt/* usr/* /app - desktop-file-edit --set-key Exec --set-value "/app/bin/anytype %U" /app/share/applications/anytype.desktop - desktop-file-edit --set-key Icon --set-value "com.anytype.anytype" /app/share/applications/anytype.desktop - install -D --mode 0644 --target-directory /app/share/metainfo/ com.anytype.anytype.metainfo.xml - install -D --mode 0644 --target-directory /app/share/icons/hicolor/scalable/apps/ com.anytype.anytype.svg - install -D --mode 0755 com.anytype.anytype.sh /app/bin/anytype sources: - type: file dest-filename: anytype_amd64.deb only-arches: - x86_64 sha256: 8948f1219939eaa9edef2922e44a7d0b142787e77a383d71d371e89ab219a8e3 url: https://github.com/anyproto/anytype-ts/releases/download/v0.35.4/anytype_0.35.4_amd64.deb # TODO: Integrate x-checker-data - type: file path: com.anytype.anytype.metainfo.xml - type: file path: com.anytype.anytype.svg - type: script commands: - export TMPDIR="${XDG_RUNTIME_DIR}/app/${FLATPAK_ID}" - exec zypak-wrapper /app/Anytype/anytype "$@" dest-filename: com.anytype.anytype.sh - name: libsecret buildsystem: meson config-opts: - "-Dmanpage=false" - "-Dvapi=false" - "-Dgtk_doc=false" cleanup: - "/bin" - "/include" - "/lib/pkgconfig" - "/share/gir-1.0" - "/share/man" sources: - type: archive url: https://download.gnome.org/sources/libsecret/0.20/libsecret-0.20.4.tar.xz sha256: 325a4c54db320c406711bf2b55e5cb5b6c29823426aa82596a907595abb39d28 rename-desktop-file: anytype.desktop runtime: org.freedesktop.Platform runtime-version: "22.08" sdk: org.freedesktop.Sdk separate-locales: false ```

Hope this is helpful, I'd love to see this officially on flathub!

x80486 commented 1 year ago

Great. I haven't had much time to follow up on this one. So feel free to send a pull request to Flathub, but I'm almost certain that they will prefer the authors to be in charge of this, because the nature of the application.

By the way, if libsecret is needed, it's better to use a "shared module" (e.g.: https://github.com/flathub/com.jetbrains.IntelliJ-IDEA-Community/blob/master/com.jetbrains.IntelliJ-IDEA-Community.yaml#L64). Also, org.electronjs.Electron2.BaseApp is on the 23.08 branch.

charlesneimog commented 10 months ago

@ra3orblade in this PR I had updated the flatpak-builder for version 0.37. It seems functional. I believe that it is better for Linux, mainly because will be possible to install anytype from the gnome (and others) store.

EDIT: Also, more info.

Maybe, if Any community does a fork of flathub (https://github.com/flathub/flathub) we can make a PR for the flathub fork of Any community, which allows the App to get a verified symbol from the flathub store (when any community makes the PR for the flathub store). Something like this verifies the symbol.

image

To test,

https://github.com/charlesneimog/flathub
cd flathub
git checkout com.anytype.anytype
git submodule init 
git submodule update
flatpak-builder --user --install com.anytype.anytype ./com.anytype.anytype.yaml --force-clean

Then, anytype will be installed, you can run it using: flatpak run com.anytype.anytype or searching for anytype.

ra3orblade commented 10 months ago

@charlesneimog should I make any changes to CI to automate things on my side?

charlesneimog commented 10 months ago

@ra3orblade yes, after Anytype team decide who will fork the flathub repo to submit the package to the flathub store, the anytype app will leave in https://github.com/flathub/io.anytype.anytype, then you can create some automatic PR to the flathub repo.

The PR will change just these two lines:

https://github.com/charlesneimog/flathub/blob/b4c08ae318c15797bc3556cbbcfe7611eede031c/io.anytype.anytype.yaml#L36-L37

with the new sha256 and new .deb packages (I am using it from Github releases, but you can use the anytype.io also).

Obs.: I saw that there are some flathub actions, but we need to do some research about it, maybe it will be easier.

ra3orblade commented 10 months ago

@ra3orblade yes, after Anytype team decide who will fork the flathub repo to submit the package to the flathub store, the anytype app will leave in https://github.com/flathub/io.anytype.anytype, then you can create some automatic PR to the flathub repo.

Great, thanks, I will discuss with @fuksman

charlesneimog commented 10 months ago

There is some docs here https://docs.flathub.org/docs/for-app-authors/submission/

Eschguy commented 9 months ago

Excited to get a flatpak version. My Steam Deck doubles as a on-the-go device for me and I'd love to use Anytype on it.

theamazing0 commented 3 months ago

If there is working packaging, is there any reason why Anytype isn't being added to Flathub as unofficial? Aren't there many other flatpak apps that aren't officially supported?

mhymny commented 1 month ago

As I was in need for a flatpak, I used some of the files I found across multiple sources, mainly this issue. I have created a github pipeline that builds and signs a flatpak. A simple

curl -LO https://raw.githubusercontent.com/mhymny/anytype/main/anytype.flatpakref
flatpak install anytype.flatpakref

does the trick!

If there are any problems in regards to me publishing anytype as a flatpak, I will take it down immediately. Otherwise I would be open to work further on this and maybe publish it on flathub if you guys are fine with it.

yhx0022 commented 1 month ago

As I was in need for a flatpak, I used some of the files I found across multiple sources, mainly this issue. I have created a github pipeline that builds and signs a flatpak. A simple

curl -LO https://raw.githubusercontent.com/mhymny/anytype/main/anytype.flatpakref
flatpak install anytype.flatpakref

does the trick!

If there are any problems in regards to me publishing anytype as a flatpak, I will take it down immediately. Otherwise I would be open to work further on this and maybe publish it on flathub if you guys are fine with it.

Nice! +1 for flatpak

ra3orblade commented 1 month ago

As I was in need for a flatpak, I used some of the files I found across multiple sources, mainly this issue. I have created a github pipeline that builds and signs a flatpak. A simple

curl -LO https://raw.githubusercontent.com/mhymny/anytype/main/anytype.flatpakref
flatpak install anytype.flatpakref

does the trick!

If there are any problems in regards to me publishing anytype as a flatpak, I will take it down immediately. Otherwise I would be open to work further on this and maybe publish it on flathub if you guys are fine with it.

I think we are fine with it, but I'll ask @fuksman to confirm, thanks for the contribution.

fuksman commented 1 month ago

Hey @mhymny, we're fine with it. Let's see if the users will be satisfied with this solution or if they want it to be distributed from our account :)

fuksman commented 1 month ago

@any contributor @mhymny tooling

Victor239 commented 1 month ago

I'd like to see it published on Flathub even if it is an unofficial release. Makes it easier to install and keep updated.

ra3orblade commented 1 month ago

Feel free to close the issue, I'm keeping it for the sake of conversation.

theamazing0 commented 1 month ago

As a user- unofficial release would still be great. If any-type approves of the setup maybe they can verify it on flathub?

charlesneimog commented 1 month ago

Hello, just to point out something.

I believe that in the way the flatpak is built now via @yhx0022 repo, we get two problems.

1) The Flathub store will not consider Anytype an open-source app. 2) We will not support arm machines (like MacBooks on Asahi).

I was trying to build anytype from the source (what would solve both problems), but yet didn't have enough time to make it work. So maybe we should combine efforts to make this happen.

:)

EDIT: This does not prevent to submitting @yhx0022 version for now.

mhymny commented 1 month ago

Hey @mhymny, we're fine with it. Let's see if the users will be satisfied with this solution or if they want it to be distributed from our account :)

Sounds good to me!

I believe that in the way the flatpak is built now via @yhx0022 repo, we get two problems. The Flathub store will not consider Anytype an open-source app. We will not support arm machines (like MacBooks on Asahi).

I'd love to make it build from source, but until mid of October I'm quite busy.

However I don't see why flathub wouldn't approve this as a community built, might as well just give it a try and see what happens :).

mhymny commented 1 month ago

Anytype is now installable via flathub https://flathub.org/apps/io.anytype.anytype

However due to the licensing it shows up as proprietary. A correct entry in https://spdx.org/licenses/ should suffice I hope? But I haven't looked into that.

mhymny commented 1 month ago

Would you guys be interested to verify the flathub package?

Adda0 commented 1 month ago

However due to the licensing it shows up as proprietary. A correct entry in https://spdx.org/licenses/ should suffice I hope? But I haven't looked into that.

I reiterate what I wrote on the forum. I do not think there is a way to list Anytype as open source under an OSI-approved licence with the current Anytype licence. Therefore, the proprietary warning will remain. Or do you think/know that what I say in the forum post is not accurate? I would be interested to know.

mhymny commented 1 month ago

However due to the licensing it shows up as proprietary. A correct entry in https://spdx.org/licenses/ should suffice I hope? But I haven't looked into that.

I reiterate what I wrote on the forum. I do not think there is a way to list Anytype as open source under an OSI-approved licence with the current Anytype licence. Therefore, the proprietary warning will remain. Or do you think/know that what I say in the forum post is not accurate? I would be interested to know.

Yes you are totally right!

I also did investigate a little bit on how things appear on flathub:

The minimal requirement for a flatpak is for it to be redistributable.

Then apps are only shown as proprietary, if a custom license is given.

An App is further divided into floss and special with the difference being that a free software license is either approved by the Free Software Foundation or the Open Source Initiative as seen here, so only appending to spdx wouldn't suffice.

x80486 commented 1 month ago

Flatpak release is now in Flathub: https://github.com/flathub/io.anytype.anytype

ra3orblade commented 1 month ago

Great job!

marcolaux commented 1 month ago

Could someone update the screenshots? The current ones don't show Anytype in action at all.

fuksman commented 3 weeks ago

Would you guys be interested to verify the flathub package?

@mhymny verified, thank you!