Android Impossible to build vfs.sftp for Android
#1
There doesn't appear to be a way to build this for usage on Android. It's not included in the APK despite the main instructions, or able to generate an installable zip. I'm Building in Docker amd64 for Android arm 32bit.

This is in relation to: https://github.com/xbmc/vfs.sftp/pull/114
After spending days on fiddling with the build system I've completely given up:  https://github.com/xbmc/xbmc/issues/22835
I'm also working on this: https://github.com/xbmc/xbmc/pull/22799
Reply
#2
Honestly the best way is to build the addon independently.
Its quicker, and isnt tied to any apk. Android can load binary addons via zip install, so the update process is just uninstall/reinstall from zip.

With that said. if you MUST build the addon as part of the apk, one way to do it is to fork https://github.com/xbmc/repo-binary-addons, and then in the dir of the addon you are wanting to  build, change the repo in the text file to point at your fork of the addon. eg https://github.com/xbmc/repo-binary-addo...s.sftp.txt

in the kodi checkout, you then change https://github.com/xbmc/xbmc/blob/master...addons.txt to point at your fork of repo-binary-addons and use the DOCUMENTED binary addon build procedures.

Because im trying to be helpful, even though i believe you have been very aggressive and combative, my notes for building individual addons for android are as follows (i use a mac, change paths as suitable)
Quote:SINGLE addon

clone kodi
bootstrap/configure tools/depends as per normal

Alter toolchain_binaddons.cmake file to swap out @CMAKE_FIND_ROOT_PATH@ to actual path of depends in addon build dir (eg /Users/username/Dev/pvr.hdhomerun/build/build/depends)

clone addon

cd addon dir, mkdir build and cd build

/Users/Shared/xbmc-depends/arm-darwin21.6.0-native/bin/cmake -DCMAKE_TOOLCHAIN_FILE=/Users/Shared/xbmc-depends/aarch64-linux-android-31-debug/share/Toolchain_binaddons.cmake -DADDONS_TO_BUILD=pvr.hdhomerun -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../<clonedirname>/addons -DPACKAGE_ZIP=1 ../../<clonedirname>/cmake/addons

This will build and install the addon into my kodi cloned dir inside the addons folder. The core build just copies everything from the addons folder into the addons folder of the apk, but again, just zip the dir and install as zip file is the best way for addon dev imo.

The key thing that most addon docs dont mention is to utilise the toolchain_binaddons.cmake generated file for those platforms that use it (Anything apple, Android). It has all the normal flags/tool locations as used by the kodi build. The packaged core system does a sed replace of @CMAKE_FIND_ROOT_PATH@ when building each addon in the toolchain_binaddons.cmake file, hence the manual alteration when targeting an individual addon.
Reply
#3
Invoking `make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons ADDONS="vfs.sftp"` twice gives me the error that there's nothing to be done for "all" despite the source changing.
Reply
#4
Thats because it doesnt know anything about git changes. All it has is a pointer to a branch on a repo.

Do a make -C tools/depends/target/binary-addons clean and then just rebuild as you have tried
Reply
#5
(2023-02-21, 11:35)Fuzzard Wrote: Thats because it doesnt know anything about git changes. All it has is a pointer to a branch on a repo.

Do a make -C tools/depends/target/binary-addons clean and then just rebuild as you have tried

Oh man my directory was completely messed up. Did a full dir clean and git reset --hard and it seemed to work better (no double patch application errors / etc).

Thank you very much for your help. I'll sleep on it and see if I can at least document the above reasonably on the binary addons page so the next person has a shot.
Quote:/Users/Shared/xbmc-depends/arm-darwin21.6.0-native/bin/cmake -DCMAKE_TOOLCHAIN_FILE=/Users/Shared/xbmc-depends/aarch64-linux-android-31-debug/share/Toolchain_binaddons.cmake -DADDONS_TO_BUILD=pvr.hdhomerun -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../<clonedirname>/addons -DPACKAGE_ZIP=1 ../../<clonedirname>/cmake/addons
 
Do you know why this can't be picked up by the configured environment (if we're already running its cmake/addons script)? I'm guessing just no one has done it yet?
Reply
#6
Im not sure i understand your last question.

Some context, and hopefully this may give you the info maybe.

The addon system is made to be independent of kodi. There is only 1 binary addon that is considered required (peripheral.joystick), everything else is entirely optional.
I believe the system was built around dev for windows/linux. We do not use toolchains for those platforms for whatever reason (predates my involvement with the project).

If you look at the Makefile in tools/depends/target/binary-addons it ill point you to https://github.com/xbmc/xbmc/blob/master...ns.include where you will see the make rules, of which they pretty much just spell out my notes from above, including the sed replacement and copy of the toolchain_binaddons.cmake file into the addons build dir for use. This Makefile is purely a helper. the actual cmake build is entirely separate, and the make system just has no idea about inputs/outputs of a cmake build. The only thing the makefile monitors (without diving into make specifics) is the file that is created .installed-$(PLATFORM) (eg .installed-aarch64-linux-android-21-debug). Hence why changing anything in the cmake based addon build has no effect when rerunning the make wrapper. Its just not smart enough for that.

So, touching back on the whole independent thing, there is no configured environment. It only knows what you provide it in your cmake stanza. You can provide CC, AR, CFLAGS, etc in your cmake command, and thats essentially all the toolchain file does for platforms that generate one (Android, Apple).

We generate a toolchain file because its easy when we configure core to dump the same configure options into a toolchain for binaddons, but the core configure has at no point an understanding of addons, and any paths associated with them, hence the sed replacements from the addon cmake system.

So to sum it all up, they are two independent cmake systems. There is/was work to pull out the Addon Dev headers to essentially make the requirement of a clone of core not required for an addon, which would then make it more obvious/clear about the distinction between the two systems, but that still doesnt change the fact that for addons you need to provide all the appropriate build arguments one way or another (stanza or toolchain)
Reply

Logout Mark Read Team Forum Stats Members Help
Impossible to build vfs.sftp for Android0