Looking into it atm, I found the source from lazarus trunk (1) and one from an unofficial github release (2)
The second one is easy to pull, the first one I haven’t found out yet as it’s using svn there
Not sure which one is the best to go with, but building the second one for now, if this works out ok we can have both 32bit and 64bit version for libQt5pas
From what I’ve learned, CudaText requires Python3>=3.6m, Qt5 and libqt5pas.
Python3- I set it to 3.6m as it was the default one in the CudaText settings, though any version up to 3.9 would do. Alexey, CudaText dev already added the right path in the source code, so next time we package a new version won’t need to create a dummy user.json settings file. Maybe we could go with default Python3, which if I recall correctly is 3.7.x. All these are available through HaikuDepot, so no issue with these.
Qt5- As it is already available in HaikuDepot, there was no issue with this neither.
libqt5pas- well, I still have no clue on how to do anything Haikuports related so I just added the .so files (actually, an .so file and 2 links) to the package. Ideally should be in HaikuDepot so can be added as a requirement (just learning on requirements atm). In the meantime, best way I thought of was including the libs in the HPKG.
TODO:
add a ‘pre-uninstall’ script that removes the cudatext folder from the /boot/home/config/settings. Software should be clean, once removed, everything is removed not leaving stuff behind. At least I think so.
fix the issue that I have when double clicking a text file. CudaText launches but doesn’t open the file. (no clue yet)
move CudaText to Haikuports so can be installed directly from HaikuDepot, instead of downloading the package from Github. (no clue yet)
add screenshots to the hpkg so they appear on HaikuDepot. (no clue yet)
Hello @roiredxsoto Didn’t touch CudaText yet, as for python and Qt5 they should be ok, I almost have a working recipe for libQt5Pas (1.2.9), just need to finetune the install part, slowly we’ll get there
There are two ways to handle that. On Haiku when a file should be opened by an application a RefsReceived message is being sent to this application. Haiku’s Qt implementation by default translates this into a Qt FileOpen event. If an application supports this everything works out of the box as it should. But since the FileOpen event is otherwise only being used on macOS many Qt applications that were only written with Linux or Windows in mind don’t implement that event.
So the ideal solution would be to implement support for the FileOpen event in CudaText. That would give the best results.
But the qthaikuplugin also allows for a workaround. When setting the QT:QPA_FLAGS attribute to Q_REF_TO_ARGV Qt will attempt to convert the initial RefsReceived message into command line arguments.
See the following post and the discussion preceding it for details:
With the work by @Begasus on LibQt5Pas 1.2.9, looks like now CudaText HPKG pulls the right dependencies and installs and runs on a clean Haiku install:
The libqt5pas shown here is the one provided by @Begasus. I had to include the symlinks libQt5Pas.so and libQt5Pas.so.1.2 in the HPKG, didn’t know of any other way to do it as the post-install shell script didn’t put them there.
Next is fixing the double click on text file → launch CudaText and open such file.
Besides, here is CudaText with GDScript, working on a Godot’s demo project (Platformer):
Well, finally. This is CudaText 1.133.7 64bit running on Haiku R1|b3 opening a text file after double clicking on the Text file. Loads the file inside CudaText. Has the proper icon in Tracker and Deskbar.
Please test it out:
And report any issues you may find.
By the way, it does not update prior version of CudaText. Best scenario is install on a clean Haiku which never had CudaText.
Thanks to @Lrrr (mimeset, mimeset, mimeset), @Begasus, @phw , @3dEyes and Alexey-T (CudaText dev).
@roiredxsoto
How did you fix the ‘open with’ problem? I am facing the same problem (UBLViewer)
I looked into the reply by @phw and I downloaded your package that you made for CudaText, where I see that you made a resource file with the attributes QT:QPA_FLAGS.
I’ve made a rdef-file (and .rsrc file) based on your example, but how do I incorperate this into pascal code (freepascal or lazarus)
I am using libQt5Pas (1.2.9) and Haiku 64bit (and a bit lost)
FOUND IT: Seems I needed to add the attributes using xres
After some time out, today I got back to Haiku. Updated the OS to latest nightly which caused some display issues… missing icons(the ones I had modified), font settings… And was the time to retake the CudaText stuff.
This is last CudaText with a Godot Project open. This is run whitin Lazarus, not yet built. At least it runs, so next step is building it and redo all the packaging.
I’ll try to build it and update the package. Once done, will update info.
The package is made. Not yet available on Github, I have to review git commands and not sure if should make a new branch or replace things (no idea on how to work with branches neither).
Presumably, before the end of the week the HPKG will be available to download.
I made a branch. It’s the first time, so I expect everything should be fine. If not, let me know.
CudaText should install without issues, though it might show an issue when closing tabs. This was present already in prior releases, and I haven’t figured out yet how to solve it (I presume it’s related to the Lazarus package?
That is the idea, though I just learnt to make HPKGs with CudaText, and today to work with branches on Github [though not sure if properly].
AFAIK, to get it onto HaikuDepot there are two ways:
1- I make a repo to hold this package [and hopefully others] that users should add to HaikuDepot. I don’t know how to do this yet, nor how to manage version updates with the HPKG file format for when a new version is released. I don’t think that a HaikuDepot repo can be made from a Github repo, or parts of it.
2- Add it to Haikuports. I don’t know how to do this neither. @Begasus is helping here and he already did a nice work with freepascal and libQt5pas as they are already available on HaikuDepot through Haikuports thanks to him. Now CudaText HPKG calls for the install of libQt5pas instead of it being provided within the CudaText package. Lazarus seems harder to get to Haikuports, and while it’s not available at Haikuports, CudaText couldn’t be available at Haikuports neither [@Begasus is this correct?]
I don’t really understand how Haikuports works yet, and I’m just starting with the HPKG format as well, so it’s going to take some time to get it on HaikuDepot, unless someone knows of a third way [then please enlighten me] to get it there sooner. It’s a long path to walk, and gets longer because of shortage of free time to dedicate to Haiku. We’ll hopefully get there though.