I am very new to Ada and want to learn to use ncurses as one of my first exercises. Is there documentation that I would find helpful or some demo code somewhere?
So far I have run this on ubuntu 22.04 amd64:
alr get --build ncursesada
I am also trying to work with Ada on termux arm64 where alire does not seem to be readily available. I expect to use gnat to compile in that case, but I am unaware of how I should make use of ncursesada without alire and with only gnat – any pointers on this would be appreciated too.
I am going to read through the Ada Programming Wikibook; hopefully I will notice somethings that’ll help me with this exploration too.
Thanks for the reply; I’ll take a look but I think I have it compiled on amd64. I am just so new to Ada that I don’t know how to now write a sort of hello world that uses ncurses. I’d also like to use sql of some sort (maybe slqlite3) if possible. I don’t know how to import things installed with alr get --build.
Next, I don’t know how to get this to work with gnat in an arm64 context where I don’t know how to access alire. But I will try manually building once I have imported the library properly and used the bindings to my liking on amd64.
The install instructions I linked above are the original author’s instructions and are long before alire, so they would be the way to start probably. You would just need to clone the repo to your platform and see if the instructions there work for you.
For building without alire, there’s no getting around learning a bit about the GNAT build process. Look up documentation for gnat or gnatmake.
Alire makes use of these tools by default so you could try copying and tuning the build files generated by it on x86-64 to your aarch64 target.
As a general advice, don’t try to do too many new things in one go.
In your two posts you managed to ask about libraries (ncurses, sql), toolchains (alire, gnat) and architectures (x86-64, aarch64).
You’ll be better off if you first read about Ada and its ecosystem (check out AdaCore’s Learn platform if you haven’t yet). then try doing your exercise, and then come back to ask your questions.
If you do that, you are likely to overcome many of your current difficulties on your own (which are objectively not very interesting) and find many others (that are much more interesting).
to get started create a project with Alire with alr init (follow the promts).
Then go into the newly created project folder cd test/ (for example).
You can now import ncursesada as a dependency for that projects with alr with ncursesada.
This will pull ncursesada. It may also need an external/system dependency, in my case it was m4_tool, and since I am using a system that already had it installed, I had no complains from Alire, but if the build fails, make sure to install it with your package manager such as yum, apt, zypper, etc.
You can now test build your project with alr build, which should build ncurses and your sample application.
For what to do with ncursesada and what to import, you can read the documentation here: Ada95 Binding for ncursesncursesada follows the general ncurses design and functions, so there are almost always a direct one-to-one equivalence between them. If you use a code editor with LSP (Language Server Protocol) and launch it with alr edit you can use your editor’s functions to find references, file locations, etc. The ncursesada src can nonetheless be found in your projects folder under XXX_Config/Lib_AdaCurses.