comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <bjorn@xn--rombobjrn-67a.se>
Subject: Re: CPAN style Ada repository
Date: Wed, 11 Dec 2013 21:49:34 +0100
Date: 2013-12-11T21:49:34+01:00	[thread overview]
Message-ID: <20131211214934.690d2601@hactar.xn--rombobjrn-67a.se> (raw)
In-Reply-To: 52976431$1@news.actrix.co.nz

banjo wrote:
> Would there be interest in a Perl CPAN style Ada repository?
> 
> Using the best ideas from Perl's CPAN, GitHub, Debian packages,
> SourceForge, Savannah, and how Go uses git.
> 
> Using git versioning, bug tracking, mirrors, smoke-testing,
> packaging standards etc, to archive, package, distribute
> and promote high quality Ada modules.

This might seem like a good idea, until one starts to realize the
implications.

I assume that you would want this repository to be usable on many
different operating systems, and maybe with different compilers
(because if you were planning to target only GNAT and Debian for
example, then you'd simply make Debian packages instead of proposing a
new repository). The Ada language itself is quite portable between
operating systems and compilers, but how to get the Ada code compiled
and installed is quite another story. There is no standard for how to
invoke a compiler or how to link to libraries, no standard set of
compiler options and so on. Different operating systems have different
commands for making directories and copying files, vastly different
filesystem layouts, and even differences in pathname syntax. GNAT
project files do only parts of the job, and are specific to GNAT as far
as I know.

CPAN has it easy by comparison. There is only one Perl interpreter
(probably because the language is such a hideous mess that it's
impossible to write a compatible second implementation), so they don't
need to worry about different compilers.


I recommend packaging for one of the existing distributions instead.
Come join us in Fedora, Debian or some other distribution of your
choice. Version control systems, bug trackers, build servers, mirrors
and packaging standards are already there for you (at least in Fedora),
and the packages will be just as readily available to users as any
other package.

It may seem like duplicated effort to package the same software
multiple times for different distributions, but it's actually not so
bad. Packaging for one operating system is easier than packaging for
many of them at once, so it's several smaller efforts instead of one
big effort. I took part in the Gnuada project at Sourceforge for a
while. There we tried to make RPM packages that could be built for both
Suse and Fedora. Only two target platforms, very similar and based on
the same package manager, and even that was enough to cause problems.


One thing that would help considerably, and that would be surmountable,
would be if developers of free Ada software could agree on some
conventions for how makefiles should be written. Free projects usually
have build systems made of makefiles and Gnat project files, but most of
them are too inflexible to adapt to different filesystem layouts,
support staging or allow compiler options to be customized. Packaging
is slow when packagers have to figure out how each makefile works and
often patch makefiles to get them to meet packaging standards. We could
get much more libraries and programs packaged if developers would follow
some conventions. Such conventions would need to work for mixed-language
projects as well as pure Ada projects, and for both Gnatmake and
GPRbuild.

I recommend using the Make variable names from the GNU Coding Standards
(https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html) 
and extending that with Ada-specific variables in the same style.

Developers, please support LDFLAGS for linker options, and support
CFLAGS if there is C code in your project. Stick to this naming scheme
and use "ADAFLAGS" for Ada compiler options, "GNATBINDFLAGS" for
Gnatbind options, and so on.

Support the GNU standard directory variables so that your software can
be installed in different systems with different filesystem layouts:
prefix, exec_prefix, bindir, libdir, libexecdir and all the others as
appropriate for the types of files that your project installs. Extend
with "gprdir" for GNAT project files and "alidir" for ALI files. Install
ALI files in a library-specific subdirectory of alidir, just like source
files go in a subdirectory of includedir. Support DESTDIR so that
packagers can install to a staging directory and don't have to build
packages as root.

Writing such a flexible makefile is of course nontrivial work that you
don't want to do over and over. You can avoid most of the work by using
Comfignat (https://www.rombobjörn.se/Comfignat/). Comfignat gives you
all of the above, except that limitations in Gnatmake's and GPRbuild's
command line syntax prevent it from automatically supporting LDFLAGS
and GNATBINDFLAGS when libraries are built.

This approach covers only those operating systems that are Unix-like
enough to have Make and basic commands such as cp and mkdir, but that
should include OS X, and hopefully even Windows with Cygwin or MinGW is
Unix-like enough, so it's a decent set of target platforms. (And none
of the above prevents you from also supporting some other platform by
other means.)

Björn Persson

  parent reply	other threads:[~2013-12-11 20:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28 15:41 CPAN style Ada repository banjo
2013-11-29  7:04 ` Thomas Løcke
2013-12-12 10:17   ` Lucretia
2013-12-13  6:54     ` J Kimball
2013-12-13  9:58       ` Lucretia
2013-11-29 19:22 ` Felix Krause
2013-11-29 20:17   ` Simon Wright
2013-11-29 22:53     ` Dennis Lee Bieber
2013-12-09 23:45       ` Yannick Duchêne (Hibou57)
2013-11-29 22:13   ` Jeffrey Carter
2013-11-29 22:15   ` Georg Bauhaus
2013-12-03 18:12     ` Martin
2013-12-03 19:03     ` Randy Brukardt
2013-11-30  1:20   ` Shark8
2013-11-30 13:46   ` gautier_niouzes
2013-11-29 22:07 ` Stephen Leake
2013-11-30 13:12   ` Jacob Sparre Andersen
2013-12-02 17:10     ` Tero Koskinen
2013-12-01  6:36 ` johannes falcone
2013-12-01  7:08   ` Simon Wright
2013-12-01 11:18     ` Brian Drummond
2013-12-01 11:19     ` Brian Drummond
2013-12-01 12:18       ` Jacob Sparre Andersen
2013-12-01  8:24   ` Jacob Sparre Andersen
2013-12-11 20:49 ` Björn Persson [this message]
2013-12-12 16:12   ` Stephen Leake
2013-12-13 11:52     ` darkestkhan
2013-12-13 18:38     ` Björn Persson
2013-12-15  5:40       ` Stephen Leake
2013-12-12  8:23 ` Jacob Sparre Andersen
2013-12-12  9:55   ` Yannick Duchêne (Hibou57)
2013-12-12 10:26     ` Jacob Sparre Andersen
2013-12-12 10:37       ` Brian Drummond
2013-12-12 11:39       ` G.B.
2013-12-12 22:20         ` Jacob Sparre Andersen
2013-12-13  5:43           ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox