Thread overview
dub repository for a C binding
Oct 09, 2013
Sebastian Graf
Oct 10, 2013
Mike Parker
Oct 10, 2013
Rikki Cattermole
Oct 11, 2013
Sebastian Graf
Oct 11, 2013
Sönke Ludwig
Oct 15, 2013
Sebastian Graf
Oct 11, 2013
Sebastian Graf
Oct 15, 2013
Sebastian Graf
Oct 15, 2013
Sönke Ludwig
October 09, 2013
Hi,

how would I create a dub repository for a ready-to-use C binding + pre-compiled binaries?
Doesn't have to distinguish between platforms for now, but I would appreciate it nonetheless.

I aim to then simply reference it in my actual D project, preferably using dub ofc.

Thanks!
October 10, 2013
On 10/10/2013 2:12 AM, Sebastian Graf wrote:
> Hi,
>
> how would I create a dub repository for a ready-to-use C binding +
> pre-compiled binaries?
> Doesn't have to distinguish between platforms for now, but I would
> appreciate it nonetheless.
>
> I aim to then simply reference it in my actual D project, preferably
> using dub ofc.
>
> Thanks!

By "precompiled binaries" I assume you're referring to the C library. AFAIK, dub can't help you with that. dub is a build tool that can help you manage your source-level dependencies, but it's not a full on package manager. You'll have to package the binaries as a separate download. As for the rest, add a package.json and register at code.dlang.org.
October 10, 2013
On Wednesday, 9 October 2013 at 17:12:14 UTC, Sebastian Graf wrote:
> Hi,
>
> how would I create a dub repository for a ready-to-use C binding + pre-compiled binaries?
> Doesn't have to distinguish between platforms for now, but I would appreciate it nonetheless.
>
> I aim to then simply reference it in my actual D project, preferably using dub ofc.
>
> Thanks!

Take a look at copyFiles option. It copies files e.g. dll's into the bin directory when compiled. Although keep an option available in e.g. a subpackage that does not do this.

For more information on what dub can do look at http://code.dlang.org/package-format.
October 11, 2013
On Thursday, 10 October 2013 at 01:51:09 UTC, Rikki Cattermole wrote:
>
> Take a look at copyFiles option. It copies files e.g. dll's into the bin directory when compiled. Although keep an option available in e.g. a subpackage that does not do this.
>
> For more information on what dub can do look at http://code.dlang.org/package-format.

And how would I go about the import lib? I have to somehow feed it into the compiler, preferably automatically when referencing the (sub-)package.
October 11, 2013
Am 11.10.2013 11:25, schrieb Sebastian Graf:
> On Thursday, 10 October 2013 at 01:51:09 UTC, Rikki Cattermole wrote:
>>
>> Take a look at copyFiles option. It copies files e.g. dll's into the bin directory when compiled. Although keep an option available in e.g. a subpackage that does not do this.
>>
>> For more information on what dub can do look at http://code.dlang.org/package-format.
> 
> And how would I go about the import lib? I have to somehow feed it into the compiler, preferably automatically when referencing the (sub-)package.

Right now you have to use the "sourceFiles" field for that. Later it should be possible to set a library search path + library name instead. Example: https://github.com/s-ludwig/dlibgit/blob/master/package.json
October 11, 2013
On Friday, 11 October 2013 at 09:25:58 UTC, Sebastian Graf wrote:
> On Thursday, 10 October 2013 at 01:51:09 UTC, Rikki Cattermole wrote:
>>
>> Take a look at copyFiles option. It copies files e.g. dll's into the bin directory when compiled. Although keep an option available in e.g. a subpackage that does not do this.
>>
>> For more information on what dub can do look at http://code.dlang.org/package-format.
>
> And how would I go about the import lib? I have to somehow feed it into the compiler, preferably automatically when referencing the (sub-)package.

Nevermind, I'll see how far I get with dynamically loaded derelict binding.
October 15, 2013
On Friday, 11 October 2013 at 10:57:38 UTC, Sönke Ludwig wrote:
> Am 11.10.2013 11:25, schrieb Sebastian Graf:
>> On Thursday, 10 October 2013 at 01:51:09 UTC, Rikki Cattermole wrote:
>>>
>>> Take a look at copyFiles option. It copies files e.g. dll's into the
>>> bin directory when compiled. Although keep an option available in e.g.
>>> a subpackage that does not do this.
>>>
>>> For more information on what dub can do look at
>>> http://code.dlang.org/package-format.
>> 
>> And how would I go about the import lib? I have to somehow feed it into
>> the compiler, preferably automatically when referencing the (sub-)package.
>
> Right now you have to use the "sourceFiles" field for that. Later it
> should be possible to set a library search path + library name instead.
> Example: https://github.com/s-ludwig/dlibgit/blob/master/package.json

Thanks, that's what I do now for copying the libraries into the bin directory.

October 15, 2013
On Friday, 11 October 2013 at 10:57:56 UTC, Sebastian Graf wrote:
> On Friday, 11 October 2013 at 09:25:58 UTC, Sebastian Graf wrote:
>> On Thursday, 10 October 2013 at 01:51:09 UTC, Rikki Cattermole wrote:
>>>
>>> Take a look at copyFiles option. It copies files e.g. dll's into the bin directory when compiled. Although keep an option available in e.g. a subpackage that does not do this.
>>>
>>> For more information on what dub can do look at http://code.dlang.org/package-format.
>>
>> And how would I go about the import lib? I have to somehow feed it into the compiler, preferably automatically when referencing the (sub-)package.
>
> Nevermind, I'll see how far I get with dynamically loaded derelict binding.

This works surprisingly well. I uploaded my derelict binding on github: https://github.com/sgraf812/DerelictUdis86.git
Where else should I announce this?
October 15, 2013
Am 15.10.2013 22:11, schrieb Sebastian Graf:
> On Friday, 11 October 2013 at 10:57:56 UTC, Sebastian Graf wrote:
>> On Friday, 11 October 2013 at 09:25:58 UTC, Sebastian Graf wrote:
>>> On Thursday, 10 October 2013 at 01:51:09 UTC, Rikki Cattermole wrote:
>>>>
>>>> Take a look at copyFiles option. It copies files e.g. dll's into the
>>>> bin directory when compiled. Although keep an option available in
>>>> e.g. a subpackage that does not do this.
>>>>
>>>> For more information on what dub can do look at
>>>> http://code.dlang.org/package-format.
>>>
>>> And how would I go about the import lib? I have to somehow feed it
>>> into the compiler, preferably automatically when referencing the
>>> (sub-)package.
>>
>> Nevermind, I'll see how far I get with dynamically loaded derelict
>> binding.
>
> This works surprisingly well. I uploaded my derelict binding on github:
> https://github.com/sgraf812/DerelictUdis86.git
> Where else should I announce this?

Register an account on code.dlang.org and click on "Manage my packages" below the package list to add your repository (the UI is a bit crude right now but will be improved soon).