gentoo / dlang

[MIRROR] D programming language ebuild repository

Home Page:https://gitweb.gentoo.org/repo/user/dlang.git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

explanation of useflags

Alessandro-Barbieri opened this issue · comments

Why are needed these useflags?
I have to choose one of them, which?

equery u ldc2
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for dev-lang/ldc2-1.2.0:
 U I
 - - dmd-2_068 : <unknown>
 - - dmd-2_069 : <unknown>
 - - dmd-2_070 : <unknown>
 - - dmd-2_071 : <unknown>
 - - dmd-2_072 : <unknown>
 - - dmd-2_073 : <unknown>
 - - dmd-2_074 : <unknown>
 - - gdc-4_9_4 : <unknown>
 - - ldc2-0_17 : <unknown>
 - - ldc2-1_0  : <unknown>
 - - ldc2-1_1  : <unknown>
 - - ldc2-1_2  : <unknown>

equery is a bit buggy with global USE flags from overlays. Try euse -i dmd-2_074 for now. Basically it will say "Build for [compiler]". In case of ldc2 it would be more correct to say "Build with [compiler]". For a while now, Dlang compilers are written in Dlang and thus can't be compiled by g++ any more. That made it necessary to pull in another Dlang compiler to bootstrap and that's what the flags do. For libraries like "GtkD" they work very similar to the so called USE-expand variables that you see for Python or Ruby packages. You can select more than one and build that library for several compilers at once. The short version of the story is that practically every Dlang compiler and version is incompatible with each other, so to build software like "Tilix" that depends on GtkD, you need to be specific about the compiler and version you want to use for both GtkD an Tilix. If you were to compile GtkD with dmd-2.073 and Tilix with dmd-2.074 it would likely break, so compiling Tilix on Gentoo with compiler X requires that compiler X is also enabled on GtkD. (See also: https://wiki.gentoo.org/wiki/Dlang)

ldc2-0_17 would be a good choice here, because it doesn't require an already installed Dlang compiler, so you'll "only" need to emerge ldc2-0.17.4 + ldc2-1.2.0. If you wish you can then emerge ldc2-1.2.0 with the ldc2-1_2 USE flag to build it with itself, just like some people emerge gcc after a gcc upgrade to make use of the latest optimizations.

Alternatively you can set one of the dmd-* USE flags for ldc2 (it doesn't really matter which one) and set no compiler USE flag for dmd itself. On Linux and FreeBSD, that will self-host dmd using binaries provided by the dmd developers and then build ldc2 with that. Keep in mind that dmd's optimizer isn't great, but its compilation speed is unrivaled. So if you plan to use ldc2 often, it makes sense to build it with itself eventually.

gdc-* is also listed, but not supported by ldc2. If you use that, the configure script will bail out and tell you exactly that. I have not modeled an exclusion for specific compiler brands in the overlay though, so that's why it shows up.

Thanks for the explanation!