Rosetta Code Task: "Chat Server", requires AdaSockets; anybody try this?


How do you add an external package to Alire?

The following is my notes for the future attempts to compile and build this task:

Requires AdaSockets which is not installed.
no details provided by Rosetta Code at Category:AdaSockets - Rosetta Code
The following URL is a guess (AdaSockets)


A library like AdaSockets should be included in the Alire index, but the author, or anybody, hasn’t done it yet; it shouldn’t be difficult, though.

In that situation, it’s easier to just use gprbuild. I did it in this way:

  • Download AdaSockets
  • Follow instructions, for example:
./configure --prefix=$HOME/local
make install
  • Copy the source code in chat_server.adb
  • Create a GPR file for Chat_Server in the same directory:
with "/home/mgr/local/share/gpr/adasockets.gpr";

project Chat_Server is
end Chat_Server;
  • Build using:
gprbuild chat_server

I’ve added these instructions to Category:AdaSockets - Rosetta Code

I’m pretty sure GNAT.Sockets was based on AdaSockets, so I’m not sure why you’d use that instead of the one shipped with your compiler.

I don’t think so; according to the Author:

Starting from release 3.14, the GNAT compiler started to integrate a GNAT.Sockets
package. However, this package is GNAT specific and contains at this time less features
than AdaSockets. At some point, AdaSockets may use GNAT.Sockets as its underlying
sockets structure.

And last release was 5 months ago, so it is still maintained.<>

I’ll try it today. Thanks again for the response.