Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apk build error: bzlib.h: No such file or directory #1854

Closed
Fak3 opened this issue Jun 9, 2019 · 7 comments · Fixed by #1857
Closed

apk build error: bzlib.h: No such file or directory #1854

Fak3 opened this issue Jun 9, 2019 · 7 comments · Fixed by #1857

Comments

@Fak3
Copy link

Fak3 commented Jun 9, 2019

os: openSUSE tumlbeweed linux
p4a version: git master
android ndk version: r17c

I tried to build apk with p4a:
p4a apk --private /home/z/pproj/paradox_ssh/ --version=1.7 --bootstrap=sdl2 --local-recipes=./recipes --requirements=python3,kivy-async,openssl,sqlite3,pil,requests,sdl2,plyer --whitelist=./whitelist.txt --permission=CALL_PHONE --permission=INTERNET --orientation=portrait --package=org.spbelect.paradox2 --name="paradox2" --release

The build failed with an error:

/home/u1/.local/share/python-for-android/build/other_builds/freetype/armeabi-v7a__ndk_target_19/freetype/src/bzip2/ftbzip2.c:52:19: fatal error: bzlib.h: No such file or directory
#include <bzlib.h>
^
compilation terminated.

full p4a stdout: https://gist.github.com/Fak3/5fca7ea090ddcc78be30571c8f4f91d8

I do have bzlib headers installed:

> rpm -ql libbz2-devel
/usr/include/bzlib.h
/usr/lib64/libbz2.so
/usr/lib64/pkgconfig/bzip2.pc
/usr/share/doc/packages/libbz2-devel
/usr/share/doc/packages/libbz2-devel/CHANGES
/usr/share/licenses/libbz2-devel
/usr/share/licenses/libbz2-devel/LICENSE

But somehow recipe cannot find the headers

@opacam
Copy link
Member

opacam commented Jun 10, 2019

I think that your problem is that you are trying to build with ndk-api=19, you should use at least 21, try adding --ndk-api=21 to your p4a build command (but first remove any build made with ndk-api 19)

See also:

@Fak3
Copy link
Author

Fak3 commented Jun 10, 2019

@opacam Just tried to do that - changed NDKAPI env var to 21, and removed the ~/.local/share/python-for-android/
Got the same error.

@opacam
Copy link
Member

opacam commented Jun 10, 2019

Well then, we may have a bug in openSUSE, could you share the freetype's config.log?

Note: Given your filesystem and target Arch it should be at:

  • ~/.local/share/python-for-android/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/builds/unix/

@Fak3
Copy link
Author

Fak3 commented Jun 10, 2019

@Fak3
Copy link
Author

Fak3 commented Jun 10, 2019

I have also installed autoconf, automake, and libtool to get rid of the first three warnings by p4a, but it changed nothing.

opacam added a commit to opacam/python-for-android that referenced this issue Jun 10, 2019
To fix freetype build for `openSUSE` and maybe other oses.

Note: It seems that there is a bug in `bzip2-devel` for debian and derivatives which are distributed without a `pkg-config` file, so when we compile freetype with a debian os (or derivative) we build it without bzip2 support, so we enforce to disable bzip2 support, because we know that freetype works fine without bzip2 support

Resolves: kivy#1854
@opacam
Copy link
Member

opacam commented Jun 10, 2019

I think that I found what happen here:

The thing is that, for debian os and derivatives, there is a bug because the pkg-config is not distributed alongside the bzip2-devellibbz2-dev (libbz2-devel for openSuse) package, so when we build freetype we don't get bzip2 support , not your case with openSuse, which it finds the pkg-config and tries to use that (Checking your freetype's configure.log against mine, I noticed that your compilation is using bzip2 and it clearly fails, but my bzip2 library is never found because of the missing pkg-config file)

See also: https://gist.github.com/Fak3/5684594ac9b3c8a72eff15f8b55e08ff#file-config-log-L896

Could you try if the solution posted at #1857 works for you?

opacam added a commit to opacam/python-for-android that referenced this issue Jun 10, 2019
To fix freetype build for `openSUSE` and maybe other oses.

Note: It seems that there is a bug in `bzip2-devel` for debian and derivatives which are distributed without a `pkg-config` file, so when we compile freetype with a debian os (or derivative) we build it without bzip2 support, so we enforce to disable bzip2 support, because we know that freetype works fine without bzip2 support

Resolves: kivy#1854
@Fak3
Copy link
Author

Fak3 commented Jun 10, 2019

Thanks! It worked

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 a pull request may close this issue.

2 participants