therecipe / qt

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
GNU Lesser General Public License v3.0
10.49k stars 748 forks source link

Fails to install on FreeBSD #1163

Open probonopd opened 4 years ago

probonopd commented 4 years ago

Fails to install on FreeBSD 12.1-RELEASE-p8 with its Qt 5.13.0 pkg.

With some cude workarounds I can get it to run:

user@FreeBSD$ export QT_DIR=/usr/local/lib/qt5/
user@FreeBSD$ /home/user/go/bin/qtsetup test

INFO[0000] running: 'qtsetup test freebsd' [docker=false] [vagrant=false] 
INFO[0000] testing showcases/wallet                     
ERRO[0001] failed to run command                         _func=RunCmd cmd="/usr/local/lib/qt5/5.13.0/gcc_64/bin/rcc -project -o /home/user/go/src/github.com/therecipe/qt/internal/examples/showcases/wallet/assets/rcc.qrc" dir=/home/user/go/src/github.com/therecipe/qt/internal/examples/showcases/wallet/assets/qml env= error="fork/exec /usr/local/lib/qt5/5.13.0/gcc_64/bin/rcc: no such file or directory" name="execute rcc *.qrc on freebsd for freebsd"

Crude workaround:

su
cd /usr/local/lib/qt5/
mkdir 5.13.0
cd 5.13.0/
ln -s ../ gcc_64

Then I ran into:

error="open /usr/local/include/QtCore/qabstractitemmodel.h: no such file or directory"

Crude workaround:

su
cd /usr/local/include
ln -s qt5/Q* .

Then I ran into:

cp: /usr/local/qml: No such file or directory

Crude workaround:

su
cd /usr/local/
ln -s lib/qt5/qml .

Then I ran into:

cp: /usr/local/qml: No such file or directory

Crude workaround:

su
cd /usr/local/
ln -s lib/qt5/plugins .

Now the tests compile (e.g., I can see the calculator and textedit), but the deployment is broken

WARN[0285] couldn't find/home/user/go/src/github.com/therecipe/qt/internal/examples/qml/gallery/deploy/freebsd/lib/libQt5Core.so.5  error="open /home/user/go/src/github.com/therecipe/qt/internal/examples/qml/gallery/deploy/freebsd/lib/libQt5Core.so.5: no such file or directory"

How can the need for the crude workarounds be removed and the deployment be fixed?

therecipe commented 4 years ago

Hey

To get this working on FreeBSD you will just need to export QT_PKG_CONFIG=true before running qtsetup/qtdeploy. Maybe take a look here.

But beware, sometimes the package manager's Qt "html-doc" package (which is needed to generate the binding) is quite different from the "official" one the binding is tested against, in that case you will also need to export something like QT_API=5.13.0 before running qtsetup/qtdeploy.

probonopd commented 4 years ago

Thank you very much. Do you think this could be added to https://github.com/therecipe/qt#installation? Would have helped me a tremendous lot.

devosalain commented 4 years ago

Thanks for the info probonopd. When I did , export GO111MODULE=off; go get -v github.com/therecipe/qt/cmd/... && $(go env GOPATH)/bin/qtsetup test && $(go env GOPATH)/bin/qtsetup -test=false I just get : INFO[0000] running: 'qtsetup test freebsd' [docker=false] [vagrant=false] INFO[0000] testing widgets/textedit
ERRO[0000] failed to run command _func=RunCmd cmd="/home/x/Qt/5.13.0/gcc_64/bin/rcc -project -o /home/x/go/src/github.com/therecipe/qt/internal/examples/widgets/textedit/rcc.qrc" dir=/home/x/go/src/github.com/therecipe/qt/internal/examples/widgets/textedit/qml env= error="fork/exec /home/x/Qt/5.13.0/gcc_64/bin/rcc: no such file or directory" name="execute rcc *.qrc on freebsd for freebsd" on, FreeBSD 12.1-RELEASE-p10 qt5-core-5.14.2_3

devosalain commented 4 years ago

After performing your workarounds i get however, x: /home/x/go/bin >./qtsetup test INFO[0000] running: 'qtsetup test freebsd' [docker=false] [vagrant=false] INFO[0000] testing widgets/textedit
ERRO[0005] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0005] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qcoreapplication.h error="open /usr/local/include/QtCore/qcoreapplication.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qcoreapplication.h error="open /usr/local/include/QtCore/qcoreapplication.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qcoreapplication.h error="open /usr/local/include/QtCore/qcoreapplication.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qcoreapplication.h error="open /usr/local/include/QtCore/qcoreapplication.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qcoreapplication.h error="open /usr/local/include/QtCore/qcoreapplication.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qiodevice.h error="open /usr/local/include/QtCore/qiodevice.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qiodevice.h error="open /usr/local/include/QtCore/qiodevice.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qiodevice.h error="open /usr/local/include/QtCore/qiodevice.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qiodevice.h error="open /usr/local/include/QtCore/qiodevice.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qiodevice.h error="open /usr/local/include/QtCore/qiodevice.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qiodevice.h error="open /usr/local/include/QtCore/qiodevice.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0006] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0007] failed to load /usr/local/include/QtCore/qtimer.h error="open /usr/local/include/QtCore/qtimer.h: no such file or directory" ERRO[0007] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0007] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0007] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0007] failed to load /usr/local/include/QtCore/qobject.h error="open /usr/local/include/QtCore/qobject.h: no such file or directory" ERRO[0022] failed to run command _func=RunCmd cmd="go build -p 8 -v -ldflags=all=\"-s\" \"-w\" -trimpath -o /home/x/go/src/github.com/therecipe/qt/internal/examples/widgets/textedit/deploy/freebsd/textedit -tags=minimal" dir=/home/x/go/src/github.com/therecipe/qt/internal/examples/widgets/textedit

and

github.com/therecipe/qt/core

core-minimal.cpp:2439:47: error: static_cast from 'void (QObject::)(const QString &, QObject::QPrivateSignal)' to 'void (QObject::)(const QString &)' is not allowed core-minimal.cpp:2444:50: error: static_cast from 'void (QObject::)(const QString &, QObject::QPrivateSignal)' to 'void (QObject::)(const QString &)' is not allowed core-minimal.cpp:2449:98: error: too few arguments to function call, expected 2, have 1 /usr/local/include/qt5/QtCore/qobject.h:422:5: note: 'objectNameChanged' declared here core-minimal.cpp:3346:28: warning: 'start' is deprecated: Use QElapsedTimer instead [-Wdeprecated-declarations] /usr/local/include/qt5/QtCore/qdatetime.h:228:5: note: 'start' has been explicitly marked deprecated here /usr/local/include/qt5/QtCore/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X' /usr/local/include/qt5/QtCore/qcompilerdetection.h:676:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'

x: /home/x/go/bin >

devosalain commented 4 years ago

export QT_API=5.14.2
x: /home/x/go/bin >./qtsetup test
ERRO[0000] invalid api version provided: '5.14.2'
valid api versions are: 5.12.0 5.13.0

devosalain commented 4 years ago

Is it possible to copy /usr/local/lib and /usr/local/include to a different place and use modifications there in order not to have to reinstall all the packages when you've done some bad things ?

probonopd commented 4 years ago

I think you are looking for zfs snapshots :-)

devosalain commented 4 years ago

Indeed as /usr/local was on a zfs, snapshots would have been a good idea. Currently trying on void linux, it looks promising so far.