Skip to content

Building on openSUSE fails #1001

@jayvdb

Description

@jayvdb

In the build spec for openSUSE we have to manually add -I/usr/include/freetype2 to CFLAGS.

https://build.opensuse.org/package/show/devel:languages:python/python-PyMuPDF

Without it, we see the following.

[   73s] + /usr/bin/python3.6 setup.py build '--executable=/usr/bin/python3.6 -s'
[   74s] running build
[   74s] running build_py
[   74s] creating build
[   74s] creating build/lib.linux-i686-3.6
[   74s] creating build/lib.linux-i686-3.6/fitz
[   74s] copying fitz/__init__.py -> build/lib.linux-i686-3.6/fitz
[   74s] copying fitz/fitz.py -> build/lib.linux-i686-3.6/fitz
[   74s] copying fitz/utils.py -> build/lib.linux-i686-3.6/fitz
[   74s] copying fitz/__main__.py -> build/lib.linux-i686-3.6/fitz
[   74s] running build_ext
[   74s] building 'fitz._fitz' extension
[   74s] creating build/temp.linux-i686-3.6
[   74s] creating build/temp.linux-i686-3.6/fitz
[   74s] gcc -pthread -DNDEBUG -fomit-frame-pointer -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -DOPENSSL_LOAD_CONF -fwrapv -fno-semantic-interposition -fomit-frame-pointer -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -I/usr/include/mupdf -I/usr/local/include/mupdf -Imupdf/thirdparty/freetype/include -I/usr/include/python3.6m -c fitz/fitz_wrap.c -o build/temp.linux-i686-3.6/fitz/fitz_wrap.o
[   74s] fitz/fitz_wrap.c:2771:10: fatal error: ft2build.h: No such file or directory
[   74s]  2771 | #include <ft2build.h>
[   74s]       |          ^~~~~~~~~~~~
[   74s] compilation terminated.
[   74s] error: command 'gcc' failed with exit status 1
[   74s] error: Bad exit status from /var/tmp/rpm-tmp.HkWR6x (%build)

From a quick look at the setup.py, I see the include paths are all hard coded.
It would be nice if https://pypi.org/project/pkgconfig/ was used to grab the required paths.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions