www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Using DUB packages with Meson

reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
I'm trying to use my new DUB package from Photon, which is 
polyglot project and is built with Meson.

Have anyone worked with DUB packages in Meson? I've found this 
bit of documentation:
https://mesonbuild.com/Dependencies.html#dub

And I did fetch & build but I do not understand how to introduce 
library dependency on a specific DUB package.

--
Dmitry Olshansky
Apr 12 2023
next sibling parent reply "Richard (Rikki) Andrew Cattermole" <richard cattermole.co.nz> writes:
I'm going to guess that you need to use the version specifier in the 
package name. Because I'm not seeing anything there to handle it 
specifically.

https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/dub.py

i.e. ``dub build [<package>[ <version-spec>]] [<options...>]``

So use ``package:sub 1.0.2``.

Also I just noticed meson doesn't support shared libraries from dub, so 
something to keep in mind.
Apr 12 2023
next sibling parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Wednesday, 12 April 2023 at 10:24:48 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
 I'm going to guess that you need to use the version specifier 
 in the package name. Because I'm not seeing anything there to 
 handle it specifically.

 https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/dub.py

 i.e. ``dub build [<package>[ <version-spec>]] [<options...>]``

 So use ``package:sub 1.0.2``.

 Also I just noticed meson doesn't support shared libraries from 
 dub, so something to keep in mind.
Oh, Rikki, you are so helpful. Thanks! -- Dmitry Olshansky
Apr 12 2023
prev sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Wednesday, 12 April 2023 at 10:24:48 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
 I'm going to guess that you need to use the version specifier 
 in the package name. Because I'm not seeing anything there to 
 handle it specifically.

 https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/dub.py

 i.e. ``dub build [<package>[ <version-spec>]] [<options...>]``

 So use ``package:sub 1.0.2``.

 Also I just noticed meson doesn't support shared libraries from 
 dub, so something to keep in mind.
I'm getting closer. I'm stuck with this at the moment: Found DUB: /home/d.olshanskiy/bin/dub (DUB version 1.31.1, built on Mar 12 2023) ERROR: strand found but it wasn't compiled with ldc Run-time dependency strand found: NO src/meson.build:22:0: ERROR: Dependency "strand" not found -- Dmitry Olshansky
Apr 12 2023
parent reply "Richard (Rikki) Andrew Cattermole" <richard cattermole.co.nz> writes:
Did you compile the library with dub using ldc2?
Apr 12 2023
parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Wednesday, 12 April 2023 at 11:07:56 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
 Did you compile the library with dub using ldc2?
Yup, I do not have other compilers installed. -- Dmitry Olshansky
Apr 12 2023
prev sibling parent reply Denis Feklushkin <feklushkin.denis gmail.com> writes:
On Wednesday, 12 April 2023 at 10:06:22 UTC, Dmitry Olshansky 
wrote:
 And I did fetch & build
What are possible ways to automate such download? Meson knows exactly which versions of packages suit to build. Is it possible, for example, to get somehow packages list and then download using dub fetch?
Apr 27 2023
parent reply "Richard (Rikki) Andrew Cattermole" <richard cattermole.co.nz> writes:
On 28/04/2023 1:43 AM, Denis Feklushkin wrote:
 On Wednesday, 12 April 2023 at 10:06:22 UTC, Dmitry Olshansky wrote:
 And I did fetch & build
What are possible ways to automate such download? Meson knows exactly which versions of packages suit to build. Is it possible, for example, to get somehow packages list and then download using dub fetch?
On dubs end yes, and yes. $ dub build package version ``` $ dub search knocker ==== registry at https://code.dlang.org/ (fallbacks registry at https://codemirror.dlang.org/, registry at https://dub.byt ecraft.nl/, registry at https://code-mirror.dlang.io/) ==== knocker (1.0.3) Knocks on ports to open up another. Compatible with Knockd. ``` You can also get the entire manifest from dub-registry directly if you want it (you shouldn't need it).
Apr 27 2023
parent Denis Feklushkin <feklushkin.denis gmail.com> writes:
On Thursday, 27 April 2023 at 20:48:45 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
 On 28/04/2023 1:43 AM, Denis Feklushkin wrote:
 On Wednesday, 12 April 2023 at 10:06:22 UTC, Dmitry Olshansky 
 wrote:
 And I did fetch & build
What are possible ways to automate such download? Meson knows exactly which versions of packages suit to build. Is it possible, for example, to get somehow packages list and then download using dub fetch?
On dubs end yes, and yes. $ dub build package version
I guess I didn't express myself that way How to get list of packages that can be passed to DUB by this way as above?
Apr 28 2023