qt icon indicating copy to clipboard operation
qt copied to clipboard

Example from README doesn't work on non-glibc systems

Open ptrcnull opened this issue 4 years ago • 2 comments

This example:

export GO111MODULE=off; go get -v github.com/therecipe/qt/cmd/... && $(go env GOPATH)/bin/qtsetup test && $(go env GOPATH)/bin/qtsetup -test=false

fails with "no such file or directory" for qmake:

INFO[0001] running: 'qtsetup test linux' [docker=false] [vagrant=false] 
INFO[0001] testing showcases/wallet                     
ERRO[0001] failed to run command                         _func=RunCmd cmd="/home/patrycja/go/src/github.com/therecipe/env_linux_amd64_513/5.13.0/gcc_64/bin/qmake -query QT_INSTALL_PREFIX" dir= env= error="fork/exec /home/patrycja/go/src/github.com/therecipe/env_linux_amd64_513/5.13.0/gcc_64/bin/qmake: no such file or directory" name="query install prefix path for linux on linux"

ptrcnull avatar May 18 '21 13:05 ptrcnull

Hotfix for Alpine Linux:

  • Go to $GOPATH/src/github.com/therecipe/env_linux_amd64_513/5.13.0/gcc_64/bin/
  • Remove following files: qmake, moc
  • Add symlinks from /usr/lib/qt5/bin/ to the removed files (you might need to install the qt5-qtbase-dev package)

ptrcnull avatar May 18 '21 13:05 ptrcnull

Nevermind, running actual apps still doesn't work on musl, because apparently the library needs to download a binary from... who knows where, which doesn't launch:

downloading qtbox => 99%
downloading qtbox => 100%
reading stderr: read |0: file already closed
httpRequest error: ["","","core.QCoreApplication_Instance",""] -> Post "http://127.0.0.1:8000/syncCallIntoLocal": dial tcp 127.0.0.1:8000: connect: connection refused
panic: interface conversion: interface {} is nil, not *core.QCoreApplication

goroutine 1 [running, locked to thread]:
github.com/therecipe/qt/core.QCoreApplication_Instance(...)
	/home/patrycja/go/pkg/mod/github.com/therecipe/[email protected]/core/core.go:8455
github.com/therecipe/qt/widgets.NewQApplication(0x1, 0xc0000121b0, 0x1, 0x1, 0x0)
	/home/patrycja/go/pkg/mod/github.com/therecipe/[email protected]/widgets/widgets.go:4922 +0x125
main.main()

ptrcnull avatar May 18 '21 21:05 ptrcnull