Open mlb5000 opened 8 years ago
And if I just run go get github.com/sourcegraph/webloop/...
I get
# github.com/gotk3/gotk3/gtk
could not determine kind of name for C.gtk_application_get_actions_for_accel
could not determine kind of name for C.gtk_application_get_menu_by_id
could not determine kind of name for C.gtk_application_prefers_app_menu
Do you have a recommended Linux configuration for this?
Same issue here on Ubuntu 15.10, I receive the gcc errors when I run go get github.com/sourcegraph/webloop/...
This will be fixed if https://github.com/sourcegraph/go-webkit2/pull/32 gets merged
sourcegraph/go-webkit2#32 is merged by now and I'm able to successfully build go-webkit2. But building webloop throws same error:
$ go install -tags gtk_3_14 github.com/sourcegraph/webloop/...
# github.com/sourcegraph/webloop/cmd/static-reverse-proxy
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-934973757/000009.o: In function `removeClosure':
/tmp/go-build/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:18: multiple definition of `removeClosure'
/tmp/go-link-934973757/000001.o:/tmp/go-build/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:18: first defined here
/tmp/go-link-934973757/000009.o: In function `goMarshal':
/tmp/go-build/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:35: multiple definition of `goMarshal'
/tmp/go-link-934973757/000001.o:/tmp/go-build/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:35: first defined here
collect2: error: ld returned 1 exit status
# github.com/sourcegraph/webloop/examples/angular-static-seo
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-099896313/000009.o: In function `removeClosure':
/tmp/go-build/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:18: multiple definition of `removeClosure'
/tmp/go-link-099896313/000001.o:/tmp/go-build/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:18: first defined here
/tmp/go-link-099896313/000009.o: In function `goMarshal':
/tmp/go-build/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:35: multiple definition of `goMarshal'
/tmp/go-link-099896313/000001.o:/tmp/go-build/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:35: first defined here
collect2: error: ld returned 1 exit status
Running Debian 8.6 (Wheezy)
~Probably related to upstream: gotk3/gotk3#116~
I found that old gotk3
path is used in webloop
while newer one is used in go-webkit2
. So two copies of gotk3
were built causing this 'multiple definition' error. Build passes successfully once import path is fixed.
diff --git a/example_test.go b/example_test.go
index e93d5c1..20e2e8a 100644
--- a/example_test.go
+++ b/example_test.go
@@ -5,7 +5,7 @@ import (
"os"
"runtime"
- "github.com/conformal/gotk3/gtk"
+ "github.com/gotk3/gotk3/gtk"
"github.com/sourcegraph/webloop"
)
diff --git a/static_renderer.go b/static_renderer.go
index 3ecb797..720c86c 100644
--- a/static_renderer.go
+++ b/static_renderer.go
@@ -8,7 +8,7 @@ import (
"sync"
"time"
- "github.com/conformal/gotk3/gtk"
+ "github.com/gotk3/gotk3/gtk"
)
// StaticRenderer generates and returns static HTML based on a snapshot of a Web
diff --git a/webloop.go b/webloop.go
index a326681..4a65fdf 100644
--- a/webloop.go
+++ b/webloop.go
@@ -3,7 +3,7 @@ package webloop
import (
"errors"
- "github.com/conformal/gotk3/glib"
+ "github.com/gotk3/gotk3/glib"
"github.com/sourcegraph/go-webkit2/webkit2"
"github.com/sqs/gojs"
)
diff --git a/webloop_test.go b/webloop_test.go
index 4646897..a8100a1 100644
--- a/webloop_test.go
+++ b/webloop_test.go
@@ -7,7 +7,7 @@ import (
"runtime"
"testing"
- "github.com/conformal/gotk3/gtk"
+ "github.com/gotk3/gotk3/gtk"
)
func init() {
Note, OSX needs both of these packages
brew install gtk+ gtk+3
And the missing-from-brew javascriptcoregtk as well:
# pkg-config --cflags javascriptcoregtk-3.0
Package javascriptcoregtk-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `javascriptcoregtk-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'javascriptcoregtk-3.0' found
pkg-config: exit status 1
Thanks @akabos and @canuckfan772
Finally got it working. I had to apt-get install libwebkit2gtk-4.0-dev
instead of libwebkit2gtk-3.0-dev
. Fixed import paths. And finally was able to build using tags as suggested in https://github.com/gotk3/gotk3/issues/152.
I am running
libgtk 3.12
in Ubuntu 14.04 and get the following when I dogo get -tags gtk_3_12 github.com/sourcegraph/webloop/...