sy6sy2 / xbmc

Kodi is an award-winning free and open source home theater/media center software and entertainment hub for digital media. With its beautiful interface and powerful skinning engine, it's available for Android, BSD, Linux, macOS, iOS and Windows.
https://kodi.tv/
Other
6 stars 1 forks source link

Binary addons not included tvOS #20

Closed phunkyfish closed 5 years ago

phunkyfish commented 5 years ago

They exist on the 17 and 18 releases of Kodi for iOS so it’s likely we missed something.

Either that or we’re doing something wrong in the build so they are not included.

phunkyfish commented 5 years ago

tests with Kodi iOS on jailbreaked iPhone 7 (deb files installed with Filza):

kambala-decapitator commented 5 years ago

so you mean that after being built the addons aren't included in the app bundle?

fuzzard commented 5 years ago

I've got a PR that may fix it. I dont have an ATV on hand to test myself, so ill send the PR through and if one of you guys can test on the ATV. I've only been focusing on pvr addons at this stage.

With the PR, here are my findings

Complete build successful

pvr.vbox pvr.stalker pvr.njoy pvr.filmon pvr.demo

Build failures

pvr.zattoo pvr.wmc pvr.vuplus pvr.vdr.vnsi pvr.teleboy pvr.sledovanitv.cz pvr.pctv pvr.octonet pvr.nextpvr pvr.mythtv pvr.mediaportal.tvserver pvr.hts pvr.dvbviewer pvr.dvblink pvr.argustv pvr.hdhomerun

below error for pvr.hdhomerun (personally the addon i have been updating/monitoring) Undefined symbols for architecture arm64: "_CVGetCurrentHostTime", referenced from: P8PLATFORM::CCondition::Wait(P8PLATFORM::CMutex&, bool&, unsigned int) in client.cpp.o "_CVGetHostClockFrequency", referenced from: P8PLATFORM::CCondition::Wait(P8PLATFORM::CMutex&, bool&, unsigned int) in client.cpp.o ld: symbol(s) not found for architecture arm64

All build failures are similar, with failures stemming from P8Platform and undefined symbols for arm64. Issue may be the patch i provide, but prior to it your not building for tvos when compiling the binary addons.

Undefined symbols for architecture arm64: "_CVGetCurrentHostTime", referenced from: P8PLATFORM::CCondition::Wait(P8PLATFORM::CMutex&, bool&, unsigned int) in PVRIptvData.cpp.o "_CVGetHostClockFrequency", referenced from: P8PLATFORM::CCondition::Wait(P8PLATFORM::CMutex&, bool&, unsigned int) in PVRIptvData.cpp.o ld: symbol(s) not found for architecture arm64

sy6sy2 commented 5 years ago

I opened an issue to discuss about binary addon builds https://github.com/SylvainCecchetto/xbmc/issues/27

phunkyfish commented 5 years ago

Ah, so they are building for a different platform by default?

fuzzard commented 5 years ago

yes, host platform. Here is a full build log with my applied PR for pvr.*

https://paste.ubuntu.com/p/yjR68bDVhx/

kambala-decapitator commented 5 years ago

maybe the solution is to add "tvos" to https://github.com/xbmc/kodi-platform/blob/master/CMakeLists.txt#L32

sy6sy2 commented 5 years ago

Indeed, this one seems to be missing!

sy6sy2 commented 5 years ago

Maybe we can fork this repo (https://github.com/xbmc/kodi-platform/) and modify https://github.com/SylvainCecchetto/xbmc/blob/ATV/cmake/addons/depends/common/kodi-platform/kodi-platform.txt in order to point on our modified fork with "tvos" adding in CMakeLists.txt?

kambala-decapitator commented 5 years ago

yes, sounds correct. and also same issue here https://github.com/xbmc/platform/blob/master/CMakeLists.txt#L33 / https://github.com/SylvainCecchetto/xbmc/blob/ATV/cmake/addons/depends/common/p8-platform/p8-platform.txt

fuzzard commented 5 years ago

https://docs.developer.pv.apple.com/documentation/corevideo/1456915-cvgetcurrenthosttime?changes=latest_minor&language=objc

Spot on. the missing file is from CoreVideo

kambala-decapitator commented 5 years ago

@fuzzard yep, already discovered what is missing, see above :)

sy6sy2 commented 5 years ago

Ok thank you kambala! I am doing this right now

sy6sy2 commented 5 years ago

Done:

phunkyfish commented 5 years ago

So I tried to build with the pvr addons this morning but they still didn’t appear.

Followed these steps:

Am I missing a step or doing something wrong?

phunkyfish commented 5 years ago

@pogarek we are tracking this here. Please feedback on whether or not the pvr addons appear when you deploy/install the builds from upstream master and ATV branch for iOS.

pogarek commented 5 years ago

sure. Where can I see these addons in Kodi ? I have never used PVR addons before :-)

phunkyfish commented 5 years ago

You should just be able to see them from Addons->Install from repository->PVR clients

Alternatively, go to TV in the main menu and select enable PVR addon. If you see addons there then it's working.

phunkyfish commented 5 years ago

I just picked the PVR addons as they build ok. You can use any binary addon you are familiar with if that's easier.

pogarek commented 5 years ago

ok. I'll :

  1. build depends
  2. build pvr addons
  3. generate Xcode project
  4. I'll build and run compiled project on iOS

I was always downloading addons from repositories. So I"ll stick with above plan :-)

pogarek commented 5 years ago

I've built this repo as above. I cannot see "PVR Cients" anywhere , I don't have TV tab . (iPad). When I search for addon , I can only see "Services - KN Switchtimer service"

phunkyfish commented 5 years ago

If you run the deb target and then install do the addons appear?

pogarek commented 5 years ago

I'll try. Building official repo now.

pogarek commented 5 years ago

deb (from official repo ; probably this would behave the same) failed. It want's sudo for some reasons, while I have dedicated account for admin rights , which is different than the one that I use now.

Creating org.xbmc.kodi-ios package version 19.0 revision 0~alpha1
+ /usr/bin/sudo rm -rf ./org.xbmc.kodi-ios
sudo: no tty present and no askpass program specified
make: *** [/Users/xxx/gitrepos/kodi-ios/official_master/kodi-build/CMakeFiles/deb] Error 1
phunkyfish commented 5 years ago

Hmmm. Strange

pogarek commented 5 years ago

indeed. I'm stuck. Got the error for the 1st time, when I was trying to make deb for tvos ..

pogarek commented 5 years ago

@SylvainCecchetto - any idea ? I've just seen new PR with 'deb' changes

sy6sy2 commented 5 years ago

I never try to use 'deb target' from the official repo source code. For my tests on my iPhone I only directly installed deb files downloaded from http://mirrors.kodi.tv/releases/darwin/ios/

Maybe you can checkout your local repo to the newly created upstream/Leia branch to be sure that is not a recent commit modification in master that breaks everything?

pogarek commented 5 years ago

I did "git pull" yesterday, before trying.. If I recall correctly, /Users/Shared/xbmc-depends/x86_64-darwin17.5.0-native/bin/cmake --build . --target "deb" --config "Debug" , for TVOS and from this branch , wanted to call sudo as well.

kambala-decapitator commented 5 years ago

in the ATV branch sudo isn't called for me and all is ok, but I saw calls to fakesudo.

pogarek commented 5 years ago

I'll try ATV branch again in a few hours and I'll let you know.

pogarek commented 5 years ago

so I did:

Packaging Debug target for iOS
+ APP=./../../../../build/Debug-iphoneos/Kodi.app
+ DSYM=./../../../../build/Debug-iphoneos/Kodi.app.dSYM
++ lipo -info ./../../../../build/Debug-iphoneos/Kodi.app/Kodi
++ awk '{print $NF}'
+ [[ arm64 == \a\r\m\6\4 ]]
+ ARM64=true
+ '[' -d ./../../../../build/Debug-iphoneos/Kodi.app.dSYM ']'
+ '[' -d /Users/Shared/xbmc-depends/dSyms ']'
+ '[' '!' -d ./../../../../build/Debug-iphoneos/Kodi.app ']'
++ csrutil status
++ grep enabled
+ '[' -f /Users/Shared/xbmc-depends/x86_64-darwin18.5.0-native/bin/fakeroot -a 'System Integrity Protection status: enabled.x' == x ']'
+ '[' -f /usr/bin/sudo ']'
+ SUDO=/usr/bin/sudo
+ '[' -f /Users/Shared/xbmc-depends/x86_64-darwin18.5.0-native/bin/dpkg-deb ']'
++ cd /Users/Shared/xbmc-depends/x86_64-darwin18.5.0-native/bin
++ pwd
+ bin_path=/Users/Shared/xbmc-depends/x86_64-darwin18.5.0-native/bin
+ export PATH=/Users/Shared/xbmc-depends/x86_64-darwin18.5.0-native/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
+ PATH=/Users/Shared/xbmc-depends/x86_64-darwin18.5.0-native/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
+ PACKAGE=org.xbmc.kodi-ios
+ PACKAGE_ARM64=org.xbmc.kodi-ios64
+ VERSION=18.2
+ REVISION=0
+ '[' rc1 '!=' '' ']'
+ REVISION=0~rc1
+ '[' '!' -z '' ']'
+ ARCHIVE=org.xbmc.kodi-ios_18.2-0~rc1_iphoneos-arm.deb
+ true
+ ARCHIVE=org.xbmc.kodi-ios64_18.2-0~rc1_iphoneos-arm.deb
++ du -s -k ./../../../../build/Debug-iphoneos/Kodi.app
++ awk '{print $1}'
+ SIZE=265224
+ echo Creating org.xbmc.kodi-ios package version 18.2 revision 0~rc1
Creating org.xbmc.kodi-ios package version 18.2 revision 0~rc1
+ /usr/bin/sudo rm -rf ./org.xbmc.kodi-ios
sudo: no tty present and no askpass program specified
make: *** [/Users/piotr/gitrepos/kodi-ios/SylvainCecchetto/kodi-build/CMakeFiles/deb] Error 1
Command /bin/sh failed with exit code 2
kambala-decapitator commented 5 years ago

so SIP makes the difference (mine is disabled, that's why sudo isn't called). But that's quite strange that running in terminal thinks that "no tty present"...

kambala-decapitator commented 5 years ago

I wonder why sudo is needed in the first place... The only command that actually requires it is setting owner to root, but I have no idea why that is needed as well. Or is Jenkins running builds in the root directory or as root? (which doesn't make much sense to me as well)

phunkyfish commented 5 years ago

And this: /usr/bin/sudo rm -rf ./org.xbmc.kodi-ios

kambala-decapitator commented 5 years ago

is it allowed to open issues in kodi repo just to ask a question (this strange sudo thing)? Or better just make a PR and then wait for the feedback?

phunkyfish commented 5 years ago

Let’s try slack for it maybe?

fuzzard commented 5 years ago

Questions will be told to go to forums I believe

kambala-decapitator commented 5 years ago

@phunkyfish yep, nice idea!

pogarek commented 5 years ago

I managed to build deb for iOS, uploaded it to my iPad. Still not seeing PVR addons . Deb file is 78,7 MB.

($home/kodi/tools/depends: ./bootstrap , ./configure ,make $home/kodi : build pvr addons, $home/kodi-build: generate Xcode project , build 'deb' with Xcodebuild

:(

phunkyfish commented 5 years ago

Ok, we are missing something somewhere. Let me ask on slack.

pogarek commented 5 years ago

I'm trying to build deb on master from official, with all addons. I'll report once it is done and about the outcome .

EDIT: got the same result : 78.1 MB of IPA file. Not seeing pvr addons.

So I have downloaded http://mirrors.kodi.tv/releases/darwin/ios-arm64/org.xbmc.kodi-ios_18.2-0_iphoneos-arm64.deb and made IPA. That one has 81,9 MB. And there are plenty of options in Addons/My add-ons section, including PVR clients. So yes - we are missing something in Readme for iOS/tvos .

I can do another attempt tomorrow.

P.S. XBMC/Master is on 19.0.alpha now.

fuzzard commented 5 years ago

No point building. We were pointed to a specific Jenkins step that does the binary add-ons by Rechi, and that is why releases/Jenkins builds have add-ons. The Xcode project is missing a step that needs to be added. Haven't had time to look into it

phunkyfish commented 5 years ago

Ok, at least we are getting closer to the answer.

pogarek commented 5 years ago

@fuzzard suggested on slack to change line https://github.com/SylvainCecchetto/xbmc/blob/003fd5267be64cc38792cdd5babf38d4e55323a6/CMakeLists.txt#L426-L426 to

if(CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "Xcode")

I've tested on for iOS on official repo , but it didn't helped: deb 50.1 MB (vs 56 MB from offcial repo) , IPA 78.1 MB (vs 81.9 MB after signing official deb . I didn't tried to run it - it doesn't make sense..

pogarek commented 5 years ago

I've just tried to build 'deb' target for tvos from branch 'ATV-cmake-generation". it failed with :

checking if : is a manifest tool... no
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/Users/piotr/gitrepos/kodi-tvos/SylvainCecchetto/kodi/lib/cpluff':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
make: *** [/Users/piotr/gitrepos/kodi-tvos/SylvainCecchetto/kodi-build/build/cpluff/src/libcpluff-stamp/Debug-appletvos/libcpluff-configure] Error 1

** BUILD FAILED **

The following build commands failed:
    PhaseScriptExecution CMake\ Rules /Users/piotr/gitrepos/kodi-tvos/SylvainCecchetto/kodi-build/kodi.build/Debug-appletvos/libcpluff.build/Script-68A0BC45C2704718ABA002A1.sh
(1 failure)

If you need my help with any test of building target, testing builds on devices - just let me know. For now I'm awaiting instructions :-)

phunkyfish commented 5 years ago

This shouldn’t work anyway as that branch currently only works to generation of the Xcode project.

We’ll update it shortly so it works for a full build.

However until @fuzzard or someone else gets a chance to add the binary addons target for Xcode you can take a rest 😉

phunkyfish commented 5 years ago

This should help: https://forum.kodi.tv/showthread.php?tid=343197&pid=2847828#pid2847828

pogarek commented 5 years ago

Awesome. I didn't understood what needs to be modified/fixed so I can't do it . But awesome :-)

phunkyfish commented 5 years ago

Essentially what Rechi is saying is that the binary addons only get built and installed as part of Jenkins CI. Currently this doesn’t work if you are building yourself.

The current process builds the dependencies, the binary addons and then the project is generated.

So we can’t install the binary addons as the build directory doesn’t exist yet.

Once the new branch is ready and working we can revisit this and fix it for iOS and tvOS.

We will need to add something to the generation step and then build the binary addons as part of the Xcode build.