Thread overview | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
September 24, 2015 Dub package with C code | ||||
---|---|---|---|---|
| ||||
I have just created bindings for libxlsxwriter, an c library for creating excel files. Used the htod tool to do most of the work, and only had to adjust some things - mainly because libxlsxwriter uses data structures written in macro's. Right now I am making a dub package and I would like to aim for convenience for end-users (read: me). Therefor I decided to include the compiled static library inside the package. I only use Linux 64-bit myself, but this is obviously limiting for other people. The other option I had was to include the whole c code, depend on gcc or clang, and have dub (somehow) first build libxlsxwriter. But that seemed a bit too much... Another option would be to require end-users to build libxlsxwriter themselves. What do you guys recommend? |
September 24, 2015 Re: Dub package with C code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastiaan Koppe | On 24/09/15 2:43 PM, Sebastiaan Koppe wrote:
> I have just created bindings for libxlsxwriter, an c library for
> creating excel files.
>
> Used the htod tool to do most of the work, and only had to adjust some
> things - mainly because libxlsxwriter uses data structures written in
> macro's.
>
> Right now I am making a dub package and I would like to aim for
> convenience for end-users (read: me).
>
> Therefor I decided to include the compiled static library inside the
> package. I only use Linux 64-bit myself, but this is obviously limiting
> for other people.
>
> The other option I had was to include the whole c code, depend on gcc or
> clang, and have dub (somehow) first build libxlsxwriter. But that
> seemed a bit too much...
>
> Another option would be to require end-users to build libxlsxwriter
> themselves.
>
> What do you guys recommend?
Is libxlsxwriter available in the systems package manager?
If so, I would just link against that. Preferably the shared library.
Let e.g. Windows users figure theirs out.
|
September 24, 2015 Re: Dub package with C code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rikki Cattermole | On Thursday, 24 September 2015 at 04:17:14 UTC, Rikki Cattermole wrote: > Is libxlsxwriter available in the systems package manager? Pacman says no. > Let e.g. Windows users figure theirs out. libxlsxwriter is not supported on windows. Which is kind-of funny. |
September 24, 2015 Re: Dub package with C code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastiaan Koppe | On 24/09/15 5:51 PM, Sebastiaan Koppe wrote:
> On Thursday, 24 September 2015 at 04:17:14 UTC, Rikki Cattermole wrote:
>> Is libxlsxwriter available in the systems package manager?
>
> Pacman says no.
>
>> Let e.g. Windows users figure theirs out.
>
> libxlsxwriter is not supported on windows. Which is kind-of funny.
I've taken a look at it.
Why not just port it?
|
September 24, 2015 Re: Dub package with C code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rikki Cattermole | On Thursday, 24 September 2015 at 06:00:50 UTC, Rikki Cattermole wrote:
> On 24/09/15 5:51 PM, Sebastiaan Koppe wrote:
>> On Thursday, 24 September 2015 at 04:17:14 UTC, Rikki Cattermole wrote:
>>> Is libxlsxwriter available in the systems package manager?
>>
>> Pacman says no.
>>
>>> Let e.g. Windows users figure theirs out.
>>
>> libxlsxwriter is not supported on windows. Which is kind-of funny.
>
> I've taken a look at it.
> Why not just port it?
Because I want to focus on the product I am building right now, not on side-projects.
|
September 24, 2015 Re: Dub package with C code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastiaan Koppe | On Thursday, 24 September 2015 at 06:21:02 UTC, Sebastiaan Koppe wrote:
> Because I want to focus on the product I am building right now, not on side-projects.
You could try including the c source in your repo and add preBuildCommands to the dub config which builds the static library. Alternatively you could use reggea to build both.
|
September 24, 2015 Re: Dub package with C code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Edwin van Leeuwen | On Thursday, 24 September 2015 at 08:35:40 UTC, Edwin van Leeuwen wrote: > Alternatively you could use reggea to build both. I want to use dub. Simply because of code.dlang.org. Or can reggae also pull packages from there? > You could try including the c source in your repo and add preBuildCommands to the dub config which builds the static library. preBuildCommands seems to be the way to go. Thank you all. |
September 24, 2015 Re: Dub package with C code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastiaan Koppe | On Thursday, 24 September 2015 at 06:21:02 UTC, Sebastiaan Koppe wrote:
> Because I want to focus on the product I am building right now, not on side-projects.
We should write a C to D converter. We have htod but I'm talking the whole source of it. That might be useful for times like this.
But I have other things to do too...
|
September 24, 2015 Re: Dub package with C code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastiaan Koppe | On Thursday, 24 September 2015 at 02:43:20 UTC, Sebastiaan Koppe wrote:
> I have just created bindings for libxlsxwriter, an c library for creating excel files.
>
> Used the htod tool to do most of the work, and only had to adjust some things - mainly because libxlsxwriter uses data structures written in macro's.
>
> Right now I am making a dub package and I would like to aim for convenience for end-users (read: me).
>
> Therefor I decided to include the compiled static library inside the package. I only use Linux 64-bit myself, but this is obviously limiting for other people.
>
> The other option I had was to include the whole c code, depend on gcc or clang, and have dub (somehow) first build libxlsxwriter. But that seemed a bit too much...
>
> Another option would be to require end-users to build libxlsxwriter themselves.
>
> What do you guys recommend?
nice work!
worth a little blog post on the experience so others can be inspired by and benefit from yours?
|
September 25, 2015 Re: Dub package with C code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastiaan Koppe | On Thursday, 24 September 2015 at 11:38:08 UTC, Sebastiaan Koppe wrote:
> On Thursday, 24 September 2015 at 08:35:40 UTC, Edwin van Leeuwen wrote:
>> Alternatively you could use reggea to build both.
>
> I want to use dub.
>
> Simply because of code.dlang.org. Or can reggae also pull packages from there?
Yes.
Atila
|
Copyright © 1999-2021 by the D Language Foundation