build failure for Kivy 2.3.0 on FreeBSD 14.0, suggestions?

55 views
Skip to first unread message

Tom Rushworth

unread,
Jun 10, 2024, 9:13:51 PMJun 10
to Kivy users support
Hi All,

I'm trying to build Kivy 2.3.0 from source as root on FreeBSD 14.0, and hoping someone else has managed it and can tell me how they did it.  FreeBSD 14.0 has all the right versions for the dependencies listed for linux except for SDL2_Image.   The FreeBSD pkg version of that dependency is something like 2.6.3 and Kivy 2.3.0 wants version 2.8.0.

I've tried several approaches.  Building all the dependencies as if for Linux results in an error building SDL2 with some touchscreen stuff.  Building with just the SDL2_image dependency as a kivy dep (and using the native FreeBSD SDL2 bits for the rest) seems to get through building SDL2_image fine.  However, both building with that one kivy-dep and building with all native FreeBSD libs result in a missing file 'config.pxi'.  Does anyone know where that file comes from?

This is with python 3.9.  The kivy build pulls in cython 3.0.0.

Tomek CEDRO

unread,
Jun 11, 2024, 5:35:53 AMJun 11
to kivy-...@googlegroups.com
Hey there Tom :-) Why not use local user venv pip installed version? Works for me :-)

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

ElliotG

unread,
Jun 11, 2024, 8:43:27 AMJun 11
to Kivy users support
You might want to ask in the Dev forum on the Kivy Discord. 

Tom Rushworth

unread,
Jun 11, 2024, 3:16:03 PMJun 11
to Kivy users support
Hi Tomek,

Thanks for the suggestion, but I tried a local user venv with native FreeBSD SLD2 stuff for:
   a) kivy[full] from source (--no-binary),
   b) kivy[full] from binary, and
   c) kivy[base] from binary
   d) kivy[base] from binary after removing ~/.cache/pip
and all 4 gave me the same error(s) as the build from root, i.e. no "../include/config.pxi".

I think I'm going to have to try asking over at the Dev forum as EliotG suggested.

Tomek CEDRO

unread,
Jun 11, 2024, 8:42:13 PMJun 11
to kivy-...@googlegroups.com
hmm strange works for me on FreeBSD 13.2..

do you have all necessary dependencies installed in the system to
build the kivy package? see kivy deps script (do not run it just see
what is necessary).

https://kivy.org/doc/stable/gettingstarted/installation.html

i think list of dependencies in the documentation would be nice.. even
better kivy should have its own port here.. i just need to find a free
moment to create one ;-)

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

> --
> You received this message because you are subscribed to the Google Groups "Kivy users support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/6d107ca4-7014-47ea-9f81-60613567ddc0n%40googlegroups.com.

Tom Rushworth

unread,
Jun 20, 2024, 9:12:59 PMJun 20
to Kivy users support
ANSWER: several of the FreeBSD 14.0 include files have an OpenGL function signature for the "glShaderSource" function that includes an extra "const" for the 3rd argument. Kivy's source has:

   void glShaderSource(GLuint shader, GLsizei count, const GLchar ** string, const GLint *length)

FreeBSD 14.0 has:

   void glShaderSource(GLuint shader, GLsizei count, const GLchar * const * string, const GLint *length)

There are multiple include files on FreeBSD, some with one form, some with the other, and I didn't bother to track down which one the Kivy build actually uses. What I did was a bit of a hack, I changed line 251 in cgl_gl.pyx to:

   cgl.glShaderSource = <GLSHADERSOURCEPTR>glShaderSource

(adding the "<GLSHADERSOURCEPTR>") which generates a cast in the C source that eliminates the error in the build. (Clang 16.0.6 considers the extra const to be a type conflict and generates an error without the cast.)

This was all in FreeBSD 14.0, Clang 16.0.6, Kivy v3.0.0.dev0, Python v3.9.18, Cython 3.0.0.

Tomek CEDRO

unread,
Jun 21, 2024, 10:27:14 AMJun 21
to kivy-...@googlegroups.com
well 14.0 was unstable for me because of known amdgpu problems that are not fixed in 14.1. so i rolled back to 13.

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
Reply all
Reply to author
Forward
0 new messages