Debian packages for D libraries

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Oct 3 10:20:50 PDT 2012


On Wed, Oct 03, 2012 at 04:57:24PM +0200, Thomas Koch wrote:
[...]
> I already asked on D.learn without much response[1]. I'm just starting
> to learn D (coming from Pascal, PHP, Java) and it feels hard to get
> started without a single D library packaged in Debian. So I thought we
> could start getting the libraries from the google code apt repo into
> official Debian[2].

The standard library should be already packaged. But yeah, it would be
nice to have other libraries available.


[...]
> The open issues seem to be:
> 
> - Where do header files go? see thread in this group: "I think we need
> to standardize where D headers are to be installed"

Until that's decided, I think /usr/include/d is a good place to start.
So we'd have /usr/include/d/core/, /usr/include/d/std/, etc..

To support incompatible library versions, we can have different
druntime/Phobos versions in subdirs (e.g. /usr/include/d/2.060/core/,
/usr/include/d/2.060/std/, etc.) and use the alternatives system to
symlink the standard headers into /usr/include/d/. Different compiler
releases can then look in specific version subdirs if they require a
specific version of Phobos.


> - Where do shared libraries go?

Right now Phobos doesn't even produce shared libs. I think it should be
safe to put them in /usr/lib, because D has its own name manglings and
we *are* supposed to be able to link C/C++ to D directly anyway.


> - Does it matter which compiler produced a shared library? If so, how
> to deal with it? It would be possible to compile d libraries when the
> user installs them for every D compiler present on the system. A
> similar thing is done for emacs lisp files.

Libraries produced by gdc, AFAIK, should be binary compatible with other
C/C++ code compiled by gcc and derivatives. I'm not sure about cross
compatibility with dmd, though.


> - Yes, dmd could perfectly be put in Debian non-free. GDC and DMD
> should both provide the virtual package name "d-compiler". Debians
> alternatives system can then be used to manage a symbolic link called
> "d-compiler"(?) to point to either dmd, gdc or anything else.

I'm kinda on the fence about this one, mainly because dmd and gdc have
different command-line syntaxes. Yes gdc has a compatibility mode, but
that's not its "native" syntax. Ideally the symlink should point to
executables that have more-or-less the same command-line syntax. It
would suck if build scripts start failing just because you updated the
symlink to a different compiler.


> I don't think that some random apt repo on google code is a proper
> alternative to having D libraries in official Debian. I wouldn't like
> to add the gpg key of a random site to my apt keyring.
>
> I'm a Debian Maintainer, still unexperienced with C/C++/D library
> stuff but maybe I could help a bit.

I'm willing to sponsor uploads if somebody has the time to work with the
packaging. :)


T

-- 
Two wrongs don't make a right; but three rights do make a left...


More information about the Digitalmars-d mailing list