Skip to content

Commit

Permalink
Merge pull request #1 from phunkyfish/enable-platforms
Browse files Browse the repository at this point in the history
Support Android and Linux
  • Loading branch information
phunkyfish authored Jan 18, 2020
2 parents 72a12ac + b1c891b commit bc045df
Show file tree
Hide file tree
Showing 88 changed files with 1,153 additions and 1,233 deletions.
42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: cpp

#
# Define the build matrix
#
# Travis defaults to building on Ubuntu Trusty when building on
# Linux. We need Xenial in order to get up to date versions of
# cmake and g++.
#
env:
global:
- app_id=inputstream.ffmpegdirect

matrix:
include:
- os: linux
dist: xenial
sudo: required
compiler: gcc
- os: linux
dist: xenial
sudo: required
compiler: clang
- os: osx
osx_image: xcode10.2

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y yasm; fi
#
# The addon source is automatically checked out in $TRAVIS_BUILD_DIR,
# we'll put the Kodi source on the same level
#
before_script:
- cd $TRAVIS_BUILD_DIR/..
- git clone --branch master --depth=1 https://github.com/xbmc/xbmc.git
- cd ${app_id} && mkdir build && cd build
- mkdir -p definition/${app_id}
- echo ${app_id} $TRAVIS_BUILD_DIR $TRAVIS_COMMIT > definition/${app_id}/${app_id}.txt
- cmake -DADDONS_TO_BUILD=${app_id} -DADDON_SRC_PREFIX=$TRAVIS_BUILD_DIR/.. -DADDONS_DEFINITION_DIR=$TRAVIS_BUILD_DIR/build/definition -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/../xbmc/addons -DPACKAGE_ZIP=1 $TRAVIS_BUILD_DIR/../xbmc/cmake/addons

script: make
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ add_definitions(-DCATCHUP_VERSION=${CATCHUP_VERSION})

build_addon(inputstream.ffmpegdirect CATCHUP DEPLIBS)

set_target_properties(inputstream.ffmpegdirect PROPERTIES LINK_FLAGS "${FFMPEG_LDFLAGS}")

if(CORE_SYSTEM_NAME STREQUAL windowsstore)
# fix linking
set_target_properties(inputstream.ffmpegdirect PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/LTCG /defaultlib:vccorlib.lib /defaultlib:msvcrt.lib")
Expand Down
15 changes: 9 additions & 6 deletions FindFFMPEG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,25 @@ if(NOT ENABLE_INTERNAL_FFMPEG OR KODI_DEPENDSBUILD)
if(FFMPEG_FOUND)
set(FFMPEG_LDFLAGS ${PC_FFMPEG_LDFLAGS} CACHE STRING "ffmpeg linker flags")

set(FFMPEG_LIBRARIES ${FFMPEG_LIBAVCODEC} ${FFMPEG_LIBAVFILTER}
${FFMPEG_LIBAVFORMAT} ${FFMPEG_LIBAVUTIL}
${FFMPEG_LIBSWSCALE} ${FFMPEG_LIBSWRESAMPLE}
${FFMPEG_LIBPOSTPROC} ${FFMPEG_LDFLAGS})
list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VERSION}\")

# check if ffmpeg libs are statically linked
set(FFMPEG_LIB_TYPE SHARED)
foreach(_fflib IN LISTS FFMPEG_LIBRARIES)
if(${_fflib} MATCHES ".+\.a$" AND PC_FFMPEG_STATIC_LDFLAGS)
set(FFMPEG_LDFLAGS ${PC_FFMPEG_STATIC_LDFLAGS} CACHE STRING "ffmpeg linker flags" FORCE)
set(FFMPEG_LIB_TYPE STATIC)
if(NOT APPLE AND NOT WIN32)
set(FFMPEG_LDFLAGS "-Wl,-Bsymbolic ${FFMPEG_LDFLAGS}")
endif()
break()
endif()
endforeach()

set(FFMPEG_LIBRARIES ${FFMPEG_LIBAVCODEC} ${FFMPEG_LIBAVFILTER}
${FFMPEG_LIBAVFORMAT} ${FFMPEG_LIBAVUTIL}
${FFMPEG_LIBSWSCALE} ${FFMPEG_LIBSWRESAMPLE}
${FFMPEG_LIBPOSTPROC} ${FFMPEG_LDFLAGS})
list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VERSION}\")

if(NOT TARGET ffmpeg)
add_library(ffmpeg ${FFMPEG_LIB_TYPE} IMPORTED)
set_target_properties(ffmpeg PROPERTIES
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
buildPlugin(version: "Matrix", deploy: ['osx-x86_64'])
buildPlugin(version: "Matrix", deploy: ['android-aarch64', 'android-arm7', 'ios-aarch64', 'ios-arm7', 'osx-x86_64', 'ubuntu-ppa'])
17 changes: 17 additions & 0 deletions depends/android/gmp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
project(gmp)

cmake_minimum_required(VERSION 3.5)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})

include(ExternalProject)
externalproject_add(gmp
SOURCE_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND <SOURCE_DIR>/configure
${COMPILER_WITH_LIBTOOL_SYSROOT_APPLE}
--prefix=${CMAKE_INSTALL_PREFIX}
--disable-shared
--with-pic
${gmp_conf})

install(CODE "Message(Done)")
1 change: 1 addition & 0 deletions depends/android/gmp/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
iconv
1 change: 1 addition & 0 deletions depends/android/gmp/gmp.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2
1 change: 1 addition & 0 deletions depends/android/gmp/gmp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gmp http://mirrors.kodi.tv/build-deps/sources/gmp-6.1.2.tar.bz2
12 changes: 12 additions & 0 deletions depends/android/iconv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.5)
project(iconv)

include(ExternalProject)
externalproject_add(iconv
SOURCE_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND ./configure --disable-shared --prefix=${OUTPUT_DIR} --enable-extra-encodings --with-pic
BUILD_COMMAND make
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1)

install(CODE "execute_process(COMMAND make install WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})")
1 change: 1 addition & 0 deletions depends/android/iconv/iconv.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04
1 change: 1 addition & 0 deletions depends/android/iconv/iconv.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
iconv http://mirrors.kodi.tv/build-deps/sources/libiconv-1.16.tar.gz
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions depends/android/zvbi/05-zvbi-android-pthread_testcancel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff -ru zvbi/src/io-v4l.c zvbi-new/src/io-v4l.c
--- zvbi/src/io-v4l.c 2020-01-14 07:05:18.000000000 -0800
+++ zvbi-new/src/io-v4l.c 2020-01-14 07:10:15.000000000 -0800
@@ -45,6 +45,7 @@
#include <sys/stat.h> /* S_ISCHR */
#include <sys/ioctl.h> /* for (_)videodev.h */
#include <pthread.h>
+#include <signal.h>

#include "videodev.h"
#include "_videodev.h"
@@ -208,7 +209,9 @@
v->read_active = TRUE;

for (;;) {
- pthread_testcancel();
+ sigset_t waiting_mask;
+ if(sigpending (&waiting_mask))
+ pthread_exit(0);

r = read(v->fd, raw->data, raw->size);

diff -ru zvbi/src/io-v4l2k.c zvbi-new/src/io-v4l2k.c
--- zvbi/src/io-v4l2k.c 2020-01-14 07:05:18.000000000 -0800
+++ zvbi-new/src/io-v4l2k.c 2020-01-14 07:13:43.000000000 -0800
@@ -54,6 +54,7 @@
#include <sys/mman.h> /* PROT_READ, MAP_SHARED */
#include <asm/types.h> /* __u8 and friends for videodev2k.h */
#include <pthread.h>
+#include <signal.h>

#include "raw_decoder.h"
#include "version.h"
@@ -654,7 +655,9 @@

for (;;) {
/* from zapping/libvbi/v4lx.c */
- pthread_testcancel();
+ sigset_t waiting_mask;
+ if(sigpending (&waiting_mask))
+ pthread_exit(0);

r = read(v->fd, raw->data, raw->size);

File renamed without changes.
31 changes: 31 additions & 0 deletions depends/android/zvbi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
project(zvbi)

cmake_minimum_required(VERSION 3.5)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})

list(APPEND zvbi_conf CPPFLAGS=-I${CMAKE_INSTALL_PREFIX}/include)
list(APPEND zvbi_conf LDFLAGS=-L${CMAKE_INSTALL_PREFIX}/lib)

if (CORE_SYSTEM_NAME STREQUAL osx)
list(APPEND zvbi_conf CFLAGS=-fnested-functions)
elseif (CORE_SYSTEM_NAME STREQUAL android)
list(APPEND zvbi_conf LIBS=-liconv)
endif()

include(ExternalProject)
externalproject_add(zvbi
SOURCE_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=${CMAKE_INSTALL_PREFIX}
--enable-shared=no
--enable-static
--disable-dvb
--disable-bktr
--disable-nls
--disable-proxy
--without-doxygen
${zvbi_ldflags}
${zvbi_conf})

install(CODE "Message(Done)")
1 change: 1 addition & 0 deletions depends/android/zvbi/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
iconv
1 change: 1 addition & 0 deletions depends/android/zvbi/zvbi.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fc883c34111a487c4a783f91b1b2bb5610d8d8e58dcba80c7ab31e67e4765318
1 change: 1 addition & 0 deletions depends/android/zvbi/zvbi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zvbi http://mirrors.kodi.tv/build-deps/sources/zvbi-0.2.35.tar.bz2
22 changes: 22 additions & 0 deletions depends/common/bz2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.5)
project(bzip2)

if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64")
elseif(CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
endif()

set(SOURCES blocksort.c
huffman.c
crctable.c
randtable.c
compress.c
decompress.c
bzlib.c)

add_library(bz2 ${SOURCES})
set_property(TARGET bz2 PROPERTY POSITION_INDEPENDENT_CODE ON)

install(TARGETS bz2 DESTINATION lib)
install(FILES bzlib.h DESTINATION include)
1 change: 1 addition & 0 deletions depends/common/bz2/bz2.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269
1 change: 1 addition & 0 deletions depends/common/bz2/bz2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bz2 http://mirrors.kodi.tv/build-deps/sources/bzip2-1.0.8.tar.gz
23 changes: 0 additions & 23 deletions depends/common/bzip2/CMakeLists.txt

This file was deleted.

38 changes: 0 additions & 38 deletions depends/common/bzip2/Makefile

This file was deleted.

34 changes: 0 additions & 34 deletions depends/common/bzip2/Makefile.patch

This file was deleted.

11 changes: 0 additions & 11 deletions depends/common/bzip2/PostInstall.cmake

This file was deleted.

1 change: 0 additions & 1 deletion depends/common/bzip2/bzip.sha256

This file was deleted.

1 change: 0 additions & 1 deletion depends/common/bzip2/bzip.txt

This file was deleted.

25 changes: 25 additions & 0 deletions depends/common/ffmpeg/0001-hack-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 7ea3c3037d1c385001eccd850059bfa137288979 Mon Sep 17 00:00:00 2001
From: Alwin Esch <alwin.esch@web.de>
Date: Wed, 15 Jan 2020 03:46:11 +0100
Subject: [PATCH] hack fix

---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 34c2adb..957e502 100755
--- a/configure
+++ b/configure
@@ -1569,7 +1569,7 @@ require_cpp_condition(){
require_pkg_config(){
log require_pkg_config "$@"
pkg_version="$2"
- check_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
+ check_pkg_config "$@" || echo "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
}

test_host_cc(){
--
2.20.1

Loading

0 comments on commit bc045df

Please sign in to comment.