Skip to content

rework how some targets are handled#2298

Merged
Frenzie merged 5 commits into
koreader:masterfrom
benoit-pierre:pr/appimage_linux_targets_rework
Mar 15, 2026
Merged

rework how some targets are handled#2298
Frenzie merged 5 commits into
koreader:masterfrom
benoit-pierre:pr/appimage_linux_targets_rework

Conversation

@benoit-pierre

@benoit-pierre benoit-pierre commented Mar 15, 2026

Copy link
Copy Markdown
Member
  • drop the appimage target: the linux target will be used for building the AppImage too
  • drop support for cross-compiling the linux target: our SDL3 need to be built (since older Debian / Ubuntu distros don't provide it), and installing the necessary build deps (DBus, X11, Wayland, etc…) for a cross-toolchain is problematic
  • tweak the linux target architecture flag for maximum x86_64 compatibility (same flags previously used for appimage: -march=x86-64 -mtune=generic)
  • build the emulator with -march=native (including on macOS, only the macos target is built with -mcpu=apple-m1 / -mtune=generic)
  • when cross-compiling, build host flags no longer contain architecture specific flags

This change is Reviewable

If we can't find the library with `$CC -print-file-name=$SONAME`,
then give `find_library(…)` a try: this is mainly for macOS, so
homebrew libraries are found (e.g. when searching for SDL).
- drop the `appimage` target: the `linux` target will be used for building the AppImage too
- drop support for cross-compiling the `linux` target: our SDL3 need to be built (since older
  Debian / Ubuntu distros don't provide it), and installing the necessary build deps (DBus, X11,
  Wayland, etc…) for a cross-toolchain is problematic
- tweak the `linux` target architecture flag for maximum x86_64 compatibility
  (same flags previously used for `appimage`: `-march=x86-64 -mtune=generic`)
- build the `emulator` with `-march=native` (including on macOS, only the `macos` target is built
  with `-mcpu=apple-m1` / `-mtune=generic`)
- when cross-compiling, build host flags no longer contain architecture specific flags
@Frenzie Frenzie merged commit 7a46ea3 into koreader:master Mar 15, 2026
3 checks passed
benoit-pierre added a commit to benoit-pierre/koreader that referenced this pull request Mar 15, 2026
- SDL3: track mouse pointers and finger pointers separately (koreader/koreader-base#2295)
- xss-dummy: drop the library (koreader/koreader-base#2296)
- ci/macos: fix nodejs deprecation warnings (koreader/koreader-base#2297)
- rework how some targets are handled (koreader/koreader-base#2298)
@benoit-pierre benoit-pierre deleted the pr/appimage_linux_targets_rework branch March 15, 2026 21:38
Frenzie pushed a commit to koreader/koreader that referenced this pull request Mar 15, 2026
- SDL3: track mouse pointers and finger pointers separately (koreader/koreader-base#2295)
- xss-dummy: drop the library (koreader/koreader-base#2296)
- ci/macos: fix nodejs deprecation warnings (koreader/koreader-base#2297)
- rework how some targets are handled (koreader/koreader-base#2298)
@poire-z

poire-z commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Random pick (might not be the right PR) for my usual emulator rebuit adventure:

⸠ 1% | Configuring 'sdl3'
FAILED: /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/stamp/configure
cd /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3 && : toolchain:d2fde643c1ffc33f3a9227142731451e && set -- sdl3 "Configuring 'sdl3'" 0 /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/stamp/configure /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/log/configure && . /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/cmake/koenv.sh && run rm -rf /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/build && run mkdir -p /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/build && run /space/kobo/deb_extras/usr/bin/cmake -G Ninja -S /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/source/ -B /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/build -DCMAKE_TOOLCHAIN_FILE=/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/cmake/toolchain.cmake -DSDL_ANDROID_JAR=OFF -DSDL_EXAMPLES=OFF -DSDL_INSTALL_CPACK=OFF -DSDL_INSTALL_DOCS=OFF -DSDL_RPATH=OFF -DSDL_SHARED=ON -DSDL_STATIC=OFF -DSDL_TEST_LIBRARY=OFF -DSDL_AUDIO=OFF -DSDL_CAMERA=OFF -DSDL_DIALOG=OFF -DSDL_GPU=OFF -DSDL_HAPTIC=OFF -DSDL_LIBTHAI=OFF -DSDL_SENSOR=OFF -DSDL_TRAY=OFF
+ rm -rf /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/build
+ mkdir -p /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/build
+ /space/kobo/deb_extras/usr/bin/cmake -G Ninja -S /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/source/ -B /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/build '-DCMAKE_TOOLCHAIN_FILE=/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/cmake/toolchain.cmake' '-DSDL_ANDROID_JAR=OFF' '-DSDL_EXAMPLES=OFF' '-DSDL_INSTALL_CPACK=OFF' '-DSDL_INSTALL_DOCS=OFF' '-DSDL_RPATH=OFF' '-DSDL_SHARED=ON' '-DSDL_STATIC=OFF' '-DSDL_TEST_LIBRARY=OFF' '-DSDL_AUDIO=OFF' '-DSDL_CAMERA=OFF' '-DSDL_DIALOG=OFF' '-DSDL_GPU=OFF' '-DSDL_HAPTIC=OFF' '-DSDL_LIBTHAI=OFF' '-DSDL_SENSOR=OFF' '-DSDL_TRAY=OFF'
Re-run cmake no build system arguments
-- The C compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
[...]
-- Looking for shmat
-- Looking for shmat - found
-- Performing Test HAVE_XGENERICEVENT
-- Performing Test HAVE_XGENERICEVENT - Success
-- Looking for X11/XKBlib.h
-- Looking for X11/XKBlib.h - found
-- Performing Test HAVE_XINPUT2_SCROLLINFO
-- Performing Test HAVE_XINPUT2_SCROLLINFO - Success
-- Performing Test HAVE_XINPUT2_MULTITOUCH
-- Performing Test HAVE_XINPUT2_MULTITOUCH - Success
-- Performing Test HAVE_XINPUT2_GESTURE
-- Performing Test HAVE_XINPUT2_GESTURE - Success
-- Performing Test HAVE_XFIXES_H
-- Performing Test HAVE_XFIXES_H - Success
CMake Error at cmake/macros.cmake:433 (message):
  Couldn't find dependency package for XTEST.  Please install the needed
  packages or configure with -DSDL_X11_XTEST=OFF

  The full set of dependencies is available at
  https://wiki.libsdl.org/SDL3/README-linux#build-dependencies

Call Stack (most recent call first):
  cmake/sdlchecks.cmake:554 (SDL_missing_dependency)
  CMakeLists.txt:1828 (CheckX11)


-- Configuring incomplete, errors occurred!
See also "/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/build/CMakeFiles/CMakeOutput.log".
See also "/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/sdl3/build/CMakeFiles/CMakeError.log".
ninja: build stopped: subcommand failed.
make: *** [base/Makefile:86: base-all] Error 1

Just ran my usual wrapper script to build, did I miss installing some newly required package ?

@Frenzie

Frenzie commented Mar 18, 2026

Copy link
Copy Markdown
Member

Some extra build dependencies were added to https://github.com/koreader/koreader/blob/6b6ecb5b053abae28c12b734ed97fdde55c0e21f/doc/Building.md#debianubuntu

I think that one should be provided by libxext-dev.

@poire-z

poire-z commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Oh, I guess I just forgot to install libsdl3-dev ? Or will SDL3 still be build from our tree (I think I read that recently, that we always build sdl3) ?

@Frenzie

Frenzie commented Mar 18, 2026

Copy link
Copy Markdown
Member

Always for the release build, not for the emulator if the system already has SDL3 installed.

@benoit-pierre

benoit-pierre commented Mar 18, 2026

Copy link
Copy Markdown
Member Author

And you don't need the development sdl3 package, just the library. If not provided by you distribution, you should be able to use the library from our Linux distribution.

@poire-z

poire-z commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

But I have it (debian 13, installed when I previously asked you about it I guess 2026-02-15 - or on my first build after you introduced sdl3 and it was needed):

libsdl2-2.0-0 2.32.4+dfsg-1
libsdl3-0 3.2.10+ds-1

So, something must have changed recently, as I remember I did build it after you made it use sdl3 and reported my success.

@benoit-pierre

Copy link
Copy Markdown
Member Author

We need >= 3.2.12 for accumulated whole scroll "ticks" in mouse wheel events (cf. #2288).

@poire-z

poire-z commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

:/ So I need to have SDL3 built...
Any idea why it fails (see log above) ?
(I do have libxext-dev unpacked - with 70 other packages - in some dedicated tree for KOreader build (I didn't want to polute my clean debian install with all that) - they are still from debian 12. I hope I won't have to refresh all that :/)

@benoit-pierre

Copy link
Copy Markdown
Member Author

I don't understand your reasoning: how is manually unpacking stuff somewhere cleaner than just installing the required distribution packages?

And 70 seems a lot, on a bare Trixie docker image, installing the minimum dependencies required for both Wayland and X11 support only pull 58 packages (223 MB).

Anyway, I imagine your problem is with pkg-config search path: normally we isolate our build, but for SDL, we need to punch a hole through our isolation to access system packages. We do this by resetting pkg-config search path to its build time default: pkg-config --variable pc_path pkg-config. Is your tree pkgconfig directory in that search path?

@poire-z

poire-z commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

I don't understand your reasoning: how is manually unpacking stuff somewhere cleaner than just installing the required distribution packages?

Because I'm not a builder like you, I'm a user :)
I like my debian clean, and keep track of what I really need and what is pulled or orphaned when upgrading debian. I only need 20 -dev packages to build the little side things I need.
KOReader needed a lot more, I didn't want to get all that part of that clean track.

And 70 seems a lot, on a bare Trixie docker image, installing the minimum dependencies required for both Wayland and X11 support only pull 58 packages (223 MB).

Maybe I didn't check what packages were needed to built KOReader last time I refreshed it, and kept going on with the list I had from when I started it (Debian jessie), but I had installed for Bookworm:

My last notes for Bookworm
On va récupérer les .deb des pre-requis, et ne pas les installer avec apt-get,
mais les extraires avec dpkg -x.
On fait quand même quelques simulations pour voir en quoi ça consiste vraiment :

Package suggérés et commandes apt-get pour les récupérér prises de l'url :

    $ apt-get -sd install build-essential git patch wget unzip gettext autoconf automake cmake libtool ragel nasm luarocks
      => cmake cmake-data gettext libjsoncpp25 librhash0 nasm ragel

On a déjà donc tout sauf : gettext nasm cmake
    $ apt-get -sd install gettext nasm ragel
      => gettext nasm ragel
    $ apt-get -sd install cmake
      => cmake cmake-data libjsoncpp25 librhash0


$ apt-get -sd install libssl-dev libffi-dev libsdl2-dev libc6-dev-i386 xutils-dev linux-libc-dev:i386 zlib1g:i386
    E: Unable to locate package linux-libc-dev:i386
    E: Unable to locate package zlib1g:i386

$ apt-get -sd install libssl-dev libffi-dev libsdl2-dev libc6-dev-i386 xutils-dev linux-libc-dev zlib1g
  gir1.2-ibus-1.0 libasound2-dev libblkid-dev libc6-dev-i386 libdecor-0-dev
  libdrm-dev libegl-dev libffi-dev libgbm-dev libgl-dev libgles-dev libgles1
  libgles2 libglib2.0-bin libglib2.0-data libglib2.0-dev libglib2.0-dev-bin
  libglx-dev libibus-1.0-5 libibus-1.0-dev libice-dev libmount-dev
  libpciaccess-dev libpcre2-16-0 libpcre2-32-0 libpcre2-dev
  libpthread-stubs0-dev libpulse-dev libsamplerate0-dev libsdl2-dev
  libselinux1-dev libsepol-dev libsm-dev libsndio-dev libudev-dev
  libwayland-bin libwayland-dev libx11-dev libxau-dev libxcb1-dev
  libxcursor-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev
  libxinerama-dev libxkbcommon-dev libxrandr-dev libxrender-dev libxss-dev
  libxt-dev libxv-dev libxxf86vm-dev uuid-dev x11proto-dev xorg-sgml-doctools
  xtrans-dev xutils-dev

$ apt-get -sd install linux-libc-dev zlib1g
    linux-libc-dev is already the newest version (6.1.27-1).
    zlib1g is already the newest version (1:1.2.13.dfsg-1).

$ apt-get -sd install libssl-dev
    libssl-dev is already the newest version (3.0.9-1).

$ apt-get -sd install libc6-dev-i386
    libc6-dev-i386

$ apt-get -sd install libffi-dev
    libffi-dev

$ apt-get -sd install xutils-dev
    xutils-dev
$ apt-get -sd install libsdl2-dev
  gir1.2-ibus-1.0 libasound2-dev libblkid-dev libdecor-0-dev libdrm-dev
  libegl-dev libffi-dev libgbm-dev libgl-dev libgles-dev libgles1 libgles2
  libglib2.0-bin libglib2.0-data libglib2.0-dev libglib2.0-dev-bin libglx-dev
  libibus-1.0-5 libibus-1.0-dev libice-dev libmount-dev libpciaccess-dev
  libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpthread-stubs0-dev libpulse-dev
  libsamplerate0-dev libsdl2-dev libselinux1-dev libsepol-dev libsm-dev
  libsndio-dev libudev-dev libwayland-bin libwayland-dev libx11-dev libxau-dev
  libxcb1-dev libxcursor-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev
  libxinerama-dev libxkbcommon-dev libxrandr-dev libxrender-dev libxss-dev
  libxt-dev libxv-dev libxxf86vm-dev uuid-dev x11proto-dev xorg-sgml-doctools
  xtrans-dev

That's a lot of crap I don't need for anything else :)
(And I have the same kind of stuff for building for Kobo in another tree gnu_arm-linux-gnueabihf - that I haven't updated since debian 10 I think.)

Anyway, I imagine your problem is with pkg-config search path: normally we isolate our build, but for SDL, we need to punch a hole through our isolation to access system packages. We do this by resetting pkg-config search path to its build time default: pkg-config --variable pc_path pkg-config. Is your tree pkgconfig directory in that search path?

/space/kobo/deb_extras $ which pkg-config
/usr/bin/pkg-config
/space/kobo/deb_extras $ find . -name pkg-config
/space/kobo/deb_extras $ pkg-config --variable pc_path pkg-config
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

So, no pkg-config in my tree, and my /space/kobo/deb_extras tree is not in that output.

My build wrapper script just does:

export PATH=/space/kobo/deb_extras/usr/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/space/kobo/deb_extras/usr/lib/x86_64-linux-gnu
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/space/kobo/deb_extras/usr/lib
cd koreader
/space/kobo/koreader/kodev build

Any suggestion on how to go on ?

@benoit-pierre

Copy link
Copy Markdown
Member Author

Did you try to follow the instructions from doc/Building.md?

Because I see a lot of unnecessary stuff in your list: libsdl2-dev, libibus, libpulse, ragel, libssl-dev, luarocks…

@benoit-pierre

Copy link
Copy Markdown
Member Author

What if you add the SDL3 library from our Linux distribution to /space/kobo/deb_extras/usr/lib/x86_64-linux-gnu?

@benoit-pierre

Copy link
Copy Markdown
Member Author

And add export CMAKE_LIBRARY_PATH=/space/kobo/deb_extras/usr/lib/x86_64-linux-gnu.

@poire-z

poire-z commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Did you try to follow the instructions from doc/Building.md?
Because I see a lot of unnecessary stuff in your list: libsdl2-dev, libibus, libpulse, ragel, libssl-dev, luarocks…

These must have been in the Building.md at some point (pulse pulled by sdl I guess, ragel was needed for building Harfbuzz at some point).
Maybe most of these are no longer required after your last years of cleaning the build stuff.
I guess I'll have a go at refreshing it following the updated Building.md.

Your last 2 suggestion did not help.

/space/kobo/deb_extras/usr/lib/x86_64-linux-gnu/libSDL3.so.0 -> /usr/lib/x86_64-linux-gnu/libSDL3.so.0
/space/kobo/deb_extras/usr/lib/x86_64-linux-gnu/libSDL3.so.0.2.10 -> /usr/lib/x86_64-linux-gnu/libSDL3.so.0.2.10

from our Linux distribution

our = your and mine debian ? or some KOReader linux distribution ? :)

@benoit-pierre

Copy link
Copy Markdown
Member Author

our = your and mine debian ? or some KOReader linux distribution ? :)

From our v2026.03 release: https://ota.koreader.rocks/koreader-linux-x86_64-v2026.03.tar.xz

Check the output of make setup, it should show something like:

-- Found libSDL3.so.0 full path: […]/libSDL3.so.0
-- Found libSDL3.so.0 version: 3.4.0 (>= 3.2.12 needed)

@poire-z

poire-z commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

It does - although mentionnig the /usr/lib/... path which wouldn't be 3.4.0:

-- Found libSDL3.so.0 full path: /usr/lib/x86_64-linux-gnu/libSDL3.so.0
-- Found libSDL3.so.0 version: 3.4.0 (>= 3.2.12 needed)

The built then went to its end.
(Btw, I'm seeing lots of things like this at the end of the build - that I don't remember seeing before, is this intended?

⸠84% | Building 'luacov'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/util.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/tick.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/stats.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/runner.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/reporter/default.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/reporter.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/linescanner.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/hook.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/defaults.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov.lua'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/lib/luarocks/rocks-5.1/luacov/0.15.0-1/rock_manifest'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/lib/luarocks/rocks-5.1/luacov/0.15.0-1/luacov-0.15.0-1.rockspec'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/lib/luarocks/rocks-5.1/luacov/0.15.0-1/bin/luacov'
removed '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/bin/luacov'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/reporter/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/luacov/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/5.1/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/lua/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/share/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/lib/luarocks/rocks-5.1/luacov/0.15.0-1/bin/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/lib/luarocks/rocks-5.1/luacov/0.15.0-1/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/lib/luarocks/rocks-5.1/luacov/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/lib/luarocks/rocks-5.1/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/lib/luarocks/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/lib/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/bin/'
rmdir: removing directory, '/space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist/'
No existing manifest. Attempting to rebuild...
luacov 0.15.0-1 is now installed in /space/kobo/koreader/base/build/x86_64-linux-gnu-debug/thirdparty/luacov/source/dist (license: MIT)

Anyway, KOReader starts, the luajit process has /usr/lib/x86_64-linux-gnu/libSDL3.so.0.2.10 opened.
But any mousewheel wheeling brings me back to page 1:

03/19/26-00:48:28 DEBUG input event => type: 83 (EV_SDL), code: 1027, value: cdata<struct SDL_MouseWheelEvent &>: 0x7f3279f982e8, time: 314247.802927
03/19/26-00:48:28 DEBUG goto relative screen: -1024 in mode: page

Sigh.

Edit: but it works when launched with LD_LIBRARY_PATH=/space/kobo/deb_extras/usr/lib/x86_64-linux-gnu/.

@benoit-pierre

Copy link
Copy Markdown
Member Author

Well yes, you still need to mess with LD_LIBRARY_PATH, or you won't get the right library at runtime.

And that setup phase is still wrong (run with LD_LIBRARY_PATH set I imagine? so the wrong path is detected, but the version check load the correct one and pass).

@poire-z

poire-z commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

And that setup phase is still wrong (run with LD_LIBRARY_PATH set I imagine?

Right.

so the wrong path is detected, but the version check load the correct one and pass).

What would be the better/right way ?

@benoit-pierre

benoit-pierre commented Mar 19, 2026

Copy link
Copy Markdown
Member Author

The better way is to stop making your life harder and just install the necessary distribution packages…

And we should definitively raise an error at run time if the SDL version is too old.

@benoit-pierre

Copy link
Copy Markdown
Member Author

You can build a meta package that will install all the necessary package without marking those as manually installed (for easier cleanup later):

▸ apt install --no-install-recommends equivs
[…]
▸ cat >control <<\EOF
Source: koreader-build-deps
Section: misc
Priority: optional
Standards-Version: 3.9.2

Package: koreader-build-deps
Depends: autoconf, automake, build-essential, ca-certificates, cmake, gcc-multilib, gettext, git, libtool, libtool-bin, meson, nasm, ninja-build, patch, perl, pkg-config, unzip, wget, ccache, lua-check, p7zip-full, shellcheck, shfmt, libegl-dev, libwayland-dev, libx11-dev, libxext-dev
Description: Meta package to install all necessary build requirements for KOReader.
EOF
▸ equivs-build control
▸ apt install --no-install-recommends ./koreader-build-deps_1.0_all.deb
Note, selecting 'koreader-build-deps' instead of './koreader-build-deps_1.0_all.deb'
Installing:
  koreader-build-deps

Installing dependencies:
  7zip                     libdrm-intel1     libngtcp2-crypto-gnutls8  libx32gcc-14-dev  ninja-build
  build-essential          libdrm2           libp11-kit0               libx32gcc-s1      openssl
  ca-certificates          libedit2          libpciaccess0             libx32gomp1       p7zip-full
  ccache                   libegl-dev        libpkgconf3               libx32itm1        pkg-config
  cmake                    libegl-mesa0      libproc2-0                libx32quadmath0   pkgconf
  cmake-data               libegl1           libpsl5t64                libx32stdc++6     pkgconf-bin
  g++                      liberror-perl     libpython3-stdlib         libx32ubsan1      procps
  g++-14                   libexpat1         libpython3.13-minimal     libxau-dev        python3
  g++-14-x86-64-linux-gnu  libffi-dev        libpython3.13-stdlib      libxau6           python3-autocommand
  g++-x86-64-linux-gnu     libffi8           libreadline8t64           libxcb-dri3-0     python3-inflect
  gcc-14-multilib          libfmt10          librhash1                 libxcb-glx0       python3-jaraco.context
  gcc-multilib             libgbm1           librtmp1                  libxcb-present0   python3-jaraco.functools
  git                      libgl-dev         libsasl2-2                libxcb-randr0     python3-jaraco.text
  git-man                  libgl1            libsasl2-modules-db       libxcb-shm0       python3-minimal
  lib32asan8               libgl1-mesa-dri   libsensors-config         libxcb-sync1      python3-more-itertools
  lib32atomic1             libglvnd0         libsensors5               libxcb-xfixes0    python3-pkg-resources
  lib32gcc-14-dev          libglx-dev        libssh2-1t64              libxcb1           python3-setuptools
  lib32gcc-s1              libglx-mesa0      libstdc++-14-dev          libxcb1-dev       python3-typeguard
  lib32gomp1               libglx0           libtasn1-6                libxdmcp-dev      python3-typing-extensions
  lib32itm1                libgnutls30t64    libtool-bin               libxdmcp6         python3-zipp
  lib32quadmath0           libgssapi-krb5-2  libuv1t64                 libxext-dev       python3.13
  lib32stdc++6             libhiredis1.1.0   libvulkan1                libxext6          python3.13-minimal
  lib32ubsan1              libidn2-0         libwayland-bin            libxshmfence1     readline-common
  libarchive13t64          libjsoncpp26      libwayland-client0        libxxf86vm1       shellcheck
  libbrotli1               libk5crypto3      libwayland-cursor0        libz3-4           shfmt
  libc6-dev-i386           libkeyutils1      libwayland-dev            lua-argparse      unzip
  libc6-dev-x32            libkrb5-3         libwayland-egl1           lua-check         wget
  libc6-i386               libkrb5support0   libwayland-server0        lua-filesystem    x11proto-dev
  libc6-x32                libldap2          libx11-6                  lua5.1            xorg-sgml-doctools
  libcom-err2              libllvm19         libx11-data               media-types       xtrans-dev
  libcurl3t64-gnutls       libncursesw6      libx11-dev                mesa-libgallium
  libcurl4t64              libnghttp2-14     libx11-xcb1               meson
  libdrm-amdgpu1           libnghttp3-9      libx32asan8               nasm
  libdrm-common            libngtcp2-16      libx32atomic1             netbase

Suggested packages:
  7zip-standalone  cmake-format     git-doc    git-cvs        krb5-doc          libwayland-doc  python3-tk             binfmt-support
  7zip-rar         elpa-cmake-mode  git-email  git-mediawiki  krb5-user         libx11-doc      python3-venv           readline-doc
  distcc           g++-multilib     git-gui    git-svn        pciutils          libxcb-doc      python-setuptools-doc  zip
  | icecc          g++-14-multilib  gitk       lrzip          lm-sensors        libxext-doc     python3.13-venv
  cmake-doc        gcc-14-doc       gitweb     gnutls-bin     libstdc++-14-doc  python3-doc     python3.13-doc

Recommended packages:
  less        krb5-locales    libgpm2       libsasl2-modules     | vulkan-icd  linux-sysctl-defaults
  ssh-client  libldap-common  publicsuffix  mesa-vulkan-drivers  psmisc

Summary:
  Upgrading: 0, Installing: 167, Removing: 0, Not Upgrading: 0
  Download size: 140 MB / 140 MB
  Space needed: 592 MB / 7085 MB available

Continue? [Y/n] n
Abort.

jqs7 pushed a commit to jqs7/koreader that referenced this pull request Mar 19, 2026
- SDL3: track mouse pointers and finger pointers separately (koreader/koreader-base#2295)
- xss-dummy: drop the library (koreader/koreader-base#2296)
- ci/macos: fix nodejs deprecation warnings (koreader/koreader-base#2297)
- rework how some targets are handled (koreader/koreader-base#2298)
@poire-z

poire-z commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Btw, is there some official kodev/Makefile way to prune /thirdparty/*/build/downloads/ from accumulated past versions ?

@benoit-pierre

Copy link
Copy Markdown
Member Author

Nope.

@poire-z

poire-z commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

I used to get AppImage releases to test regressions (and tweak frontend code, so appimage-extract).
I used to execute the downloaded bin with --appimage-extract, and run ./luajit reader.lua from that squashfs-root, and copy settings.reader.lua, gestures.lua and history.lua from my emulator in it to get it to my liking.
Trying to adapt my launch script to do that, I got to get stuff created in both after a few runs and adapations:

squashfs-root/usr/lib/koreader/settings.reader.lua
$HOME/.config/koreader/settings.reader.lua

What is the now classic location where I should I copy my settings and history.lua ? (I'd rather not have them in my $HOME, for me all this is volatile).
Any other thing/good practice I should know about the recent appimage changes to the appimage layout and extraction ?

@benoit-pierre

Copy link
Copy Markdown
Member Author

You can set the KO_HOME environment variable, which was added to allow concurrent executions when running tests. It takes priority over all other variables used to determine where KOReader will save its settings (APPIMAGE, KO_MULTIUSER, XDG_CONFIG_HOME, …).

0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
- SDL3: track mouse pointers and finger pointers separately (koreader/koreader-base#2295)
- xss-dummy: drop the library (koreader/koreader-base#2296)
- ci/macos: fix nodejs deprecation warnings (koreader/koreader-base#2297)
- rework how some targets are handled (koreader/koreader-base#2298)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants