-
Notifications
You must be signed in to change notification settings - Fork 282
How to automatically copy external dynamic library or framework to build folder #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's kinda the same issue as #203 Since we are using the golang tool-chain to generate apps (hover, at it's core, is wrapping It's is currently impossible to have a plugin copy dlib in the outputs/OS/ directory. (As a big workaround for plugin dev you can use: |
What we can have is a dlib/{linux, darwin, windows} folder in the plugin dir (i.e.: https://github.com/befovy/fijkplayer/tree/master/go/dlib/linux) That is the best I can thinks of. @jld3103 what do you think? |
BTW, awesome the see someone building a plugin! |
@pchampio I think that would be the best solution. But the problem is, that it looks like the file needs to be copied into the |
Humm, I don't think it works like that. $ pwd
~/lab/flutter/go-flutter-example/draggable_borderless/go/build/outputs/darwin
$ ls
assets draggable_borderless flutter_assets FlutterEmbedder.framework IJKPlayer.framework icudtl.dat
Exactly, but for plugin, the dlib will need to be copied from |
Thanks the answer from all of you.
Yes, I want output like above. @pchampio And, I also thinks But it seems it dose not work. BTW, I'm using rpath ldflags Is "rpath ldfalgs" a good way when I finished the plugin and want to publish it? |
The implementation hasn't been coded yet^^ And rpath overwrite shouldn't be necessary once we have the auto copy of dlib |
If someone wants to work on this, here is how this feature should be implemented:
Edit: added 4th point |
Please assign this issue to me. I will make a pull request in this week. |
@pchampio |
Maybe prefix the file with the plugin name (do it always for consistency) |
I don't thinks we can rename share libs without having to rename the CGO import (i.e.: PS: I'm not sure how renaming libs affect import. |
Fixed by go-flutter-desktop/hover#59 |
Flutter version
[✓] Flutter (Channel beta, v1.10.7, on Mac OS X 10.14.6 18G95, locale zh-Hans-CN)
Plugin version
I'm developing a new plugin.
Go.mod file
plugin go.mod
example go.mod
Steps to Reproduce
I used cgo in my plugin
cgo link a framework
It can compile. But framework can not be found when run
If I copy IJKPlayer.framework to
/Users/befovy/Flutter/fijkplayer/example/./go/build/outputs/darwin
andcd
/Users/befovy/Flutter/fijkplayer/example/./go/build/outputs/darwin
, double click the binary filefijkplayer_example
, it run successfully.Every time I run
hover run
,IJKPlayer.framework
which I have copied to/Users/befovy/Flutter/fijkplayer/example/./go/build/outputs/darwin
will be deleted.Is there a way to copy files to the build output folder atomically ? Thanks
The text was updated successfully, but these errors were encountered: