On 06/08/2011 12:02, Marco Leise wrote:
Am 06.08.2011, 11:16 Uhr, schrieb Jacob Carlborg <[email protected]>:

On 2011-08-05 11:53, Marco Leise wrote:
I have noticed DVM around.
The situation on Gentoo is typically that when there are different
versions of the same package, that can be installed in different
'slots'. A dependency of these packages is a control file for eselect, a
tool to switch between the currently active implementation (OpenJDK, Sun
Java, ...), package version (boost) and several other system
configuration options. 'python' for example ends up as a symlink to
either python2.7 or python3.1 and there are corresponding directory
names for the libraries. It would be ideal if dmd was a symlink to
either dmd1 or dmd2 and they would both use a separate dmd.conf. But
since the source code is available for a while now that should be easy
to make possible.
I have never used DVM, but I imagine it works like Maven or the Eclipse
updater. So it would download precompiled compilers and libraries into
the user's home directory, right? With Gentoo being a source
distribution it is usually avoided to download binaries from the
internet so I guess DVM would be one of two options to install D
compilers on Gentoo. The difference in usage would be like this for an
installation:
dvm: "dvm install 1.068"
portage: "emerge =dmd-1.068"
and this for setting the system-wide default compiler:
dvm use 1.068 -d
eselect dmd set dmd1
Granted, the portage version would only allow one dmd 1 compiler to be
installed at a time, but that is ok for most users. I guess in theory
there could even be slots for every single release of dmd. This is
already done for Boost and automake in practice (with major revisions).
OTOH there is no option to set the compiler for the current shell, but
maybe "export DMD=dmd1", "make posix.mak" should work.

It seems like DVM and portage/eselect are similar. I think it's a huge
advantage to be able to have multiple versions of DMD installed. I use
both D1 and D2, (mostly D1). I also think it's especially useful when
there's almost always something that breaks in a new release of DMD.
Then you can easily go back to an older version if you need to.

BTW, Nick Sabalausky is working on making it possible to install DMD
from github via DVM.

Even if this begins to sound childish, I have to add for completeness
sake that in portage you have the version number 9999 to indicate a
build from online source repositories. So dmd-9999 would be the Github
version. The source tree is cloned into /usr/portage/distfiles/git-src/
and updated each time the package is being reinstalled. Additional tools
like 'smart-live-rebuild' have emerged to make rebuilding changed
repositories easier.

emerge -1 @live-rebuild is very handy for this if you're on the portage alphas.

Reply via email to