Skip to content

rework package to be importable (proof of concept) #4

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

Merged
merged 1 commit into from
Sep 11, 2018
Merged

rework package to be importable (proof of concept) #4

merged 1 commit into from
Sep 11, 2018

Conversation

james-lawrence
Copy link
Contributor

@james-lawrence james-lawrence commented Sep 9, 2018

  • don't mind the top level package name =) just didn't want to type out go-flutter-desktop-embedder
  • moves example into its own folder/package.
  • adds a .build directory that ignores the .so library so cleanup isn't really required.
  • removes the requirement for the user to add the flutter engine .so inside the package.
    but requires that the user of the library provide the load path for the flutter engine.
  • exposes some options and a top level Run function.

after this changes I was able to get my flutter project to load and display. wasn't entirely functional but was a decent POC.

fixes #3

@pchampio
Copy link
Member

pchampio commented Sep 9, 2018

GJ, I like It.
Your example works great.

From what I see, to be able to build or run we have to specify the CGO_LDFLAGS which I am not a big fan. Could it be possible to add at the top of the 'example/stocks/main.go' the cgo ldflags ?
something like

// #cgo linux LDFLAGS: -L${SRCDIR}/flutter/library/linux
import "C"

About the name since this implementation is bound to glfw. Could we name the library flutter-glfw ?

@james-lawrence
Copy link
Contributor Author

not a huge fan of the CGO_LDFLAGS either, I thought about the cgo option as well, though I havent had a chance to test it. might work, still find either solution less than satisfactory as it put requirements on the working directory.

either way, both cases are up to the end user to choose to use, so if it your way works no problem putting it in the example.

as for the name: we should avoid -'s in the name past experience has should those to be problematic/non-obvious when attempting to actually use the package.

@pchampio pchampio self-requested a review September 10, 2018 22:12

import (
// prevents dep from stripping out the c source files in flutter library.
_ "github.com/Drakirus/go-flutter-desktop-embedder/flutter/library"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just learned something new.
Very useful!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useful in this case being a nasty hack because dep does the wrong thing lol

@pchampio
Copy link
Member

I will merge it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

improvements: make this library importable instead of forcing it to be the top level.
2 participants