stellarium
stellarium copied to clipboard
Port code to INDI 2.0.2 and update CPM
This PR is based on the work done by some people at https://github.com/Stellarium/stellarium/pull/2891. In particular:
- patch created by @panicgh was applied as is, since it worked fine
- the code created by @ckuethe was updated to work with v2.0 since it was not compiling
What was tested:
- compilation using the OS' INDI 2.0.2 works fine
- compilation using the CPM's INDI 2.0.2 works fine
- the TelescopeControl plugin could be loaded and connected to a INDIserver instance using Simulators.
What was not tested:
- connection to real hardware
- real hardware working properly
Looks interesting, thank you! Anybody with real hardware willing to test?
for openSUSE TW users: I've created a test repo with Stellarium compiled using INDI 2.0. You can find it here: https://build.opensuse.org/package/show/home:polslinux:branches:Education/stellarium
the TelescopeControl plugin could be loaded and connected to a INDIserver instance using Simulators
IIRC there were some problems only present in Qt6 but not Qt5. Did you check this?
@10110111 the tests I did were with Stellarium compiled using QT6
macOS:
[ 4%] Building CXX object plugins/TelescopeControl/src/INDI/CMakeFiles/TelescopeControl_INDI.dir/TelescopeControl_INDI_autogen/mocs_compilation.cpp.o
In file included from /Users/aw/stellarium/builds/macosx/plugins/TelescopeControl/src/INDI/TelescopeControl_INDI_autogen/mocs_compilation.cpp:2:
In file included from /Users/aw/stellarium/builds/macosx/plugins/TelescopeControl/src/INDI/TelescopeControl_INDI_autogen/EWIEGA46WW/moc_INDIConnection.cpp:9:
/Users/aw/stellarium/builds/macosx/plugins/TelescopeControl/src/INDI/TelescopeControl_INDI_autogen/EWIEGA46WW/../../../../../../../../plugins/TelescopeControl/src/INDI/INDIConnection.hpp:23:10: fatal error: 'libindi/baseclient.h' file not found
#include "libindi/baseclient.h"
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [plugins/TelescopeControl/src/INDI/CMakeFiles/TelescopeControl_INDI.dir/TelescopeControl_INDI_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [plugins/TelescopeControl/src/INDI/CMakeFiles/TelescopeControl_INDI.dir/all] Error 2
make: *** [all] Error 2
Stellarium.app: No such file or directory
@alex-w thanks for checking macos! I'm gonna look into it
@alex-w thanks for checking macos! I'm gonna look into it
please see our build bots also - looks like cmake has missing files + source code need to be update (check include# directives) for INDI
That's weird though, I can't reproduce that issue locally :thinking:
That's weird though, I can't reproduce that issue locally 🤔
Probably you have locally installed INDI
yep I do have INDI installed, but I'm running cmake with -DPREFER_SYSTEM_INDILIB=OFF
and cmake is executing the CPM action while generating stuff.
I'll try on a vm
Thanks for following this up. I am super busy at the moment and got stuck in the CMake porting part.
I wonder if it is really necessary to build INDI through CPMAddPackage
and then repeating parts of INDI's CMakeFile (including version, so-version, dependencies between some files etc.) and only building selected parts of INDI. Wouldn't it be simpler to either build full INDI as CMake external project or not build it at all and simply require a system-provided INDI? It appears to me that the current approach makes it unnecessarily hard to port to new INDI versions.
I agree that bundling INDI is, IMHO, not the best solution. I also think that we should treat INDI like any other dep: is it installed? Yes, then build the plugin. No? Then don't build the plugin.
If the existence of compatible versions is guaranteed by simple dependencies, and we don't change anything in the INDI code, this would be OK for me.
Wouldn't this go against the practice used for QXlsx
and CalcMySky
, which were also once optional but are now CPM-required?
If INDI is available as standard package from default repositories just like Qt stuff, and people may have installed them already for other programs, it would be preferred over CPM and private compilations. But I had understood our first adoption of INDI had some non-standard edits in the INDI 0.* sources, so required a private build. The other packages for QXlsx and CMS are also still optional, but there are no apt packages from Debian, right?
there are no apt packages from Debian, right?
Right.
BTW I just noticed that in Ubuntu, even in 23.04 and in the development version, Stellarium is still 0.22.2. Do you happen to know why it's so old?
No, I don't know how the official Ubuntu maintainers upgrade their packages. We provide an Ubuntu repo with the latest version, see Guide 2.3.3. If INDI does the same, it should be fine for us. But CPM may be the solution if INDI is not available everywhere.
Speaking of Linux, most of the widely used distros have INDI 2:
- Fedora >= 38
- openSUSE Tumbleweed
- Archlinux
- Gentoo
- Ubuntu has a PPA directly from the INDI dev
For MacOS, there may be a port or whatever. Still, compiling there it's a pretty trivial task. There are instructions on the INDI website.
For Windows, I don't think it's gonna be an issue. There they have ASCOM, official software from hardware makers and imaging software that integrates pretty well with Stellarium.
Hello :smile: do we have a final decision on what to do with INDI? Treat it as a dep or bundle it?
INDI client within Telescope Control plugin expected to all platforms, so, e.g. Windows user can connect direct to INDI server onto Linux. The current branch has few #include
directives to building the INDI-client, but when INDI is not installed locally, then headers are missing (INDI2 has other locations for these files) - the code of Telescope Control plugin should be updates to reflect the changes paths in INDI.
I guess we better keep CPM then. Otherwise Windows support could be an issue :thinking: I'll update the PR
Any news? It seems other projects are expecting Stellarium finally moving to INDI 2.* 'really soon'.
Any news here?
I'm working on getting Stellarium running on Windows on ARM. I already got it working without CalcMySky and without the Telescope plugin (due to INDI). But I just packaged CalcMySky and I'm going to package libindiclient, but it will have to be the latest INDI (2.0.4 as of this writing). Support for INDI 2.x should happen soon™️ .
Any progress?
Well since I got Stellarium building for Windows on Arm with the current INDI I did not pursue this any further. It was not my main objective.
I don't know this library nor how it's used by Stellarium so someone who knows this stuff should do this upgrade
As already mentioned four months ago: if we didn't try to build INDI from Stellarium but treat it like any other dependency, the issue would have been long solved. Some distros, e.g. NixOS, apply the patch for new INDI support and just use the system-provided INDI.
If we can depend on optionally system-installed stock INDI2 (build yourself where required), this would be the best solution IMO. When users don't need telescope control, there is no need for INDI either. That would make it a "recommended" package for apt-get or similar systems. We still need to know what "our own copy" has changed, and a maintainer who occasionally cares for INDI updates as years go by.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
What's the verdict here ?