-
Notifications
You must be signed in to change notification settings - Fork 24
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
WIP: Build FLTK from source #118
Conversation
Thank you @MoAlyousef for your patches! Currently able to generate, build and run this module, using the generate stage to fetch and compile FLTK-1.4 from source. However when building as a depedency of another project with I am able to successfully run a project using Either I am missing something with the way that |
@davidovski @MoAlyousef I was considering including fltk repository as a submodule instead of fetching the tip of the branch every time. |
Im not sure what you mean by a submodule. If you mean via git, then I can advise against it, since it seems that when a module is fetched via As far as the current state of this PR goes, it seems that all that is required is for go to automatically run generate before building any module, that way, when including |
I wouldn't count on |
@davidovski , @MoAlyousef I've used your script as a base for implementing similar script in branch: https://github.com/pwiecz/go-fltk/tree/from_source |
Looks good, I haven't got a macos machine to test with either, but I see no alarming reason why it shouldn't work. One small thing that you could do to improve the shell script is to use |
I can check tomorrow to see if it works on macos (technically it should). |
I tried on macos x86_64, the generated cgo_darwin_amd64.go file is this: -n //go:build darwin && amd64
package fltk
// #cgo darwin,amd64 CXXFLAGS: -std=c++11
// #cgo darwin,amd64 CPPFLAGS:
-I${SRCDIR}/include -I${SRCDIR}/include/FL/images -I${SRCDIR}/include/png -I${SRCDIR}/include/zlib -I${SRCDIR}/include/jpeg -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT
-n // #cgo darwin,amd64 LDFLAGS:
${SRCDIR}/lib/darwin/amd64/libfltk_images.a ${SRCDIR}/lib/darwin/amd64/libfltk_jpeg.a ${SRCDIR}/lib/darwin/amd64/libfltk_png.a ${SRCDIR}/lib/darwin/amd64/libfltk_z.a ${SRCDIR}/lib/darwin/amd64/libfltk_gl.a -framework OpenGL ${SRCDIR}/lib/darwin/amd64/libfltk_forms.a ${SRCDIR}/lib/darwin/amd64/libfltk.a -lm -lpthread -framework Cocoa
import "C" Notice the |
@MoAlyousef thanks for teating! |
Manually fixing the output (removing the |
Testing to see if its viable to use the system fltk installation rather than pre-compiled ones. Aiming to find a solution for #117