roc-streaming / roc-go

Golang bindings for Roc Toolkit.
https://roc-streaming.org
MIT License
21 stars 10 forks source link

Take headers and lib from pkg-config #4

Closed Asalle closed 1 year ago

Asalle commented 4 years ago

Currently we have hardcoded /usr/lib/roc path that is not always where you have your headers/lib. Let's take that info from pkg-config.

gavv commented 4 years ago

I've updated https://github.com/roc-project/roc/issues/271

Asalle commented 4 years ago

Can you add a label "blocked" or "camping"? Or can you give me the permissions to add tags? :3

gavv commented 4 years ago

Hm, I don't see such a permission in settings.

Probably it's better to user projects for that? Like we do it in core: https://github.com/roc-project/roc/projects/2

I've enabled projects for the repo, you can try it (do you have permissions?). Or I can just create the label, I'm OK with that too.

Asalle commented 4 years ago

Have no permissions to add a label, also I don't see the board. But no worries, I don't need it too much!

On Sun, Dec 15, 2019, 7:36 PM Victor Gaydov notifications@github.com wrote:

Hm, I'm don't see such a permission in settings.

Probably it's better to user projects for that? Like we do it in core: https://github.com/roc-project/roc/projects/2

I've enabled projects for the repo, you can try it (do you have permissions?). Or I can just create the label, I'm OK with that too.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/roc-project/roc-go/issues/4?email_source=notifications&email_token=ABF6TYRK6YJILIVQUY73NRDQYZ2MBA5CNFSM4JLIWN22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG47JRY#issuecomment-565834951, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF6TYRHA3VD66XO3SKPDLLQYZ2MBANCNFSM4JLIWN2Q .

gavv commented 4 years ago

Have no permissions to add a label, also I don't see the board.

Not good. I've selected a different permission level (triage -> write) for the go team, could you check now?

Asalle commented 4 years ago

works! thanks

gavv commented 4 years ago

.pc generation & installation landed in develop branch. scons install will now install roc.pc.

cc @fusuiyi123

Asalle commented 4 years ago

Yay! We can start using it in go bindings!

On Fri, May 15, 2020, 8:37 AM Victor Gaydov notifications@github.com wrote:

.pc generation & installation landed in develop branch. scons install will now install roc.pc.

cc @fusuiyi123 https://github.com/fusuiyi123

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/roc-project/roc-go/issues/4#issuecomment-629057753, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF6TYTT6DIYXP66HGILXLDRRTPLFANCNFSM4JLIWN2Q .

Asalle commented 4 years ago

now that I've looked into it, is this feature relevant? The only place where we use the C includes are comments like

/*
#include <roc/address.h>
*/
import "C"

which work regardless if one uses pkg-config or just installed them with their distribution's package manager.

gavv commented 4 years ago

If the user installed roc into a prefix which is not in default include or library search path list, compilation will fail. pkg-config will solve this issue.

A real-world examples. When you're using SoX library you should write:

#include <sox.h>

On most distros, sox.h is located at /usr/include/sox.h and include works without any pkg-config.

However, on some CentOS version, for some reason maintainers decided to install that file at /usr/include/sox/sox.h. On those CentOS systems pkg-config for SoX returns -I/usr/include/sox. If you're using pkg-config, everything works, but without it your include fails.

So yes, we still need pkg-config, though it's not critical.

Note that pkg-config generation is currently available only in develop, while bindings are using master.

gavv commented 4 years ago

Example of using pkg-config with cgo: https://github.com/aam335/speexdsp/blob/master/speexdsp.go#L4

Asalle commented 3 years ago

cool, then I'll test it locally with develop, push to a branch and create a pr later when the changes will be available on master (they are still not there as of now)

gavv commented 3 years ago

We'll also need to migrate bindings to new api from 0.2.

gavv commented 3 years ago

I guess we need a separate issue and branch for that.

Asalle commented 3 years ago

@gavv did you release 0.2 already? cannot find it anywhere

gavv commented 3 years ago

@Asalle Hi, no, 0.2 isn't released yet. It's still in the develop branch. The API of 0.2 is mostly stabilized; it will be changed a bit before final release, but I expect only minor changes. So I think we can start migration of bindings to 0.2, maybe in a separate branch (maybe also call it develop for convenience).