|
|
Line 83: |
Line 83: |
| $KODI_ROOT/kodi/tools/depends/native/automake-native/x86_64-linux-native$ vi bin/automake.in | | $KODI_ROOT/kodi/tools/depends/native/automake-native/x86_64-linux-native$ vi bin/automake.in |
| <br> | | <br> |
| --- automake.in 2015-01-06 03:25:55.000000000 +0800
| | For building Kodi 17 on Bionic fixes see [[Kodi Krypton Fixes]] |
| +++ automake.in.patched 2017-07-26 13:58:07.086205701 +0800
| |
| @@ -3878,7 +3878,7 @@
| |
| sub substitute_ac_subst_variables
| |
| {
| |
| my ($text) = @_;
| |
| - $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
| |
| + $text =~ s/\$\{([^ \t=:+{}]+)\}/substitute_ac_subst_variables_worker ($1)/ge;
| |
| return $text;
| |
| }
| |
| <br>
| |
| Fix $KODI_ROOT=/android-tools/xbmc-depends/x86_64-linux-gnu-native/include/gif_lib.h
| |
| --- /tmp/gif_lib.h 2018-12-29 16:30:47.441889499 +1300
| |
| +++ /media/iwiseman/Segate/Kypton/android-tools/xbmc-depends/x86_64-linux-gnu-native/include/gif_lib.h 2018-12-29 16:32:05.610388400 +1300
| |
| @@ -20,6 +20,7 @@
| |
|
| |
| #include <stddef.h>
| |
| #include <stdbool.h>
| |
| +#include <stdlib.h>
| |
|
| |
| #define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */
| |
| #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
| |
| @@ -245,7 +246,7 @@
| |
| extern int GifBitSize(int n);
| |
|
| |
| extern void *
| |
| -reallocarray(void *optr, size_t nmemb, size_t size);
| |
| +reallocarray(void *optr, size_t nmemb, size_t size) __THROW __attribute_warn_unused_result__;
| |
|
| |
| /******************************************************************************
| |
| Support for the in-core structures allocation (slurp mode).
| |
|
| |
| Fix up Google Breakpad
| |
| find $KODI_ROOT/kodi/tools/depends/native/google-breakpad-native/x86_64-linux-native -type f -name "*.cc" -print0 | xargs -0 sed -i 's/struct ucontext/ucontext_t/g'
| |
| find $KODI_ROOT/kodi/tools/depends/native/google-breakpad-native/x86_64-linux-native -type f -name "*.h" -print0 | xargs -0 sed -i 's/struct ucontext/ucontext_t/g'
| |
| find $KODI_ROOT/kodi/tools/depends/native/google-breakpad-native/x86_64-linux-native -type f -name "*.cc" -print0 | xargs -0 sed -i 's/const ucontext /const ucontext_t /g'
| |
| find $KODI_ROOT/kodi/tools/depends/native/google-breakpad-native/x86_64-linux-native -type f -name "*.h" -print0 | xargs -0 sed -i 's/const ucontext /const ucontext_t /g'
| |
|
| |
|
| Fix zlib to have -fPIC use in zlib Makefile<br>
| |
| --- /tmp/Makefile 2018-12-29 18:57:38.613221546 +1300
| |
| +++ Makefile 2018-12-29 18:57:52.519113900 +1300
| |
| @@ -15,6 +15,7 @@
| |
| # make install
| |
| # To install in $HOME instead of /usr/local, use:
| |
| # make install prefix=$HOME
| |
| +override CFLAGS += -fPIC
| |
|
| |
| <br>
| |
|
| |
| Fix libffi
| |
| --- /tmp/Makefile 2018-12-29 19:10:26.968270997 +1300
| |
| +++ Makefile 2018-12-29 19:12:19.541011200 +1300
| |
| @@ -1,5 +1,5 @@
| |
| include ../../Makefile.include
| |
| -DEPS= ../../Makefile.include Makefile
| |
| +DEPS= ../../Makefile.include Makefile armAssembler.patch
| |
|
| |
| # lib name, version
| |
| LIBNAME=libffi
| |
| @@ -8,13 +8,7 @@
| |
| ARCHIVE=$(SOURCE).tar.gz
| |
|
| |
| # configuration settings
| |
| -CONFIGURE= ./configure --prefix=$(PREFIX) --disable-shared --disable-builddir
| |
| -ifeq ($(OS), ios)
| |
| -ifneq ($(CPU), arm64)
| |
| -CONFIGURE+=CCASFLAGS=-no-integrated-as
| |
| -endif
| |
| -endif
| |
| -
| |
| +CONFIGURE= ./configure --prefix=$(PREFIX) --disable-shared --disable-builddir
| |
|
| |
| LIBDYLIB=$(PLATFORM)/.libs/$(LIBNAME).a
| |
|
| |
| @@ -26,6 +20,7 @@
| |
| $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
| |
| rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
| |
| cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
| |
| + cd $(PLATFORM); patch -p1 -i ../armAssembler.patch
| |
| cd $(PLATFORM); $(CONFIGURE)
| |
|
| |
| $(LIBDYLIB): $(PLATFORM)
| |
|
| |
| Create file the patch armAssembler.patch in the Makefile directory
| |
| --- a/src/arm/sysv.S
| |
| +++ b/src/arm/sysv.S
| |
| @@ -360,7 +360,7 @@
| |
| cmp r0, #3
| |
| sub ip, fp, #64
| |
| flddle d0, [ip]
| |
| - fldmiadgt ip, {d0-d7}
| |
| + vldmiagt ip, {d0-d7}
| |
|
| |
| LSYM(Lbase_args):
| |
| @ move first 4 parameters in registers
| |
| @@ -396,7 +396,7 @@
| |
| beq LSYM(Lepilogue_vfp)
| |
|
| |
| cmp r3, #FFI_TYPE_SINT64
| |
| - stmeqia r2, {r0, r1}
| |
| + stmiaeq r2, {r0, r1}
| |
| beq LSYM(Lepilogue_vfp)
| |
|
| |
| cmp r3, #FFI_TYPE_FLOAT
| |
| @@ -409,7 +409,7 @@
| |
|
| |
| cmp r3, #FFI_TYPE_STRUCT_VFP_FLOAT
| |
| cmpne r3, #FFI_TYPE_STRUCT_VFP_DOUBLE
| |
| - fstmiadeq r2, {d0-d3}
| |
| + vstmiaeq r2, {d0-d3}
| |
|
| |
| LSYM(Lepilogue_vfp):
| |
| RETLDM "r0-r3,fp"
| |
| @@ -420,7 +420,7 @@
| |
|
| |
|
| |
| ARM_FUNC_START(ffi_closure_VFP)
| |
| - fstmfdd sp!, {d0-d7}
| |
| + vstmdb sp!, {d0-d7}
| |
| @ r0-r3, then d0-d7
| |
| UNWIND .pad #80
| |
| add ip, sp, #80
| |
| @@ -470,10 +470,10 @@
| |
| ldmia sp, {r0, r1}
| |
| b .Lclosure_epilogue_vfp
| |
| .Lretfloat_struct_vfp:
| |
| - fldmiad sp, {d0-d1}
| |
| + vldmia sp, {d0-d1}
| |
| b .Lclosure_epilogue_vfp
| |
| .Lretdouble_struct_vfp:
| |
| - fldmiad sp, {d0-d3}
| |
| + vldmia sp, {d0-d3}
| |
| b .Lclosure_epilogue_vfp
| |
|
| |
| .ffi_closure_VFP_end:
| |
|
| |
| Fix python
| |
| --- /tmp/pythonrun.c 2018-12-29 19:33:17.869754505 +1300
| |
| +++ ./target/python27/arm-linux-androideabi-android-24/Python/pythonrun.c 2018-12-29 19:33:38.918419700 +1300
| |
| @@ -294,51 +294,6 @@
| |
| overridden = 1;
| |
| }
| |
|
| |
| -#if defined(Py_USING_UNICODE) && defined(HAVE_LANGINFO_H) && defined(CODESET)
| |
| - /* On Unix, set the file system encoding according to the
| |
| - user's preference, if the CODESET names a well-known
| |
| - Python codec, and Py_FileSystemDefaultEncoding isn't
| |
| - initialized by other means. Also set the encoding of
| |
| - stdin and stdout if these are terminals, unless overridden. */
| |
| -
| |
| - if (!overridden || !Py_FileSystemDefaultEncoding) {
| |
| - saved_locale = strdup(setlocale(LC_CTYPE, NULL));
| |
| - setlocale(LC_CTYPE, "");
| |
| - loc_codeset = nl_langinfo(CODESET);
| |
| - if (loc_codeset && *loc_codeset) {
| |
| - PyObject *enc = PyCodec_Encoder(loc_codeset);
| |
| - if (enc) {
| |
| - loc_codeset = strdup(loc_codeset);
| |
| - Py_DECREF(enc);
| |
| - } else {
| |
| - if (PyErr_ExceptionMatches(PyExc_LookupError)) {
| |
| - PyErr_Clear();
| |
| - loc_codeset = NULL;
| |
| - } else {
| |
| - PyErr_Print();
| |
| - exit(1);
| |
| - }
| |
| - }
| |
| - } else
| |
| - loc_codeset = NULL;
| |
| - setlocale(LC_CTYPE, saved_locale);
| |
| - free(saved_locale);
| |
| -
| |
| - if (!overridden) {
| |
| - codeset = icodeset = loc_codeset;
| |
| - free_codeset = 1;
| |
| - }
| |
| -
| |
| - /* Initialize Py_FileSystemDefaultEncoding from
| |
| - locale even if PYTHONIOENCODING is set. */
| |
| - if (!Py_FileSystemDefaultEncoding) {
| |
| - Py_FileSystemDefaultEncoding = loc_codeset;
| |
| - if (!overridden)
| |
| - free_codeset = 0;
| |
| - }
| |
| - }
| |
| -#endif
| |
| -
| |
| #ifdef MS_WINDOWS
| |
| if (!overridden) {
| |
| icodeset = ibuf;
| |
| Fix libxml2
| |
| --- /tmp/Makefile 2018-12-29 19:40:06.017621137 +1300
| |
| +++ Makefile 2018-12-29 19:40:35.767996300 +1300
| |
| @@ -19,6 +19,8 @@
| |
|
| |
|
| |
|
| |
| + override CFLAGS += -fPIC
| |
| +
| |
| pkgdatadir = $(datadir)/libxml2
| |
| pkgincludedir = $(includedir)/libxml2
| |
| pkglibdir = $(libdir)/libxml2
| |
|
| |
| Fix samba gpl v3
| |
| --- /tmp/winbind_struct_protocol.h 2018-12-30 11:25:22.841406202 +1300
| |
| +++ ./target/samba-gplv3/arm-linux-androideabi-android-24/nsswitch/winbind_struct_protocol.h 2018-12-30 11:22:03.676891000 +1300
| |
| @@ -186,6 +186,11 @@
| |
| WINBINDD_NUM_CMDS
| |
| };
| |
|
| |
| +
| |
| +#if defined(ANDROID) && defined(pw_gecos)
| |
| +#undef pw_gecos
| |
| +#endif
| |
| +
| |
| typedef struct winbindd_pw {
| |
| fstring pw_name;
| |
| fstring pw_passwd;
| |
|
| |
| Build tools and dependencies<br> | | Build tools and dependencies<br> |
| make -j$(getconf _NPROCESSORS_ONLN) | | make -j$(getconf _NPROCESSORS_ONLN) |
Building Kodi on Linux
Set root directory
export KODI_ROOT=$HOME/dev
Make sure git is installed
sudo apt install git
Change to your home directory
cd $KODI_ROOT
Clone Kodi's current master branch
git clone https://github.com/xbmc/xbmc kodi
Add Kodi's nightly PPA to grab dependencies
sudo add-apt-repository -s ppa:team-xbmc/xbmc-nightly
Super-duper magic command to get the build dependencies
sudo apt build-dep kodi
You can install ccache (optional)
sudo apt install ccache
Create an out-of-source build directory
mkdir $KODI_ROOT/kodi-build
Change to build directory
cd $KODI_ROOT/kodi-build
Configure build for X11
cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local
Build Kodi
cmake --build . -- VERBOSE=1 -j$(getconf _NPROCESSORS_ONLN)
Build all add-ons
cd $/KODI_ROOTkodi
sudo make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons PREFIX=/usr/local
Building Kodi on Android
Get SDK and NDK
[NDK]
[SDK]
Set root directory
export KODI_ROOT=$HOME/dev
Unzip software
mkdir -p $KODI_ROOT/android-tools/android-sdk-linux
unzip $KODI_ROOT/Downloads/sdk-tools-linux-4333796.zip -d $KODI_ROOT/android-tools/android-sdk-linux
unzip $KODI_ROOT/Downloads/android-ndk-r18b-linux-x86_64.zip -d $KODI_ROOT/android-tools
Accept Licenses
cd $KODI_ROOT/android-tools/android-sdk-linux/tools/bin
./sdkmanager --licenses
./sdkmanager platform-tools
./sdkmanager "platforms;android-26"
./sdkmanager "build-tools;25.0.3"
Change to Android NDK tools directory
cd $KODI_ROOT/android-tools/android-ndk-r18b/build/tools
Set up toolchain
./make-standalone-toolchain.sh --install-dir=$KODI_ROOT/android-tools/arm-linux-androideabi-vanilla/android-21 --platform=android-21 --toolchain=arm-linux-androideabi
Create a key to sign
keytool -genkey -keystore ~/.android/debug.keystore -v -alias androiddebugkey -dname "CN=Android Debug,O=Android,C=US" -keypass android -storepass android -keyalg RSA -keysize 2048 -validity 10000
Clone Kodi's current master branch
cd $KODI_ROOT
git clone https://github.com/xbmc/xbmc kodi
Prepare to configure build
cd $KODI_ROOT/kodi/tools/depends
./bootstrap
Configure build for arm Kodi 17
./configure --with-tarballs=$KODI_ROOT/android-tools/xbmc-tarballs --with-ndk-api=24 --host=arm-linux-androideabi --with-sdk=android-26 --with-sdk-path=$KODI_ROOT/android-tools/android-sdk-linux --with-ndk=$KODI_ROOT/android-tools/android-ndk-r18b --with-toolchain=$KODI_ROOT/android-tools/arm-linux-androideabi-vanilla/android-24 --prefix=$KODI_ROOT/android-tools/xbmc-depends
Configure build for arm Kodi 18
./configure --with-tarballs=$KODI_ROOT/android-tools/xbmc-tarballs --with-ndk-api=24 --host=arm-linux-androideabi --with-sdk-path=$KODI_ROOT/android-tools/android-sdk-linux --with-ndk-path=$KODI_ROOT/android-tools/android-ndk-r18b --with-toolchain=$KODI_ROOT/android-tools/arm-linux-androideabi-vanilla/android-24 --prefix=$KODI_ROOT/android-tools/xbmc-depends
Patch for Kodi 17 only
$KODI_ROOT/kodi/tools/depends/native/automake-native/x86_64-linux-native$ vi bin/automake.in
For building Kodi 17 on Bionic fixes see Kodi Krypton Fixes
Build tools and dependencies
make -j$(getconf _NPROCESSORS_ONLN)
Build all add-ons
cd $KODI_ROOT/kodi
make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons
Build Kodi
Configure CMake build:
cd $KODI_ROOT/kodi
make -C tools/depends/target/cmakebuildsys
Build Kodi
cd $KODI_ROOT/kodi/build
make -j$(getconf _NPROCESSORS_ONLN)
Create package
make apk
Building Amended PVR IPTV Simple Plugin Linux
cd $KODI_ROOT
git clone https://github.com/bibble235/pvr.iptvsimple
cd pvr.iptvsimple && mkdir build && cd build
cmake -DADDONS_TO_BUILD=pvr.iptvsimple -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons
make
Building Amended PVR IPTV Simple Plugin Android
cd $KODI_ROOT
git clone https://github.com/bibble235/pvr.iptvsimple
cd pvr.iptvsimple && mkdir build && cd build
cmake -DADDONS_TO_BUILD=pvr.iptvsimple -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../kodi/addons -DPACKAGE_ZIP=1 \
-DCMAKE_TOOLCHAIN_FILE=$KODI_ROOT/Android/kodi/tools/depends/target/binary-addons/arm-linux-androideabi-21-debug/build/depends/share/Toolchain_binaddons.cmake \
../../kodi/cmake/addons
make