Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 629040

Summary: Building qtandroidextras issue (dev-qt/qtcore)
Product: Gentoo Linux Reporter: Alex Tsokurov <aximik>
Component: Current packagesAssignee: Qt Bug Alias <qt>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Alex Tsokurov 2017-08-27 09:06:41 UTC
I'm trying to build qtandroidextras from git, but having errors like 

droidactivityresultreceiver.o:qandroidactivityresultreceiver.cpp:function QAndroidActivityResultReceiver::QAndroidActivityResultReceiver(): error: undefined reference to 'QtAndroidPrivate::registerActivityResultListener(QtAndroidPrivate::ActivityResultListener*)' 

I think the issue is /private part libraries is missing from QtCore package. Here is ebuild (rather dirty) I've created to build the library.

EAPI=6
QT5_MODULE="qtandroidextras"
inherit qt5-build

DESCRIPTION="Provides platform-specific APIs for Android"

if [[ ${QT5_BUILD_TYPE} == release ]]; then
        KEYWORDS="amd64 arm ~arm64 ~hppa ppc64 x86"
fi


RDEPEND="
        >=virtual/jdk-1.7
        ~dev-qt/qtcore-${PV}
"
DEPEND="${RDEPEND}"

QT5_TARGET_SUBDIRS=(
        src/androidextras
)

pkg_setup() {
        export CXXFLAGS="$CXXFLAGS -I/etc/java-config-2/current-system-vm/include -I/etc/java-config-2/current-system-vm/include/linux"
} 

Reproducible: Always

Steps to Reproduce:
1. Put ebuild to /usr/portage/dev-qt/qtandroidextras/qtandroidextras-5.7.1.ebuild
2. ebuild qtandroidextras-5.7.1.ebuild manifest clean merge
Actual Results:  
Having linking error

Expected Results:  
qtandroidextras should be merged

dev-qt/qtcore-5.7.1-r3:5/5.7::gentoo  USE="icu -debug -systemd {-test}"
Comment 1 Davide Pesavento (RETIRED) gentoo-dev 2017-08-31 00:25:35 UTC
You can't expect to be able to build qtandroidextras against a qtcore built for linux.

You need to do a custom build of qtcore for android, and then build qtandroidextras against that.
Comment 2 Alex Tsokurov 2017-08-31 12:28:38 UTC
(In reply to Davide Pesavento from comment #1)
> You can't expect to be able to build qtandroidextras against a qtcore built
> for linux.
> 
> You need to do a custom build of qtcore for android, and then build
> qtandroidextras against that.

It doesn't make sense.

1. I have functions definitions in header files, so the object file should have such functions.
2. qtandroidextras is not android version of Qt, it's the set of tools to develop Qt/Android on Linux.
Comment 3 Davide Pesavento (RETIRED) gentoo-dev 2017-08-31 16:49:36 UTC
(In reply to Alex Tsokurov from comment #2)
> 1. I have functions definitions in header files, so the object file should
> have such functions.

Not necessarily. The header declaring that function is supposed to be included only `#if defined(Q_OS_ANDROID)`, which is false on linux.

Also, src/corelib/kernel/kernel.pri has:

android {
	SOURCES += \
                   kernel/qjnionload.cpp \
                   kernel/qjnihelpers.cpp \
                   kernel/qjni.cpp
        HEADERS += \
                   kernel/qjnihelpers_p.h \
                   kernel/qjni_p.h
}

So again, they're not built on linux.

> 2. qtandroidextras is not android version of Qt, it's the set of tools to
> develop Qt/Android on Linux.

Yep, but you need to have a version of Qt built for your target platform (i.e. android) somewhere.