How to install build dependencies inside flatpak-builder?

158 Views Asked by At

I am trying to build/package a software I have been developing using flatpak for the first time. Some modules' configure scripts seek presence of python and gtk+-2.0 or newer. I have all those dependencies installed on the system and when I try to compile it directly, everything works. Inside flatpak-builder, however, the same script complains that I am trying to cross-compile, so I had to add --host=host flag to the configure script. This has helped pass the cross-compile test. However, now the build process fails because configure script, when run inside flatpak-builder fails to detect gtk+-2.0-dev libraries. Why is this so and how can I install gtk+-2.0-dev library just for building purposes inside flatpak-builder, and then not include it in the final built package (it is only required for a portion of demo tools associated with a library, something my app is not using, yet I have to build this way because that is the only way the build process of this supporting library succeeds)? Thank you.

I ran flatpak-builder and it failed with the following output (the same works fine when ran directly):

cd /run/build/pd-externals/externals/disis/cwiid && aclocal && autoconf && \
    ./configure --with-python=python --host=host && make
configure.ac:31: warning: The macro `AC_CONFIG_HEADER' is obsolete.
configure.ac:31: You should run autoupdate.
../lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from...
configure.ac:31: the top level
configure.ac:35: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete
../lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from...
../lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from...
configure.ac:35: the top level
configure.ac:87: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:87: You should run autoupdate.
../lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:87: the top level
configure.ac:101: warning: The macro `AC_ISC_POSIX' is obsolete.
configure.ac:101: You should run autoupdate.
../lib/autoconf/specific.m4:550: AC_ISC_POSIX is expanded from...
configure.ac:101: the top level
configure.ac:103: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:103: You should run autoupdate.
../lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:103: the top level
configure.ac:112: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:112: You should run autoupdate.
../lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:112: the top level
configure.ac:121: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:121: You should run autoupdate.
../lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:121: the top level
configure.ac:135: warning: AC_OUTPUT should be used without arguments.
configure.ac:135: You should run autoupdate.
checking for host-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking for gawk... gawk
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... none required
checking whether yytext is a pointer... yes
checking for bison... bison -y
checking for python... python
checking for pthread_create in -lpthread... yes
checking for hci_devid in -lbluetooth... yes
checking for dlopen in -ldl... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for stdint.h... (cached) yes
checking for bluetooth/bluetooth.h... yes
checking for bluetooth/l2cap.h... yes
checking for bluetooth/hci.h... yes
checking for linux/input.h... yes
checking for linux/uinput.h... yes
checking for library containing strerror... none required
checking for host-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking for gtk+-2.0 >= 2.0.0 gthread-2.0... no
configure: error: Package requirements (gtk+-2.0 >= 2.0.0 gthread-2.0) were not met:

Package 'gtk+-2.0', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GTK_CFLAGS
and GTK_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
make: *** [Makefile:495: disis] Error 1
0

There are 0 best solutions below