[Poll] On Linux, what should we commonly use as sub-directory name for D?
Marco Leise via Digitalmars-d
digitalmars-d at puremagic.com
Sun Nov 15 22:34:42 PST 2015
Am Wed, 11 Nov 2015 17:24:18 +0000
schrieb Chris Piker <fake at fakeU.edu>:
> On Tuesday, 12 November 2013 at 19:50:32 UTC, Marco Leise wrote:
> > I've seen people use both 'd' and 'dlang' now, so I created a
> > poll. Everyone assembling Linux packages is then free use the
> > results to create a similar experience on all distributions.
> >
> > http://www.easypolls.net/poll.html?p=52828149e4b06cfb69b97527
>
> Has this issued been settled? We are using the dmd compiler on
> CentOS 6. I have a custom plplot.d file that I want to put
> somewhere under our shared /usr/local for our programmers to use.
> If I want to follow some sort of precedent then it looks like my
> choices are:
>
> /usr/local/include/dmd (similar to dmd rpm)
> /usr/local/include
> /usr/local/include/d
> /usr/local/include/dlang
> /usr/local/src
> /usr/local/src/d
> /usr/local/src/dlang
>
> I personally prefer:
>
> /usr/local/src/d
>
> but would like to go with some sort of convention if one is
> starting to gel.
By secret ballot vote in this poll options with "d" in it lost
1:2 to "dlang". As far as I know this was the only real effort
to unify directory names across Linux distributions and at
least two package maintainers (Dicebot for Arch Linux and me
on Gentoo) have used the input from the following discussion
to decide on an import path for the currently active system DMD
compiler:
/usr/include/dlang/dmd
This was after the official DMD package build script
for .rpm/.deb have been created and "D" was renamed to
"Dlang", so the discussion had no influence on their layout.
As far as /usr/local/src goes, I've never seen anything but OS
sources (i.e. Linux kernel) being installed to /usr/src
and /usr/local is conventionally used like /usr, but for
additional local files that are not covered by the generic OS
installation:
https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-filesystem-usr-local.html
As for installing additional Dlang library imports, I advise
to use one subdirectory in /usr/include/dlang for each package
and "parallel version". What I mean by that is that many real
packages change their API over the years, sometimes so
radically that some packages stick with previous versions. One
such example is Gtk, with GIMP still using Gtk 2 and Gnome
being linked against Gtk 3. In such cases you want be able to
include either gtk2 or gtk3. Now if you look at GtkD you see
this reflected in different import paths, namely gtkd-2 and
gtkd-3. Both contain common module paths like gtkc/cairo.d
that would overwrite each other if not put under different
parent directories. And once you have
/usr/include/dlang/dmd
/usr/include/dlang/ldc
/usr/include/dlang/gtkd-2
/usr/include/dlang/gtkd-3
it makes sense to handle other libraries the same way.
In your specific case you may be able to get away with a
single flat import path for everything by allowing only one
version of dmd, GtkD etc., but other distributions will not be
able to follow this scheme. I hope this helps you in your
decision making.
--
Marco
More information about the Digitalmars-d
mailing list