Running PureBasic on non Ubuntu based distros

Linux specific forum
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Running PureBasic on non Ubuntu based distros

Post by kake26 »

Hi all,

I've wanted to share this for a long time. I find myself having to run PureBasic on Linux distros which aren't based on Ubuntu. Which as you can imagine makes it hard to get it all working. So I stuffed PureBasic into a Apptainer container. I can now run it anywhere I want to and need to. If anyone is interested on building there own container for it, I can provide my build file. Now you will need to download your own copy of PureBasic and slightly rename the file and then run a build. Now if your wondering why I choose Apptainer for this VS Docker or Podman, then I'll tell you. Docker could do it and I have done, but GUI applications under Docker are a pain. Podman would work a bit better, allowing it to function properly would still require a little trickery. Apptainer, by its very nature is extremely well suited to this without any kind trickery required. Also the programs the compiler spits out run fine on pretty much any distro I've tested them on so they aren't a concern. So if anyone is interested then please let me know I'll probably post it to one of my repos.
GoodNPlenty
Enthusiast
Enthusiast
Posts: 112
Joined: Wed May 13, 2009 8:38 am
Location: Arizona, USA

Re: Running PureBasic on non Ubuntu based distros

Post by GoodNPlenty »

I would be interested. Thank You for taking the time to create and share this solution.
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by kake26 »

Hi,
Sorry for the delay. I lost this thread a little when I was messing with settings. Anyhow to answer your question. I'm going to go over the steps needed and I'll link the def file I use for apptainer.

1. Get and install apptainer. https://apptainer.org/
2. Download a copy of purebasic and your going to want to put this in the same place you put the .def file that builds the container. You should also rename it to just purebasic.tar.gz as that is what is specified in the def file.
3. Grab the .def file for apptainer. https://urandom.link/purebasic.def
4. Open a terminal in that directory or just cd into it.
5. Run this command

Code: Select all

apptainer build purebasic.sif purebasic.def
Once that is done just run purebasic.sif. You literally just run by doing a ./purebasic.sif in the directory where apptainer built the container. I currently run purebasic this way under Garuda Linux which is Arch Linux based. It works quite well even with wayland being my graphics server.

Notes
The def file builds a container based off of Ubuntu 22.04. I stuck with that as my attempts to run purebasic directly on a Ubuntu 24.04 install kind of failed at the time. You can also optionally create desktop launcher or menu item for it. Also apptainer will give the IDE full access to your home directory so it will behave pretty much as if you had installed it like any other app on the system. This is partially why I choose apptainer for this because it integrates so well. The purebasic examples are accessible at /opt/purebasic/examples. Just open that path as you normally would in the PureBasic IDE. Of course any changes you make you have to write location where you can save files too. I'm also open to ideas to improve the container. I'm thinking of creating a companion app to make building and integration even simpler.
Last edited by kake26 on Fri Sep 20, 2024 9:09 pm, edited 1 time in total.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by Fred »

how do it handle the dependencies (gtk-dev etc.) ? It should be installed as well ?
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: Running PureBasic on non Ubuntu based distros

Post by Marc56us »

[...] I find myself having to run PureBasic on Linux distros which aren't based on Ubuntu [...]
Ubuntu is not a base distribution, Ubuntu is itself based on Debian which is itself the basis of many other distributions. So if you only need to learn and use one, you might as well use Debian. :wink:
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by kake26 »

Fred wrote: Fri Sep 20, 2024 7:47 am how do it handle the dependencies (gtk-dev etc.) ? It should be installed as well ?
Everything should be in the container. I used the install documentation in the purebasic download to craft and tweak the container as needed. I based it off Ubuntu 22.04 as well as I ran into issues with 24.04. I've had no issues with purebasic running in a apptainer container nor the resulting executables it produces. The programs I've made with it so far have even run just fine under Wayland using Xwayland. I've run the container and the programs I've built under various distros as well. From kubuntu to KDE neon to garuda Linux. Upgrading the ide does require you to rebuild the container though. Also note the container is a bit large, but that is really a small price to pay having purebasic run wherever I want and need it to.
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by kake26 »

Marc56us wrote: Fri Sep 20, 2024 8:06 am
[...] I find myself having to run PureBasic on Linux distros which aren't based on Ubuntu [...]
Ubuntu is not a base distribution, Ubuntu is itself based on Debian which is itself the basis of many other distributions. So if you only need to learn and use one, you might as well use Debian. :wink:
I am quite aware of that fact. Thank you for reminding me though.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by Fred »

Which size is the container ? How do you run it once downloaded ?
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by kake26 »

The size I will have to look to confirm, but 400 ish mb. As far as running it you can run the container in the same fashion you can run any program. A simple ./purebasic.sif from a terminal or you could make a launcher. I added it manually to my KDE menu.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by Fred »

Thanks for the infos. How do you access the examples file from container ? can you modify them ?
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by kake26 »

Fred wrote: Fri Sep 20, 2024 9:06 am Thanks for the infos. How do you access the examples file from container ? can you modify them ?
The examples are easy to access. They will be under /opt/purebasic/examples. So when the IDE is running just do a file open and navigate to that spot. As far as modifying them yes you can, but of course you will have to save the modified copy else where. Technically you could work some wizardry make it seem and feel like you can modify the container, but thats a ways more advanced thing which I not going to go into. Oh there is one more thing I wanted to mention. If you run it on wayland like I do you may see a error like the one below.
./purebasic.sif

(process:18271): Gtk-WARNING **: 14:54:45.368: Locale not supported by C library.
Using the fallback 'C' locale.
Authorization required, but no authorization protocol specified

(purebasic:18271): Gtk-WARNING **: 14:54:45.382: cannot open display: :1
You can fix it by running

Code: Select all

xhost +local: 
Also I think I may attempt update the original post to make it more clear.
User avatar
greyhoundcode
Enthusiast
Enthusiast
Posts: 112
Joined: Sun Dec 30, 2007 7:24 pm

Re: Running PureBasic on non Ubuntu based distros

Post by greyhoundcode »

I hope this isn't construed as hijacking the thread, but with essentially the same end-goal in mind ... I wonder if an official Snap (or Flatpak) package would be a viable way to distribute the Purebasic IDE and compiler? 🤔
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by Fred »

I don't know if it will work as you need the -dev packages to compile a new app.
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Re: Running PureBasic on non Ubuntu based distros

Post by kake26 »

greyhoundcode wrote: Sat Oct 19, 2024 5:18 pm I hope this isn't construed as hijacking the thread, but with essentially the same end-goal in mind ... I wonder if an official Snap (or Flatpak) package would be a viable way to distribute the Purebasic IDE and compiler? 🤔
Well given how a snap works. Yes, it would very likely work. Snaps are based off a common runtime VM. I don't see why flatpak wouldn't work either. I mean they all exist for that purpose. To package apps and all their required bits and pieces.
dmontaine
User
User
Posts: 50
Joined: Tue Jun 04, 2019 1:03 pm

Re: Running PureBasic on non Ubuntu based distros

Post by dmontaine »

I just checked the install script I wrote for Fedora for Pure and Spider basic. It still works with the 24.04 ubuntu packages and Fedora 41. It should be near the top of the Linux messages right now.
Post Reply