Jump to content

Darkradiant install with Flatpak? (Linux)


Recommended Posts

Question:

I was wondering if installation with Flatpak is something that is considered for the future.

 

Motivation:

I recently installed Linux Mint on my laptop and found installing DR 3.0 relatively easy (ppa), so I was thinking about figuring out how to create a package for Manjaro (which I use on my main pc), but then I thought about Flatpak. Isn't that the way forward for if you want to support multiple distro's but don't have a large group of interested Linux maintainers? Currently it is:

  • Debian: There is a maintained package,
  • Ubuntu: There's a ppa
  • All other distro's: built from source

While with Flatpak it seems you just need one way of installation for all distro's. I could be wrong though.

Edited by datiswous
Link to comment
Share on other sites

 

 

On 6/20/2022 at 9:05 PM, datiswous said:

I recently installed Linux Mint on my laptop and found installing DR 3.0 relatively easy (ppa),

 

Sorry for going a little bit ot.

Thanks to @thebighI learned how to compile the Radiant from the source code. He also mentioned that missing packages might cause problems and he was right.

During compiling, the console reports that the "Glue" package is missing. Went to the Mint distro site but there are three pages of packages associated with "Glue".  Which one do I have to pick?

Regarding your question, I am not sure whether I understand correctly. However, if this Flatpack thingy allows for automated installation on Mint avoiding problems as mentioned above, then I would say this is a great idea.

 

Edited by JackFarmer
  • Like 1
Link to comment
Share on other sites

4 minutes ago, JackFarmer said:

Regarding your question, I am not sure whether I understand correctly. However, if this Flatpack thingy allows for automated installation on Mint avoiding problems as mentioned above, then

https://en.wikipedia.org/wiki/Flatpak

It can be installed on all distro's that support Flatpak. Normally every major distro has it's own package system.

 

In your case I don't think you need to build from source. See this post:

https://launchpad.net/~orbweaver/+archive/ubuntu/darkradiant

This should be added to the wiki I think.

  • Thanks 1
Link to comment
Share on other sites

If someone can get a FlatPak of DarkRadiant working, we'll gladly add the build scripts to the repo.

I tried creating a Snap once, but ran into numerous difficulties and eventually gave up. It took ages to startup, the OpenGL functionality was non-operative, and the application could not access the desktop GTK theme (because the entire GTK stack is packaged into the Snap itself) which meant it would only display with the hideous default Windows 95 theme.

Applications I've used from Snaps or FlatPaks either draw their own theme (e.g. Blender) or include GTK themes and a theme switcher into the application itself (e.g. Inkscape). Presumably such internal theming would need to be integrated into DR unless the latest versions of Snap/FlatPak have managed to solve the theme problem some other way.

  • Like 1
Link to comment
Share on other sites

I've been using Fedora Kinoite (the KDE equivalent of Silverblue) on my laptop for the past couple months as an experiment, and Flatpak is its primary package manager.  I've been looking for an excuse to learn about the Flatpak packaging process, so if nobody else gives it a go I'd be interested in trying to make a build in the near future.

  • Like 2
Link to comment
Share on other sites

FlatPak or AppImage seem to be the leading options these days. I'll probably get rid of the vestigial Snap scripts; from what I've read Snap is Ubuntu's "me too" offering which is largely ignored by other distros, and was never really designed for desktop apps anyway.

I did experiment with AppImage but ran into some problems with its expectations of what should go in the build directory. Its documentation is very limited and consists largely of long example shell scripts which you are expected to read and reverse engineer for your project. The FlatPak documentation looks much better and seems to include a proper tutorial on how to make a simple package.

  • Like 1
Link to comment
Share on other sites

Quote

Following the decision made by Canonical to replace parts of APT with Snap and have the Ubuntu Store install itself without users knowledge or consent, the Snap Store is forbidden to be installed by APT in Linux Mint 20.

Also, Linux Mint disabled the Snap store in their distro,

https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html

 

Link to comment
Share on other sites

  • 3 weeks later...

I'm giving it a go this weekend, getting the flatpak to build and start up went surprisingly smoothly.  It crashes when you try to do anything with a shader though, so this is where the last 10% is going to take 90% of the time...

 

 

  • Thanks 1
Link to comment
Share on other sites

  • 4 weeks later...

I figured out the crash, it seems we will have some things to fix in order to get DarkRadiant to work with the new(ish) wxwidgets 3.2 release.

I didn't originally think wxwidgets was at fault since I got the same crash in my flatpak downgrading to 3.1.x.  It wasn't until my main system upgraded to 3.2 that I went back and looked, and realized my previous working version was 3.0.5 (they do odd/even for unstable/stable releases).  I built the flatpak against 3.0.5 and things seem to be working well now!

I'll put the flatpak through its paces, especially around file loading/saving, and make sure there is nothing else broken.  If everything looks good, there's just a couple odds and ends to clean up the permissions and this should be good to go.

I'll also file issues for the things that broke when I tried wxwidgets 3.2.  It's already the default in Arch, and since it's considered a stable release I'm sure it's going to end up everywhere else eventually too.  Fortunately we can keep the flatpak on 3.0.5 as long as needed.

  • Thanks 2
Link to comment
Share on other sites

Do you still get the render issues in the texture preview window (i.e. the view is entirely white until you resize or force a render in some way, after which it works correctly)? This was always a problem with the 3.0 wxWidgets packaged with Ubuntu.

I've been thinking about wxWidgets version recently because I upgraded to Ubuntu 22.04 last week and they are still packaging wxWidgets 3.0, even though 3.2 has been out for a long time. I'm wondering if we need a way to build using a local newer version of wxWidgets that we can include without needing to rely on the distro packages (e.g. with an optional Git submodule). Although if you're getting crashes with 3.2 it sounds like the upgrade might not be as simple as I would have hoped.

Link to comment
Share on other sites

The official wxWidgets 3.2.0 has been released just recently, in July, so I assume this was too late for Ubuntu 22.04.

But I'm glad that it is out at last (it took seemingly forever), now we can finally move on and remove some of the weird #if workarounds. After removing the problems and crashes, of course. 😑

  • Like 1
Link to comment
Share on other sites

2 hours ago, OrbWeaver said:

Do you still get the render issues in the texture preview window (i.e. the view is entirely white until you resize or force a render in some way, after which it works correctly)? This was always a problem with the 3.0 wxWidgets packaged with Ubuntu.

Can you clarify which window you're referring to? I don't think I had this problem on Arch so I'm not sure where to look.

2 hours ago, OrbWeaver said:

I'm wondering if we need a way to build using a local newer version of wxWidgets that we can include without needing to rely on the distro packages (e.g. with an optional Git submodule).

wxWidgets 3.2 also now has a cmake build option, so that might make it easy to integrate with the DR buildsystem if we went this route. 

Link to comment
Share on other sites

3 hours ago, greebo said:

The official wxWidgets 3.2.0 has been released just recently, in July, so I assume this was too late for Ubuntu 22.04.

Oh, I must have been thinking of 3.1 then, which being an "unstable" release wouldn't be expected to make it into Ubuntu repositories.

1 hour ago, jonri said:

Can you clarify which window you're referring to? I don't think I had this problem on Arch so I'm not sure where to look.

2D views, such as the preview image on the Media tab and the main part of the Textures tab, used to show completely white until resized. I haven't actually tested since my Ubuntu upgrade though so not sure if it's still a problem.

Link to comment
Share on other sites

22 hours ago, greebo said:

We got a bug report here which seems to happen using wxWidgets 3.2. @jonri Is this something that looks like problems you remember running into?

https://bugs.thedarkmod.com/view.php?id=6080

Yes, that was the big one and I responded with more details.  There were some other new asserts as well. 

I updated my flatpak build script with the new DR release this week and re-tested.  I'll post the build script and some instructions soon for others to test.

From what I can tell, the standard practice is to commit the build script to Flathub instead of the project repo.  Once we agree everything looks good I can submit the PR at flathub unless@greebo would prefer to do it.

Link to comment
Share on other sites

I don't insist on doing that myself, so feel free :)

I'm currently upgrading to wxWidgets 3.2 on Windows, and I had to fix a few things in terms of implicit wxIcon>wxBitmap>wxBitmapBundle conversions.

Link to comment
Share on other sites

If anyone is inclined to try out the flatpak by building it locally, here are the steps:

  1. Install flatpak and flatpak-builder using your normal package manager.
  2. Create a new directory and place the attached com.thedarkmod.DarkRadiant.yml inside of it.
  3. In the directory, run `git clone https://github.com/flathub/shared-modules.git`.
  4. Run `flatpak install org.freedesktop.Platform//21.08 org.freedesktop.Sdk//21.08`.
  5. Run `flatpak-builder --user --install --force-clean build-dir com.thedarkmod.DarkRadiant.yml`.
  6. Grab a coffee while you wait for DR and all its dependencies to compile.
  7. Launch DarkRadiant from your UI, or run `flatpak run com.thedarkmod.DarkRadiant`.

Specifically, I'm interested in:

  1. Build issues: this should work pretty universally since it builds against a common SDK, but if the steps above don't work let me know.
  2. Runtime issues: this should also run universally, if it doesn't launch then something went wrong.  If it runs but you come across a specific feature that doesn't work, let me know and I'll see if we can work around it.
  3. If anyone runs Wayland, please let me know either way whether it is working.  If not, there are some permissions I should add.

Known issues:

  1. The flatpak currently can't find the icon.  It should just be a matter of getting the build file to copy it to the right place, so I can resolve that easily.
  2. This doesn't use flatpak's portals for file access.  One of flatpak's advantages is its sandboxing features, but I currently have this app's permissions set to allow the whole filesystem (even so, technically there are some things flatpak still sandboxes away).  It would take a some development to use portals for file dialog boxes, the big unknown to me is how to deal with accessing the game directory which could be anywhere.  This doesn't prevent us from releasing, but it might be nice to look at in the future.

If everything looks good, I'm planning to get this up on flathub this weekend.

com.thedarkmod.DarkRadiant.yml

Edited by jonri
  • Thanks 1
Link to comment
Share on other sites

Unfortunately I can only get as far as step 5:

$ flatpak-builder --user --install --force-clean build-dir com.thedarkmod.DarkRadiant.yml

(flatpak-builder:15593): Json-WARNING **: 20:22:26.374: Failed to deserialize "config-opts" property of type "GStrv" for an object of type "BuilderModule"
Downloading sources
Downloading https://downloads.sourceforge.net/project/glew/glew/2.2.0/glew-2.2.0.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   327  100   327    0     0    496      0 --:--:-- --:--:-- --:--:--   496
100  816k  100  816k    0     0   600k      0  0:00:01  0:00:01 --:--:-- 3296k
Downloading https://mesa.freedesktop.org/archive/glu/glu-9.0.2.tar.xz
100   162  100   162    0     0    567      0 --:--:-- --:--:-- --:--:--   567
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Failed to download sources: module glu: server certificate verification failed. CAfile: none CRLfile: none

I'm assuming this is more an Ubuntu problem rather than a Flatpak problem, since nothing in the manifest specifies the SSL certificates. However I don't know how to rectify it. I'm not even sure what it's using to do the download: wget downloads that URL fine, whereas curl returns a "301 Moved Permanently" page but does not otherwise complain about SSL certificates.

EDIT: This works fine and provides similarly-formatted output, so I assume Flatpak is using curl behind the scenes.

$ curl -OL https://mesa.freedesktop.org/archive/glu/glu-9.0.2.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   162  100   162    0     0    516      0 --:--:-- --:--:-- --:--:--   515
100  425k  100  425k    0     0   296k      0  0:00:01  0:00:01 --:--:-- 1076k

Perhaps it is something to do with sandboxing used by Flatpak, interfering with the ability of curl to find its SSL certificates?

Link to comment
Share on other sites

It turns out that Ubuntu are shipping a broken version of flatpak-builder.

In order to build on Ubuntu, you need to:

  1. Uninstall the .deb package of flatpak-builder if it is installed.
  2. Install the Flatpak version with [sudo] flatpak install flathub org.flatpak.Builder 
  3. This will install the Flatpak but not put the command into your path, so you need to run /var/lib/flatpak/exports/bin/org.flatpak.Builder (or your local version, if you didn't install system-wide) manually, or symlink it into /usr/local/bin/flatpak-builder for convenience.
Link to comment
Share on other sites

OK, I got it built and installed.

  • Main functionality looks good. Basic map loading and rendering is working as expected.
  • I don't know where the preferences are being stored. The existing preferences from ~/.config/darkradiant/3.1 are not loaded, however newly-set preferences are saved and loaded in the next session. So it is storing preferences somewhere, just not in the normal location.
  • The wxWidgets GL rendering issue does reproduce for me. The easiest way to trigger it is to click on the Media tab then on the Textures tab. The contents of the Media tab continue to be visible until you do something which triggers a re-render (e.g. move the camera or just click in one of the 3D views). This will probably require an update to wxWidgets 3.2 when possible.
  • Missing icon confirmed, but this is already planned to be fixed before release.
  • Like 1
Link to comment
Share on other sites

Thanks for taking a look!

5 hours ago, OrbWeaver said:

I don't know where the preferences are being stored. The existing preferences from ~/.config/darkradiant/3.1 are not loaded, however newly-set preferences are saved and loaded in the next session. So it is storing preferences somewhere, just not in the normal location.

I think this is to be expected, flatpak should keep configuration files within the app's sandbox.

5 hours ago, OrbWeaver said:

The wxWidgets GL rendering issue does reproduce for me. The easiest way to trigger it is to click on the Media tab then on the Textures tab. The contents of the Media tab continue to be visible until you do something which triggers a re-render (e.g. move the camera or just click in one of the 3D views). This will probably require an update to wxWidgets 3.2 when possible.

I think figured out the difference - I normally run in SplitPane layout and this doesn't happen there.  I was able to reproduce it in the default layout.

5 hours ago, OrbWeaver said:

Missing icon confirmed, but this is already planned to be fixed before release.

It's been surprisingly harder to fix than expected.  The directive in the build script that's supposed to do it can't find the original icon.  At worst I'll just make a copy of the icon and a new .desktop file to go with it.

 

I should also be able to give it a test on a KDE wayland session.

 

Link to comment
Share on other sites

Hello,

I followed the build procedure on a fresh Debian Stable 11 (Bullseye), KDE with X11.

The build went without an error, and I tried it by loading a small map I had around. I didn't test it extensively but I didn't met any runtime problems so far. Looking forward to see Darkradiant on flathub, though installing it this way is already a big step forward from building it from source the traditional way 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I think I've got this in good shape:

  • Upgraded to the new DarkRadiant release 3.2.0
  • Icon is now installed correctly
  • Tested wxgtk 3.2.0, it works better than it did before but still found issues (bug report to come tomorrow) so I will keep the flatpak on wxgtk 3.0 for now.
  • Tested on wayland
    • wxgtk-3.0 does not work in native wayland mode, but seems to be ok in xwayland
    • wxgtk-3.2 will likely work natively on wayland once remaining issues are fixed
    • In either case, a user on wayland won't have to worry about it, the flatpak manifest is configured to do the right thing

I'll submit this to flathub for review tomorrow.

  • Like 3
Link to comment
Share on other sites

Got a small laundry list of things to fix up to pass validation:

  • We need a content rating, I'm looking at how to generate that now.
  • We need a 128x128 icon.  I found this so I was wondering @greeboif you had any other icon source files lying around.  If not I'll just upscale the 64x64 icon to meet the requirement.
  • Screenshots of the application are also mandatory.  I could make a wiki page to host them and it would probably be fine, but for maximum stability of the links could we put a Screenshots page on www.darkradiant.net without too much trouble?
  • Allowing access to the whole filesystem is strongly discouraged, but hard to avoid if we want to support arbitrary TDM paths.  Would it be reasonable to assume that most people install TDM in their /home directories, or would accept that limitation if they were using the flatpak DR?

A couple other side notes:

  • I realized that net.darkradiant.DarkRadiant would be a more accurate package name than com.thedarkmod.DarkRadiant, so anyone who built the test version will want to uninstall it once the flathub version comes out.
  • I had to make an appstream metadata file, ultimately this can go in the main DR repo and will probably need to be updated with the new version number on each release.
Link to comment
Share on other sites

24 minutes ago, jonri said:

We need a 128x128 icon.  I found this so I was wondering @greeboif you had any other icon source files lying around.  If not I'll just upscale the 64x64 icon to meet the requirement.

image.png

24 minutes ago, jonri said:

Screenshots of the application are also mandatory.  I could make a wiki page to host them and it would probably be fine, but for maximum stability of the links could we put a Screenshots page on www.darkradiant.net without too much trouble?

Yes, I can upload them to darkradiant.net, no problem. If you want to place them yourself, you can clone https://github.com/codereader/codereader.github.io and create a Pull Request with the screenshots you want to have added. There's already an images/screenshots/ directory in that repo.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recent Status Updates

    • STiFU

      Anyone here played Inscryption? At first, I was like "no, I am not going to play a stupid card game", but this game is so much more than that. It is so meta, full of 4th wall breaks, and feels so damn spooky and weird because of it. Absolutely recommended, if you can stand the visuals. I recommend not reading up too much on it, as that could easily spoil half the incredible surprises. Just know that what you see in the beginning is by far not everything.
      · 2 replies
    • freyk

      Tried to make a tdm advertisement commentpost at one of civvie11 youtube videos about T2. Post got marked as spam. His problem (to not discover TDM for himself),..not my problem.
      But some help of some fellow TDM yt-videocomment posters would be nice. To ask him and others, to play TDM. To get more players/creators. 
      · 2 replies
    • datiswous

      Currently Profile Information has 3 fields, these are shown in forum posts under your avatar:
      1. Gender
      2. Location
      3. Interests
      I think that it could be useful to have an extra field called "Operating system" (under location). It can be useful for tech support and to see what people use.
      Alternatively it could be a more general term, like PC system, so that you can for example state that you use an AMD gpu.
      · 2 replies
    • OrbWeaver

      Greetings fellow kids.
      · 11 replies
    • Crafty_Creeper

      Keep on Creeping on...
       
      · 3 replies
×
×
  • Create New...