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

appimage, flatpak, rpm or archlinux aur #91

Open
rezad1393 opened this issue Oct 10, 2023 · 59 comments
Open

appimage, flatpak, rpm or archlinux aur #91

rezad1393 opened this issue Oct 10, 2023 · 59 comments

Comments

@rezad1393
Copy link

I wanted to try this app but it doesn't have a x64 version of bianry for linux (not a deb one).

maybe a flatpak or an appimage would help users like me.

@qu1ck
Copy link
Member

qu1ck commented Oct 10, 2023

Flatpak is not viable for this app because of it's sandboxing behavior.

AUR package, rpm package, any other package is up to community to contribute because I don't use these systems regularly and can't invest the time to figure out all the packaging specifics of each one.

If someone wants to contribute, make sure you modify the build action to include the new artifact in the automatically generated releases.

But I will look into appimage as it seems that it should work and is at least useful for wide variety of distros.

@rezad1393
Copy link
Author

I think flatpak is more work than appimage so.

it is just that for flatpak I just use a command to update all of them. but appimage is not easy to update.

btw I use that tremesof app and then added a folder with flatseal to access. so that sandbox is not that much of an issue.

@qu1ck
Copy link
Member

qu1ck commented Oct 11, 2023

Ok, so I tried appimage and if I build it on older ubuntu then it packages in buggy webkitgtk which does not render properly. If I build it on newer ubuntu then it is less buggy but will not work on anything with older libs which defeats the portability of the appimage.
I suspect flatpak will have the same fate.

So, for now, self compile it is for linux users.

If anyone wants to experiment with appimage further, literally only change to enable it is to add "appimage" here

@qu1ck qu1ck changed the title flatpak or archlinux aur appimage, flatpak, rpm or archlinux aur Oct 11, 2023
@rezad1393
Copy link
Author

I am confused.

I thought appimage was almost self-contained.
flatpak too.

so if I use new flatpak package on older os (like ubuntu 18) it would still work because it would take most of it libs and files from its own flatpak repo and not host.

maybe I am missing something.

@qu1ck
Copy link
Member

qu1ck commented Oct 11, 2023

No, it works with forward compatibility, even then, sometimes not. It almost never works in backwards direction. Appimage will not bundle your whole /usr/lib, it still relies on the fact that your client system will have compatible (which means same or newer) glibc, gtk and other core libs that make up the majority of GNU/Linux. Otherwise the image would be not 80mb but the size of half a linux distro.

Appimage instructions directly advise to build on the oldest possible linux you can support so that everything newer has a good chance to work because for the most part linux tries to maintain strict backward compatibility in core libs.

Unfortunately for TrguiNG even Ubuntu 20.02 which is not that old has buggy webkit so only viable appimage is from 22.04. Chances of it working on anything that is not quite recent are slim.

I'll still include appimage with next release, maybe it will be useful for some.

@rezad1393
Copy link
Author

rezad1393 commented Oct 12, 2023

I think flatpak has more flexibility with respect to forward/backward versioning/compatibility.

@qu1ck
Copy link
Member

qu1ck commented Oct 12, 2023

I don't see how that is technically possible, you either pack literally every lib and get a 1gb bundle or you don't have backward compatibility, those are the choices.

Anyway, I added an appimage to the last release, it's built on ubuntu 22.

@rezad1393
Copy link
Author

Anyway, I added an appimage to the last release, it's built on ubuntu 22.

thank you for the appimage.

but about that

get a 1gb bundle

you can search the internet and see you answer about flatpak size.
like this:
https://forums.linuxmint.com/viewtopic.php?t=275123

or this quote :
"So how big are these runtimes? On a fresh machine, install KCalc from Flathub. You’re looking at a nearly 900 MB download to get your first runtime. For a calculator."

@qu1ck
Copy link
Member

qu1ck commented Oct 12, 2023

Great, so flatpak does indeed bring a whole new OS (sans a kernel) with an app. At least it's smart enough to reuse the runtime between apps when it can.

I looked more into building/publishing a flatpak and it's requirement for fully offline builds and lack of gnome 42 support which has libs needed for tauri introduces a whole host of issues. You can read more about it in tauri-apps/tauri#3619 and linked issues/discussions.
Some folks apparently found workarounds but I couldn't find any clear instructions.

Looks like this will have to wait until flatpak support is added to tauri (probably in tauri v2 which is currently in alpha).

@rezad1393
Copy link
Author

rezad1393 commented Oct 13, 2023

I explain to myself flatpak as kinda like docker.

also having read this:
https://theevilskeleton.gitlab.io/2022/05/16/response-to-flatpak-is-not-the-future.html#services
I see this:
"Most AppImage bundles need a big minimum requirement. They don’t bundle glibc or other core dependencies. Additionally, they might not even come with higher level dependencies bundled that would make an app actually functional without relying a lot on the host. Many of them will assume that some dependencies are already installed and have the right version on the host

This means that most AppImage bundles are not actually universal, and it gets harder to use them depending on the distribution you are using. If you are using a musl based distribution, the majority of AppImage bundles won’t work, because they need glibc. Likewise, if you use an immutable distribution, chances are they won’t come with many lower and higher level dependencies, because Flatpak already takes care of that. Flatpak is compatible in the majority of desktop cases. Even the Steam Deck uses Flatpak by default, because Flatpak ships with lower and higher level dependencies"

as that piece is written by a person defending flatpak model I would assume flatpak has more deps packages in its bundle (or its equivalent).

btw I use flatpak for some apps and it is useful.

for example steam game store. it has a lot of lib32 deps and I didnt want them installed on my PC so I used flatpak.
steam itself is going toward containerization so it seems to work better and better with flatpak (and snap too maybe).

for a single app that usually doesnt need integration, flatpak may be too much and using an appimage for user is better.

a good thing about flatpak (that I like) is that app setting and data are in just one folder and unlike other linux apps-systems , they are not scattered everywhere on my home folder. kinda like android but even better.

I would recommend a appimage for users to download and test even if linux distributions later add this program, just so user can test this app before committing to installing it.

but for long term distribution, I actually prefer flatpak as it would give a universal experience for all linux dists.
and it would make user life way easier.

if you are familiars with bottles app ( a wine env manager), its dev actually asked distro devs not to package its app in their repo and asks users to just use flatpak to install it.
he says it makes his dev life way easier and I have to agree with him after reading its blog post.
you can read it here:
https://usebottles.com/blog/an-open-letter/

p.s. even steam deck uses flatpak as preferred way to install apps.
"For those who don't RTFM (or the FAQ), it's stated that Steam OS 3.x supports using flatpaks as the preferred app install method"

@qu1ck
Copy link
Member

qu1ck commented Oct 13, 2023

I don't need more convincing that flatpak is useful and more universal. After doing the research about it I was already on the same page.

Currently it's just too hard to package a tauri app into flatpak bundle and write an offline build recipe that one can upload to flathub. Unless I find a (relatively) easy to follow recipe for tauri v1 we will have to wait until tauri v2 and native flatpak support.

@rezad1393
Copy link
Author

oh.
sorry about the rant.

hope you are successful with build later.

@qu1ck
Copy link
Member

qu1ck commented Oct 14, 2023

Note to self: this is a tauri project on flathub that I should be able to model flatpak build after.
https://github.com/flathub/in.cinny.Cinny

@qu1ck qu1ck mentioned this issue Oct 29, 2023
@username227
Copy link
Contributor

I have never done it, and I don't know if I can. But if nobody else is interested, I might be able to attempt to assist with the AUR. It would be interesting to learn the pkgbuild system. I already have an arch package that was created from your .deb which lists dependencies, etc. Of course, if anybody who has experience is interested in doing this, it would be better. but if not, I can try.

@username227
Copy link
Contributor

PKGBUILD.txt

This is my first attempt. This file successfully built and created the package for Arch on my system. rezad, can you test this pkgbuild on your system? download it and remove the .txt extension, and then use the command makepkg. let me know what happens.

@qu1ck
Copy link
Member

qu1ck commented Nov 29, 2023

The app is now on flathub https://flathub.org/apps/org.openscopeproject.TrguiNG

@username227
Copy link
Contributor

qu1ck - the one thing that won't work well is the desktop file. the app.desktop file in the src-tauri folder is pretty much blank. Is there any way you can incorporate the desktop file that we discussed here in place of the blank one to facilitate a more seamless desktop experience for the end user?

@qu1ck
Copy link
Member

qu1ck commented Nov 29, 2023

You can get full desktop file from here
https://github.com/flathub/org.openscopeproject.TrguiNG/blob/master/org.openscopeproject.TrguiNG.desktop

Few notes on your pkgbuild:

  • Get db-ip from releases page of this repo. Links from db-ip.com tend to die.
  • binary should be executable install -Dm755
  • License is AGPL-3.0

@username227
Copy link
Contributor

OK, definitely do NOT use my PKGBUILD. it crashed my system. i'll try to figure out what's wrong.

@rezad1393
Copy link
Author

OK, definitely do NOT use my PKGBUILD. it crashed my system. i'll try to figure out what's wrong.

in span of five hours.
that escalated quickly.

@qu1ck
Copy link
Member

qu1ck commented Nov 30, 2023

Userspace program should not be able to crash your system. I doubt whatever caused your crash is directly caused by you misconfiguring the package, at best it just exposed a hidden problem that was already there.

@rezad1393
Copy link
Author

Userspace program should not be able to crash your system. I doubt whatever caused your crash is directly caused by you misconfiguring the package, at best it just exposed a hidden problem that was already there.

yeah.
like a graphic driver with amd

@username227
Copy link
Contributor

PKGBUILD.txt

As a non-developer, this is a huge learning experience for me. It didn't mess the entire system up per se, but it did really mess up Cinnamon. I believe the problem was related to some missing "" around the install command parameters.

Anyway, this is my second version. I have changed the license, changed the source for the db as you suggested, and changed the permissions (which definitely were an issue). I have not yet worked on the .desktop file issue. That will be next. But this should be good for anybody who wants to test it on an arch-based system.

@username227
Copy link
Contributor

PKGBUILD.txt

OK, here it is. a working package for Arch. I am now running this package instead of the manually cloned repository, saving me several GBs of space in my home directory. Download the pkgbuild file, take out the .txt extension, put it in a folder, and run:

makepkg
sudo pacman -U trgui-ng-1.0.0-1-x86_64.pkg.tar.zst

I will try to see if I can figure out how to submit it to the AUR. I'm sure, being my first pkgbuild, that there'll be a hundred different opinions about ways that it could have been done better...but that's OK.

@username227
Copy link
Contributor

The AUR is now operational. The package is here.

https://aur.archlinux.org/packages/trgui-ng.

@qu1ck
Copy link
Member

qu1ck commented Dec 1, 2023

Great, thanks for working on this. I gave it my vote :)

We should probably automate releases to update the AUR repo, there is a convenient github action for that https://github.com/marketplace/actions/publish-aur-package

Can you add me as maintainer on AUR? My username/email are same as on github.

@username227
Copy link
Contributor

I think I did it. My pleasure. As I said, it was a great learning experience. i'll look into this automation next week unless you get to it first.

@qu1ck
Copy link
Member

qu1ck commented Dec 1, 2023

i'll look into this automation next week unless you get to it first.

No need, the action requires ssh key saved as secret in github, only I will be able to do that. That's also why I asked to be added as maintainer, so I could use my ssh key.

@qu1ck
Copy link
Member

qu1ck commented Dec 1, 2023

I listed you as a maintainer in a commented line on the top of the pkgbuild. let me know if you want any changes to the format of your info (or you can also).

That file will be autogenerated for each new version and it's not really intended to be viewed by humans anyway so it doesn't matter.

On a completely unrelated note - i didn't want to add a whole separate issue for this unless you want me to, but one feature request i'm wondering if it's feasible would be to add a torrent creator engine to the program. Possibly using dottorrent as a base, or something like that.

Have you clicked the image button next to settings?

@username227
Copy link
Contributor

I listed you as a maintainer in a commented line on the top of the pkgbuild. let me know if you want any changes to the format of your info (or you can also).

That file will be autogenerated for each new version and it's not really intended to be viewed by humans anyway so it doesn't matter.

On a completely unrelated note - i didn't want to add a whole separate issue for this unless you want me to, but one feature request i'm wondering if it's feasible would be to add a torrent creator engine to the program. Possibly using dottorrent as a base, or something like that.

Have you clicked the image button next to settings?

LOL. Missed that.... :-)

@username227
Copy link
Contributor

username227 commented Dec 1, 2023

I listed you as a maintainer in a commented line on the top of the pkgbuild. let me know if you want any changes to the format of your info (or you can also).

That file will be autogenerated for each new version and it's not really intended to be viewed by humans anyway so it doesn't matter.

OK, makes sense. I was just following the archwiki for headers on the top.

@username227
Copy link
Contributor

Perhaps i should figure out how to get the pkgbuild to clean up after itself - delete the git folder that's created to save over 2GB. No reason for a 17MB program to take up 2.2GB.

@username227
Copy link
Contributor

username227 commented Dec 3, 2023

FYI, I updated the pkgbuild in the aur with some technical fixes. it will now provide the latest release version, as opposed to the latest commit. If you'd like, I could possibly make a second one that provides the latest build as a -git package, development-type package. If you would apply the same type of automation to such a package, it perhaps could be updated automatically every time you apply a new commit.

@qu1ck
Copy link
Member

qu1ck commented Dec 4, 2023

I just added automation to update AUR repo when new version is released. We'll see how well it works when next release happens, I tested it as far as I could without pushing bogus updates to the actual repo.

If you'd like, I could possibly make a second one that provides the latest build as a -git package, development-type package

I don't know if there is user demand for this, if you want to add it - go for it. But it should not require automation, probably just remove sha sums checking (if it is allowed) and use "latest" instead of tag in the dbip url. It should just work.

@username227
Copy link
Contributor

username227 commented Dec 4, 2023

I just added automation to update AUR repo when new version is released. We'll see how well it works when next release happens, I tested it as far as I could without pushing bogus updates to the actual repo.

If you'd like, I could possibly make a second one that provides the latest build as a -git package, development-type package

I don't know if there is user demand for this, if you want to add it - go for it. But it should not require automation, probably just remove sha sums checking (if it is allowed) and use "latest" instead of tag in the dbip url. It should just work.

Right, removing the sha sums would not work, but it wouldn't affect anything, because the only differences would be in the git repository, (not the download of the dbip or the desktop file) and the git repository's sha sum is "SKIP". In order to get the latest, we just take away the version number completely from the source command and it will automatically clone the latest master. [in the main package, the package has a relative version number in the sources command; when you bump to 1.1.0, for example, that line in the sources command doesn't need to be changed; only the pkgver field needs to be changed.]

However, we would need to change the pkgbuild slightly so that it would trigger an update. In this case, I believe we would change pkgrel field from 1 to 2, and then to 3 for however many commits there are. However, you may be right about the demand, and even if we decide to do this, we should probably ensure first that the automation is working properly in the main package.

@qu1ck
Copy link
Member

qu1ck commented Dec 4, 2023

No, pkgrel is for packaging version only, when software itself changes the version should be updated. That's how version in dev builds works too, it looks like x.x.x-y-g<githash> where y is number of commits since x.x.x tag. That whole string should go into pkgver, but with hyphens replaced with underscores.

@qu1ck
Copy link
Member

qu1ck commented Dec 27, 2023

Just published v1.1.0, the AUR update job seems to work correctly. @username227 can you verify that build still works on arch?

@username227
Copy link
Contributor

Just tested. Worked like a charm. Great job!

@qu1ck
Copy link
Member

qu1ck commented Dec 27, 2023

Great, so now this issue is just about rpm. Any fedora aficionados who would like to pitch in?

@username227
Copy link
Contributor

I just added npm as a depencency and changed the pkgrel to 2. Please update on your end if necessary.

@qu1ck
Copy link
Member

qu1ck commented Dec 28, 2023

It is not needed at runtime and you already have node which ships with npm in makedepends so the change is redundant.

@username227
Copy link
Contributor

nodejs has npm as an optdepends, not makedepends

@qu1ck
Copy link
Member

qu1ck commented Dec 29, 2023

Ok, then add it to makedepends, not depends.

@username227
Copy link
Contributor

yes, that's what I did since you confirmed it's not needed at runtime, which I suspected. Thanks!

@username227
Copy link
Contributor

error log
The latest update did not update through the AUR. Attaching copy of error in the build.

@qu1ck
Copy link
Member

qu1ck commented Feb 21, 2024

Honestly I can't help much with debugging that build failure because I don't have arch. It complains about being unable to link something from libdbus even though the lib seems to be there.

Possible reasons I can think of:

  • dbus is not listed as dependency in the build script. Not sure why it worked before but it should be listed.
  • Updated gcc on your system changed behavior of symbol resolution, they planned to make explicit dependency listing mandatory so probably it needs -ldbus-1 flag or something like that but rust build system or dbus-rs build script doesn't provide it for some reason

What does pkg-config --libs dbus-1 print on your system?

@username227
Copy link
Contributor

What does pkg-config --libs dbus-1 print on your system?

it outputs:
-ldbus-1

@qu1ck
Copy link
Member

qu1ck commented Feb 21, 2024

As it should, so the lib is there and build system knows how to find it, I'm not sure why it is not on linker the command line. But absolutely nothing in the app code changed between v1.1 and 1.2, not even lib versions. So it must be rust version, gcc version or some other change.
It compiles fine for me on debian 12 with latest rustc.

@username227
Copy link
Contributor

The program compiles just fine when I do it manually. Only the script doesn't work. The only differences I can tell in the script are that it has "npm ci" instead of "npm install", but changing that didn't make a difference.
The other difference is the place where we are downloading the mmdb file from. When I do it manually, i am using your wget command on github, but in the script we downloaded it from somewhere else.

@qu1ck
Copy link
Member

qu1ck commented Feb 21, 2024

Neither of those are what caused the failure. Probably just dbus is missing as dependency in the script.

The other difference is the place where we are downloading the mmdb file from. When I do it manually, i am using your wget command on github, but in the script we downloaded it from somewhere else.

I simply mirrored the mmdb file from db-ip.com to release page in this repo because old db files tend to disappear from the original website making old links invalid.

@username227
Copy link
Contributor

so probably it needs -ldbus-1 flag or something like that

How do I add this flag? does it go on the "npm run build -- -b" line like this:??
npm run build -- -b -ldbus-1

@qu1ck
Copy link
Member

qu1ck commented Feb 21, 2024

No, that won't work. You probably can add it through defining RUSTFLAGS env variable but you shouldn't have to manually add it, as you say yourself, the manual build works, that means there is some difference in how script environment is setup. Did you try to add dbus to dependencies in the PKGBUILD?

@username227
Copy link
Contributor

yes, adding dbus as a dependency didn't make a difference. I checked the diff's between the old pkgbuild and the new one...there's absolutely no reason I can think of why it should work when I do it manually but not when I do it through the pkgbuild. I am stumped. Have to get to work though. Will try to look again later. Hopefully in the interim someone on the aur will yell at us that the pkg is broken and tell us the reason...lol.

@username227
Copy link
Contributor

OK, reddit to the rescue. It appears that it won't link properly with LTO enabled. Using options=('!lto') in the package build seems to solve the problem. Not sure why it worked until now, but whatever.

Before I push out a correction on the AUR, someone claimed that git is missing from makedepends. Should I add this? I wanted your input to see if it was necessary or if it's redundant.

@qu1ck
Copy link
Member

qu1ck commented Feb 21, 2024

Yes, rust uses git to checkout some libs.

Can you open a PR with the changes for the template here? https://github.com/openscopeproject/TrguiNG/blob/master/ci/generate_pkgbuild.py

@username227
Copy link
Contributor

Yes, rust uses git to checkout some libs.
I don't see git on the list of dependencies for rust in arch, so i'll add it just in case.

Can you open a PR with the changes for the template here? https://github.com/openscopeproject/TrguiNG/blob/master/ci/generate_pkgbuild.py

Sure, i'll work on that.

@username227
Copy link
Contributor

I made a git pkgbuild. I installed it for myself. I am hoping it will auto-update when you make another commit, but i'm not sure. I'll keep an eye out. If it works, I could theoretically publish it. We would just have to make the git version contra to the regular one and vice-versa.

@username227
Copy link
Contributor

just sharing that everything seems to have worked absolutely flawlessly for the arch package in the latest update!

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

No branches or pull requests

3 participants