akiyosi / goneovim

A GUI frontend for neovim.
MIT License
2.4k stars 63 forks source link

Windows x64 build - webengine #62

Closed Hanan-Natan closed 5 years ago

Hanan-Natan commented 5 years ago

Hi,

When trying to build for windows from windows using the command %GOPATH%\bin\qtdeploy build desktop i get the error:

..\..\editor\markdown.go:12:2: build constraints exclude all Go files in E:\WorkFiles\Dev\GoProjects\src\github.com\therecipe\qt\webengine

No i know that Golang's qt implementation has issues with the webengine in Windows. Is there an easy way to opt out from using the webengine? How do you build the Windows releases then?

akiyosi commented 5 years ago

Hi,

You can build by comment-out the source code for the markdown preview feature and using build-constraints.

the following is convert script based on 0.4.0 latest branch.

gsed -i '714s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '715s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '716s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '717s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '718s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '719s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '720s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '721s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '722s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '723s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '724s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '725s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '726s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '727s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i '728s/.*//' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go

gsed -i 's/\(s\.assign\)/\/\/\1/' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i -e 's/\(.*markdown.*\)/\/\/\1/g' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/screen.go
gsed -i -e 's/\(.*markdown.*\)/\/\/\1/g' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/workspace.go
gsed -i -e 's/\(.*Markdown.*\)/\/\/\1/g' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/workspace.go
gsed -i '1s/^/\/\/ +build !windows\n\n/' /Users/akiyoshi/go/src/github.com/akiyosi/gonvim/editor/markdown.go
Hanan-Natan commented 5 years ago

Thanks for the script. In addition to that I had to manually comment lines 756 and 757 at screen.go.

I see more errors but to me it seems to be related to Go's Qt wrapper.

# github.com/therecipe/qt/widgets
widgets-minimal.cpp: In function 'void* QDesktopWidget_Screen(void*, int)':
widgets-minimal.cpp:1905:57: warning: 'QWidget* QDesktopWidget::screen(int)' is deprecated: Use QScreen [-Wdeprecated-declarations]
  return static_cast<QDesktopWidget*>(ptr)->screen(screen);
                                                         ^
In file included from E:/WorkFiles/Dev/Libs/Qt/5.13.0/mingw73_64/include/QtWidgets/QDesktopWidget:1:0,
                 from widgets-minimal.cpp:23:
E:/WorkFiles/Dev/Libs/Qt/5.13.0/mingw73_64/include/QtWidgets/qdesktopwidget.h:77:45: note: declared here
     QT_DEPRECATED_X("Use QScreen") QWidget *screen(int screen = -1);
                                             ^~~~~~
github.com/akiyosi/gonvim/editor
# github.com/akiyosi/gonvim/editor
..\..\editor\locpopup.go:58:19: too many arguments in call to shadow.SetOffset3
        have (number, number)
        want (float64)
..\..\editor\message.go:118:20: too many arguments in call to layout.QLayout.AddWidget
        have (*widgets.QWidget, int, number, number)
        want (widgets.QWidget_ITF)
..\..\editor\message.go:120:20: too many arguments in call to layout.QLayout.AddWidget
        have (*widgets.QLabel, int, number, number)
        want (widgets.QWidget_ITF)
..\..\editor\message.go:127:20: too many arguments in call to shadow.SetOffset3
        have (number, number)
        want (float64)
..\..\editor\miniMap.go:234:13: vqp.M_rect undefined (type *gui.QPaintEvent has no field or method M_rect)
..\..\editor\notification.go:226:20: too many arguments in call to shadow.SetOffset3
        have (number, number)
        want (float64)
..\..\editor\palette.go:69:19: too many arguments in call to shadow.SetOffset3
        have (number, number)
        want (float64)
..\..\editor\popupmenu.go:108:19: too many arguments in call to layout.QLayout.AddWidget
        have (*widgets.QWidget, int, number, number)
        want (widgets.QWidget_ITF)
..\..\editor\popupmenu.go:109:19: too many arguments in call to layout.QLayout.AddWidget
        have (*widgets.QLabel, int, number, number)
        want (widgets.QWidget_ITF)
..\..\editor\popupmenu.go:110:19: too many arguments in call to layout.QLayout.AddWidget
        have (*widgets.QLabel, int, number, number)
        want (widgets.QWidget_ITF)
..\..\editor\popupmenu.go:110:19: too many errors

What do you think? Is it related to the qt implementation? I see similar errors like mentioned here but I'm trying to build on Windows.

BTW I'm using git for windows and it doesn't have gse but sed.

akiyosi commented 5 years ago

I committed to fix those errors. 08e4d06 This should use Qt5.13.0 and the latest therecipe/qt.

Hanan-Natan commented 5 years ago

It works! Thank you!