Make dub part of the standard dmd distribution

Nick Sabalausky via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 5 09:45:14 PDT 2015


On 06/01/2015 02:20 AM, Nick Sabalausky wrote:
> On 05/31/2015 11:48 PM, Manu via Digitalmars-d wrote:
>>
>> As for dub, I'd use it if it worked like a package manager; dub get
>> libcurl-d libqt-d zlib-d libsdl2-d etc
>> I have no use for it as a build system, and therefore it's expression
>> of dependencies is no use to me. I just want something that works the
>> same way as '-dev' packages already work perfectly well in linux, that
>> is, they fetch headers and libs, and put them in a standard location
>> that all the tooling can find.
>>
>
> Ditto. Dub's great if you let it be your buildsystem, but as soon as you
> want to use it as a package-manager-only it becomes an uphill battle
> with dub fighting back every step of the way (I speak from experience).
> That problem is worse if your project is a library that you want
> fetchable through dub.
>
> That's why I've been working on some PRs to fix all that. The first step
> is here (building/expanding on a flag another contributer recently added):
>
> https://github.com/D-Programming-Language/dub/pull/572
>
> (Although I think I may need to change --data=libs and separate system
> libs from dependency libs since linkers expect those to be passed in
> differently.)
>
> The next step will be to add a flag to have that data get output in a
> compiler-ready argument list (your choice of compiler, of course).
> That'll let you do something comparable to "pkg-config --cflags --libs".
>

All the above is now included in the PR:

https://github.com/D-Programming-Language/dub/pull/572

Working example:

------------------------------
$ cd /home/nick/proj/dub

$ dub describe --data=main-source-file --data=options \
--data=versions --data=import-paths
'/home/nick/proj/dub/source/app.d' -debug -g -w -version=DubUseCurl 
-version=Have_dub '-I/home/nick/proj/dub/source/'

$ dub describe --compiler=ldc --data=options --data=versions
-d-debug -g -w -oq -od=.dub/obj -oq -od=.dub/obj -d-version=DubUseCurl 
-d-version=Have_dub

$ dub describe --data-list --data=options --data=versions
debugMode
debugInfo
warningsAsErrors

DubUseCurl
Have_dub
------------------------------

Of course, "dub describe --help" for the full list of options.

Only thing not included yet is this:

> Then finally, a shortcut flag so you can just do something kinda like:
>
> rdmd --build-only `dub describe --cmdargs=rdmd` src/main.d
>
> And all your dependencies will be properly referenced (-I..., linker
> flags, etc).
>



More information about the Digitalmars-d mailing list