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. If you'd like to use the Tango standard library 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. If you already have layman installed, just add the 'd' overlay.
# emerge layman
Once that's done, add the overlay that contains the D ebuilds:
# layman -a d
If this is your first overlay, you also need to add a line to your make.conf:
# echo "source /usr/portage/local/layman/make.conf" >> /etc/make.conf
Your overlay is all setup! Just emerge dmd-bin with the 'tango' USE flag to get going:
# USE="tango" emerge dmd-bin
or alternatively (for a more permanent solution):
# echo "dev-lang/dmd-bin tango" >> /etc/portage/package.use # emerge dmd-bin
Notes
- dmd.conf is currently broken: Bug, so you'll not find an /etc/dmd.conf. Edit /opt/dmd/bin/dmd instead which is actually a shell script to pass appropriate compiler options. Note that once you emerge tango, everything is automatically setup to use Tango by default so you needn't edit anything unless you really know what you are doing and want some advanced DMD options.
- Tango is currently unavailable for GDC on Gentoo. The ebuild contains the options for it, but I am currently waiting for approval from the GCC maintainers :)
- You can use /opt/dmd/bin/dmd.bin if you want to use the raw DMD - i.e. without any standard libraries (such as Phobos or Tango).












