Gentoo Ebuilds
The DMD and GDC D compilers are already in the portage tree:
# emerge dmd-bin # USE="d" emerge gcc
but they use the standard phobos library and they are not frequently updated. If you'd like to use the Tango standard library and the latest compiler versions instead, you'll need to use the overlay.
Instructions
If you're new to overlays, no problem. Setting up one is quite simple. First, we emerge layman, an overlay manager that will take care of all the minor details of using overlays.
# emerge layman
Once that's done, add the overlay that contains the D ebuilds. You'll need to add this line to your /etc/layman/layman.cfg in 'overlays' section: http://www.assembla.com/spaces/d-overlay/documents/cz9H9wXLqr3B6oab7jnrAJ/download/local-layman-list.xml
Then update list of overlays.
layman -L
And add the overlay.
# layman -a d-overlay
If this is your first overlay, you also need to add a line to your make.conf:
# echo "source /usr/local/portage/layman/make.conf" >> /etc/make.conf
Your overlay is all setup! Just emerge your favourite compiler and tango with the corresponding USE-flag to get going:
# USE="dmd" emerge dmd tango
or alternatively (for a more permanent solution):
# echo "dev-libs/tango dmd" >> /etc/portage/package.use # emerge tango
Notes
- dmd.conf is currently broken: Bug, so you'll not find an /etc/dmd.conf.
- You can have tango, phobos and both dmd versions installed at the same time. Configuring is done using shell script /usr/bin/dmd which is maintained by eselect. To list options: $ eselect dmd list. To set the default compiler and library: $ eselect dmd set dmd1-tango. You can always run these scripts without making them default: $ dmd2-phobos d2test.d. If eselect doesn't show all the options check whether the appropriate compiler version and library are installed.
- Tango is currently unavailable for GDC on Gentoo.
- You can use /usr/bin/dmd1.bin or /usr/bin/dmd2.bin if you want to use the raw DMD - i.e. without any standard libraries (such as Phobos or Tango).