Rain92 / UltimateMangaReader

A feature-rich online manga reader for Kobo E-Ink devices based on Qt5.
GNU Affero General Public License v3.0
176 stars 24 forks source link

[request] any chance of Docker image for building? #39

Open raisjn opened 3 years ago

raisjn commented 3 years ago

the instructions for building are good, but i don't want to spend hours re-compiling Qt + setting up the kobo target. is there a docker image available? (or plans for one?) thanks!

Rain92 commented 2 years ago

I have been thinking about it, though I don't have much experience with how to work inside the docker container with some parts of the environment inside and a part outside. How would Qt Creator acces the build environment inside the container. Maybe run Qt creator from inside the container as well...

Anyway I do want to make the developement process more accessible. So at the very least I will set up a repo in the coming days with some up to date scripts to automate the build process of Qt, etc.

Rain92 commented 2 years ago

Here you go ;) https://github.com/Rain92/kobo-qt-dev-docker

raisjn commented 2 years ago

awesome, thank you - i am trying it out, now! previously, i just used qmake (no need for qt creator) inside docker images, like in https://github.com/toltec-dev/toolchain/blob/v2.x/qt/Dockerfile

raisjn commented 2 years ago
$ docker run rain92/kobo-qt-dev
/launch.sh: line 7:     7 Aborted                 (core dumped) $executable
$ docker run rain92/kobo-qt-dev -v .:/umr/ kobo-qt-dev
/launch.sh: line 7:     8 Aborted                 (core dumped) $executable
$ docker run rain92/kobo-qt-dev -v .:/umr/ kobo-qt-dev :0
/launch.sh: line 7:     7 Aborted                 (core dumped) $executable
$
Rain92 commented 2 years ago

Are you calling from a Windows or Linux host?

Anyway I will add a flag to launch a shell instead of qtcreator.

Rain92 commented 2 years ago

you need -v /tmp:/tmp

raisjn commented 2 years ago

no luck for me :-( - still get the same core dumped message. i'll investigate more on nights and this weekend

Rain92 commented 2 years ago

I have updated the docker image and the instructions. Try again and even if it doesn't work, now you should get some output and know why.

raisjn commented 2 years ago

thanks so much for the patience and the updated images! i'm able to compile for desktop through the docker image but having trouble compiling for kobo from CLI. some things i've tried:

``` arkose .../tonka/apps/UltimateMangaReader  master 130 docker run -it -v /tmp:/tmp rain92/kobo-qt-dev kobo [root@870df423b76d ~]# cd kobo-qt-setup-scripts/ [root@870df423b76d kobo-qt-setup-scripts]# ls arm-kobo-linux-gnueabihf.cmake deploy get_qt.sh install_libs.sh koxtoolchain README.md build_qt.sh deploy_qt.sh install_gdb.sh install_toolchain.sh patches [root@870df423b76d kobo-qt-setup-scripts]# ./koxtoolchain/ build/ gen-tc.sh refs/ [root@870df423b76d kobo-qt-setup-scripts]# source ./koxtoolchain/refs/x-compile.sh kobo env * Setting environment up . . . * Environment has been set up for the KOBO TC, enjoy :) [root@870df423b76d kobo-qt-setup-scripts]# ls arm-kobo-linux-gnueabihf.cmake deploy get_qt.sh install_libs.sh koxtoolchain README.md build_qt.sh deploy_qt.sh install_gdb.sh install_toolchain.sh patches [root@870df423b76d kobo-qt-setup-scripts]# ls arm-kobo-linux-gnueabihf.cmake deploy get_qt.sh install_libs.sh koxtoolchain README.md build_qt.sh deploy_qt.sh install_gdb.sh install_toolchain.sh patches [root@870df423b76d kobo-qt-setup-scripts]# make make: *** No targets specified and no makefile found. Stop. [root@870df423b76d kobo-qt-setup-scripts]# cd .. [root@870df423b76d ~]# ls kobo-qt-setup-scripts qt5-kobo-platform-plugin qt-bin scribble UltimateMangaReader x-tools [root@870df423b76d ~]# cd UltimateMangaReader/ [root@870df423b76d UltimateMangaReader]# ls eink.qss LICENSE resources.qrc thirdparty UltimateMangaReader.pro.user images README.md src UltimateMangaReader.pro [root@870df423b76d UltimateMangaReader]# qmake "CONFIG+=kobo" . Info: creating stash file /home/user/UltimateMangaReader/.qmake.stash [root@870df423b76d UltimateMangaReader]# make /usr/bin/uic src/widgets/aboutdialog.ui -o ui_aboutdialog.h /usr/bin/uic src/widgets/clearcachedialog.ui -o ui_clearcachedialog.h /usr/bin/uic src/widgets/downloadmangachaptersdialog.ui -o ui_downloadmangachaptersdialog.h /usr/bin/uic src/widgets/downloadstatusdialog.ui -o ui_downloadstatusdialog.h /usr/bin/uic src/widgets/errormessagewidget.ui -o ui_errormessagewidget.h /usr/bin/uic src/widgets/favoriteswidget.ui -o ui_favoriteswidget.h /usr/bin/uic src/widgets/gotodialog.ui -o ui_gotodialog.h /usr/bin/uic src/widgets/homewidget.ui -o ui_homewidget.h /usr/bin/uic src/widgets/mainwidget.ui -o ui_mainwidget.h /usr/bin/uic src/widgets/mangainfowidget.ui -o ui_mangainfowidget.h /usr/bin/uic src/widgets/mangareaderwidget.ui -o ui_mangareaderwidget.h /usr/bin/uic src/widgets/menudialog.ui -o ui_menudialog.h /usr/bin/uic src/widgets/numpadwidget.ui -o ui_numpadwidget.h /usr/bin/uic src/widgets/screensaverdialog.ui -o ui_screensaverdialog.h /usr/bin/uic src/widgets/settingsdialog.ui -o ui_settingsdialog.h /usr/bin/uic src/widgets/updatemangalistsdialog.ui -o ui_updatemangalistsdialog.h /usr/bin/uic src/widgets/wifidialog.ui -o ui_wifidialog.h g++ -c -pipe -isystem/home/user/Kindle/CrossTool/Build_KOBO/include -O3 -ffast-math -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -mthumb -D_GLIBCXX_USE_CXX11_ABI=0 -pipe -fomit-frame-pointer -frename-registers -fweb -flto=9 -fuse-linker-plugin -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DKOBO -D__ARM_NEON__ -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../qt5-kobo-platform-plugin/src -Isrc -Isrc/widgets -Isrc/mangasources -I/usr/include/qt -I/usr/include/qt/QtSvg -I/usr/include/qt/QtWidgets -I/usr/include/qt/QtGui -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I. -I/usr/lib/qt/mkspecs/linux-g++ -o downloadbufferjob.o src/downloadbufferjob.cpp g++: error: unrecognized command-line option ‘-mfpu=neon’ g++: error: unrecognized command-line option ‘-mfloat-abi=hard’ g++: error: unrecognized command-line option ‘-mthumb’ make: *** [Makefile:1891: downloadbufferjob.o] Error 1 [root@870df423b76d UltimateMangaReader]# ```

i've also tried running the above without sourcing the toolchain first and get a different error about arm_neon.h not being found

``` ^P arkose .../tonka/apps/UltimateMangaReader  master 2 docker run -it -v /tmp:/tmp rain92/kobo-qt-dev kobo [root@e14f3b49dc17 ~]# cd UltimateMangaReader/ [root@e14f3b49dc17 UltimateMangaReader]# ls eink.qss LICENSE resources.qrc thirdparty UltimateMangaReader.pro.user images README.md src UltimateMangaReader.pro [root@e14f3b49dc17 UltimateMangaReader]# qmake "CONFIG+=kobo release" . Info: creating stash file /home/user/UltimateMangaReader/.qmake.stash m[root@e14f3b49dc17 UltimateMangaReader]# make /usr/bin/uic src/widgets/aboutdialog.ui -o ui_aboutdialog.h /usr/bin/uic src/widgets/clearcachedialog.ui -o ui_clearcachedialog.h /usr/bin/uic src/widgets/downloadmangachaptersdialog.ui -o ui_downloadmangachaptersdialog.h /usr/bin/uic src/widgets/downloadstatusdialog.ui -o ui_downloadstatusdialog.h /usr/bin/uic src/widgets/errormessagewidget.ui -o ui_errormessagewidget.h /usr/bin/uic src/widgets/favoriteswidget.ui -o ui_favoriteswidget.h /usr/bin/uic src/widgets/gotodialog.ui -o ui_gotodialog.h /usr/bin/uic src/widgets/homewidget.ui -o ui_homewidget.h /usr/bin/uic src/widgets/mainwidget.ui -o ui_mainwidget.h /usr/bin/uic src/widgets/mangainfowidget.ui -o ui_mangainfowidget.h /usr/bin/uic src/widgets/mangareaderwidget.ui -o ui_mangareaderwidget.h /usr/bin/uic src/widgets/menudialog.ui -o ui_menudialog.h /usr/bin/uic src/widgets/numpadwidget.ui -o ui_numpadwidget.h /usr/bin/uic src/widgets/screensaverdialog.ui -o ui_screensaverdialog.h /usr/bin/uic src/widgets/settingsdialog.ui -o ui_settingsdialog.h /usr/bin/uic src/widgets/updatemangalistsdialog.ui -o ui_updatemangalistsdialog.h /usr/bin/uic src/widgets/wifidialog.ui -o ui_wifidialog.h g++ -c -pipe -O2 -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DKOBO -D__ARM_NEON__ -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../qt5-kobo-platform-plugin/src -Isrc -Isrc/widgets -Isrc/mangasources -I/usr/include/qt -I/usr/include/qt/QtSvg -I/usr/include/qt/QtWidgets -I/usr/include/qt/QtGui -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I. -I/usr/lib/qt/mkspecs/linux-g++ -o downloadbufferjob.o src/downloadbufferjob.cpp In file included from src/greyscaleimage.h:14, from src/imageprocessingnative.h:9, from src/downloadimageandrescalejob.h:7, from src/networkmanager.h:8, from src/utils.h:12, from src/downloadbufferjob.cpp:3: src/imagerotate.h:7:10: fatal error: arm_neon.h: No such file or directory 7 | #include | ^~~~~~~~~~~~ compilation terminated. make: *** [Makefile:1891: downloadbufferjob.o] Error 1 ```
Rain92 commented 2 years ago

I'm not an expert in calling qmake from cli, but here are some hints. the 'kobo' argument in docker run will do nothing. Yep you do need "CONFIG+=kobo" for qmake but you also have to select the kobo kit, otherwise it will still build for desktop. But no idea how to do that from the comandline.

raisjn commented 2 years ago

thanks! in order to get qt creator displaying on my local machine, i had to run xhost + (disable access control) on the host machine before the guest could connect and display qt creator. i am sure there is a better way of doing this, but not sure what it is.

``` $ QT_DEBUG_PLUGINS=1 docker run -it -v /tmp:/tmp rain92/kobo-qt-dev qtcreator No protocol specified qt.qpa.xcb: could not connect to display :0 qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb. /launch.sh: line 10: 7 Aborted (core dumped) qtcreator $ xhost + access control disabled, clients can connect from any host $ QT_DEBUG_PLUGINS=1 docker run -it -v /tmp:/tmp rain92/kobo-qt-dev qtcreator QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' libGL error: failed to open /dev/dri/card0: No such file or directory libGL error: failed to load driver: i965 Info: creating stash file /home/user/build-koboplatformplugin-Kobo-Debug/.qmake.stash Info: creating stash file /home/andreas/Desktop/qtproject/build-scribble-Kobo-Release/.qmake.stash Info: creating stash file /home/user/build-UltimateMangaReader-Kobo-Release/.qmake.stash qt.xkb.compose: failed to create compose table ```