Re: Where to place program's files on Linux

Honestly, until you get more familiar with the filesystem layout, you're probably best distributing your program as a zip or tar.gz. Organize things how you want. As someone with 25 years of experience running desktop Linux, I'd probably just extract your directory somewhere in ~/opt, link your binary from ~/bin, and be perfectly happy. If you're looking to start your journey, though, here are some pointers/things to Google (too lazy to look up the URLs myself because I'm smoking a brisket, so am a bit pressed for time):

The XDG desktop specification is likely what you want for directory structure. Essentially, it prescribes locations like ~/.config for user-specific configuration, ~/.local/bin for binaries, other directories for documentation, etc. Generally, good packaging tools will help you out here, and if you put things in the correct place, features like desktop integration will just work.

I wouldn't spend much (if any) time on distro-specific packaging. Instead, I'd look at either AppImage or Flatpak. AppImage is the most straight-forward in many ways. You bundle your app, dependencies, .desktop files, etc. as a single shell script + squashfs file. A user downloads that, chmod +x's it, and runs it. There is tooling to automatically integrate downloaded AppImage files into the desktop, automatically upgrade them, etc. Neatly enough, this tooling is all shipped as AppImages, so you can have someone up and running with a MacOS-like single-file app distribution model regardless of what distro they're on. Or, if they don't want that, they can just treat your app like a binary and run it. Use linuxdeploy to build AppImages, as it handles scanning your executable for dependencies, bundling in other libraries you specify, some corner case ABI incompatibilities, etc.

Flatpak is a bit more complicated, but also more app-store like. Your app is built in a sandbox, but instead of installing each and every dependency needed for, say, GNOME 3.36, you just depend on the GNOME 3.36 platform, which depends on the FreeDesktop 20.something platform. You can still install individual dependencies, but the Flatpak model is a bit like saying "My app needs Android 9 plus this and that," rather than "My app needs GTK VX.X, ATK VY.Y, etc. Also, Flatpaks are generally shipped as part of a repository, so you can subscribe to a curated channel of apps and pull down delta updates for whatever apps you've installed. But, as you can probably imagine, Flatpak is more complicated than passing a binary and a few other parameters to linuxdeploy and shipping a single file.

Hope that helps, feel free to ask additional questions and I'll see what I can do.

Edit: Accidentally submitted before I was done writing this.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector

Reply via email to