diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | cmake/modules/FindFmt.cmake | 46 | ||||
-rw-r--r-- | docs/README.linux | 8 | ||||
-rw-r--r-- | docs/README.ubuntu | 6 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.list | 1 | ||||
-rw-r--r-- | tools/depends/.gitignore | 2 | ||||
-rw-r--r-- | tools/depends/target/Makefile | 2 | ||||
-rw-r--r-- | tools/depends/target/libfmt/Makefile | 65 |
9 files changed, 130 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml index 9e058be8d8..246e9a8b60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,7 +71,7 @@ install: - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" ]]; then sudo apt-get install -qq automake autopoint build-essential cmake curl default-jre gawk gdb gdc gettext git-core gperf libasound2-dev libass-dev libbz2-dev libcap-dev libcdio-dev libcec4-dev libcrossguid-dev libcurl3 - libcurl4-openssl-dev libdbus-1-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev libgif-dev + libcurl4-openssl-dev libdbus-1-dev libfmt3-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev libgif-dev libiso9660-dev libjpeg-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmysqlclient-dev libnfs-dev libpcre3-dev libplist-dev libpng-dev libpulse-dev libsdl2-dev libsmbclient-dev libsqlite3-dev libssh-dev libssl-dev libtag1-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libvdpau-dev diff --git a/CMakeLists.txt b/CMakeLists.txt index 5912e07610..362a27b0a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,7 +103,7 @@ list(APPEND DEPLIBS ${CMAKE_THREAD_LIBS_INIT}) # Required dependencies set(required_deps Sqlite3 FreeType PCRE Cpluff LibDvd - TinyXML Yajl Cdio + TinyXML Yajl Cdio Fmt Lzo2 Fribidi TagLib FFMPEG CrossGUID) if(NOT WIN32) list(APPEND required_deps ZLIB) diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake new file mode 100644 index 0000000000..78ad7132f3 --- /dev/null +++ b/cmake/modules/FindFmt.cmake @@ -0,0 +1,46 @@ +# FindFmt +# ------- +# Finds the Fmt library +# +# This will define the following variables:: +# +# FMT_FOUND - system has Fmt +# FMT_INCLUDE_DIRS - the Fmt include directory +# FMT_LIBRARIES - the Fmt libraries +# +# and the following imported targets:: +# +# Fmt::Fmt - The Fmt library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_FMT libfmt QUIET) +endif() + +find_path(FMT_INCLUDE_DIR NAMES fmt/format.h + PATHS ${PC_FMT_INCLUDEDIR}) + +find_library(FMT_LIBRARY_RELEASE NAMES fmt + PATHS ${PC_FMT_LIBDIR}) +find_library(FMT_LIBRARY_DEBUG NAMES fmtd + PATHS ${PC_FMT_LIBDIR}) + +include(SelectLibraryConfigurations) +select_library_configurations(FMT) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Fmt + REQUIRED_VARS FMT_LIBRARY FMT_INCLUDE_DIR) + +if(FMT_FOUND) + set(FMT_LIBRARIES ${FMT_LIBRARY}) + set(FMT_INCLUDE_DIRS ${FMT_INCLUDE_DIR}) + + if(NOT TARGET Fmt::Fmt) + add_library(Fmt::Fmt UNKNOWN IMPORTED) + set_target_properties(Fmt::Fmt PROPERTIES + IMPORTED_LOCATION "${FMT_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${FMT_INCLUDE_DIR}") + endif() +endif() + +mark_as_advanced(FMT_INCLUDE_DIR FMT_LIBRARY) diff --git a/docs/README.linux b/docs/README.linux index cf56b86bca..5f6c1a2281 100644 --- a/docs/README.linux +++ b/docs/README.linux @@ -48,7 +48,7 @@ Build-Depends: autoconf, automake, autopoint, autotools-dev, cmake, curl, libass-dev (>= 0.9.8), libavahi-client-dev, libavahi-common-dev, libbluetooth-dev, libbluray-dev (>= 0.7.0), libbz2-dev, libcap-dev, libcdio-dev, libcec-dev, libcurl4-openssl-dev | libcurl4-gnutls-dev | libcurl-dev, - libcwiid-dev, libdbus-1-dev, libegl1-mesa-dev, libfontconfig-dev, libfreetype6-dev, + libcwiid-dev, libdbus-1-dev, libegl1-mesa-dev, libfmt3-dev, libfontconfig-dev, libfreetype6-dev, libfribidi-dev, libgif-dev (>= 4.1.6), libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev, libiso9660-dev, libjpeg-dev, libltdl-dev, liblzo2-dev, libmicrohttpd-dev, libmpcdec-dev, libmysqlclient-dev, libnfs-dev, @@ -66,6 +66,12 @@ We supply a Makefile in tools/depends/target/crossguid to make it easy to install into /usr/local. $ make -C tools/depends/target/crossguid PREFIX=/usr/local +[NOTICE] libfmt / libfmt3-dev all Linux distributions. +Kodi now requires libfmt which is not available in Ubuntu repositories at this time. +We supply a Makefile in tools/depends/target/libfmt +to make it easy to install into /usr/local. + $ make -C tools/depends/target/libfmt PREFIX=/usr/local + Note: For developers and anyone else who compiles frequently it is recommended to use ccache. $ sudo apt-get install ccache diff --git a/docs/README.ubuntu b/docs/README.ubuntu index 65c857cc4f..2c34056c67 100644 --- a/docs/README.ubuntu +++ b/docs/README.ubuntu @@ -135,6 +135,12 @@ We also supply a Makefile in tools/depends/target/crossguid to make it easy to install into /usr/local. 1. $ make -C tools/depends/target/crossguid PREFIX=/usr/local +[NOTICE] libfmt / libfmt3-dev all Linux distributions. +Kodi now requires libfmt which is not available in Ubuntu repositories at this time. +If build-deps PPA doesn't provide a pre-packaged version for your distribution, we supply a +Makefile in tools/depends/target/libfmt to make it easy to install into /usr/local. +1. $ make -C tools/depends/target/libfmt PREFIX=/usr/local + Unless you are proficient with how Linux libraries and versions work, do not try to provide it yourself, as you will likely mess up for other programs. diff --git a/project/BuildDependencies/scripts/0_package.list b/project/BuildDependencies/scripts/0_package.list index e682e8e987..bf158df66e 100644 --- a/project/BuildDependencies/scripts/0_package.list +++ b/project/BuildDependencies/scripts/0_package.list @@ -13,6 +13,7 @@ dnssd-541-win32.zip doxygen-1.8.2-win32.7z easyhook-2.7.5870.0-win32-vc140-v2.7z expat-2.2.0-win32-vc140.7z +fmt-3.0.1-win32-vc140.7z freetype-db5a22-win32-vc140.7z giflib-5.1.4-win32-vc140.7z jsonschemabuilder-1.0.0-win32-3.7z diff --git a/tools/depends/.gitignore b/tools/depends/.gitignore index c6c4d2515b..3e5bc8f18c 100644 --- a/tools/depends/.gitignore +++ b/tools/depends/.gitignore @@ -12,6 +12,7 @@ /target/*/.patched-* /target/*/.installed-* +/target/*/native/* /target/*/x86/* /target/*/x86_64-linux-gnu/* /target/*/armeabi-v7a/* @@ -47,3 +48,4 @@ config.site.native /tools/depends/target/ffmpeg/ffmpeg-install/ /tools/depends/target/Toolchain_binaddons.cmake /tools/depends/target/config-binaddons.site +/target/libfmt/fmt-*.tar.gz diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile index 9d0c722fab..a47d19bb1f 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -10,7 +10,7 @@ DEPENDS = \ openssl gmp nettle gnutls curl \ libjpeg-turbo libpng fribidi libass \ libxml2 yajl libmicrohttpd mysql libffi \ - python27 libshairplay \ + python27 libshairplay libfmt \ libplist libcec libbluray tinyxml dummy-libxbmc \ libssh taglib libusb libnfs \ pythonmodule-pil pythonmodule-pycryptodome pythonmodule-setuptools \ diff --git a/tools/depends/target/libfmt/Makefile b/tools/depends/target/libfmt/Makefile new file mode 100644 index 0000000000..5151f8fb3d --- /dev/null +++ b/tools/depends/target/libfmt/Makefile @@ -0,0 +1,65 @@ +-include ../../Makefile.include +DEPS = Makefile + +# lib name, version +LIBNAME=fmt +VERSION=3.0.1 +BASE_URL=https://github.com/fmtlib/fmt/archive +SOURCE=$(LIBNAME)-$(VERSION) +ARCHIVE=$(SOURCE).tar.gz + +RETRIEVE_TOOL_FLAGS=-Ls --create-dirs -f + +CMAKE_OPTIONS=-DFMT_DOC=OFF -DFMT_INSTALL=ON -DFMT_TEST=OFF -DFMT_USE_CPP11=ON + +ifeq ($(CROSS_COMPILING), yes) + DEPS += ../../Makefile.include +else + CXXFLAGS += -std=c++11 + ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + + ifeq ($(PLATFORM),) + PLATFORM = native + TARBALLS_LOCATION = $(ROOT_DIR) + RETRIEVE_TOOL := curl + ARCHIVE_TOOL := tar --strip-components=1 -xf + CMAKE := cmake + endif +endif + +LIBDYLIB=$(PLATFORM)/build/$(LIBNAME)/libfmt.a + +.PHONY: .installed-$(PLATFORM) + +all: .installed-$(PLATFORM) +$(PREFIX)/lib/lib$(LIBNAME).a: + @make .installed-$(PLATFORM) + +$(TARBALLS_LOCATION)/$(ARCHIVE): + cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) -o $(ARCHIVE) $(BASE_URL)/$(VERSION).tar.gz + +$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) +ifeq ($(PREFIX),) + @echo + @echo "ERROR: please set PREFIX to the kodi install path e.g. make PREFIX=/usr/local" + @exit 1 +endif + rm -rf $(PLATFORM); mkdir -p $(PLATFORM) + cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) + cd $(PLATFORM); rm -rf build; mkdir -p build + cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) .. + +$(LIBDYLIB): $(PLATFORM) + $(MAKE) -C $(PLATFORM)/build + +.installed-$(PLATFORM): $(LIBDYLIB) + $(MAKE) -C $(PLATFORM)/build install + touch $@ + +clean: + $(MAKE) -C $(PLATFORM)/build clean + rm -f .installed-$(PLATFORM) + +distclean:: + rm -rf $(PLATFORM) .installed-$(PLATFORM) + |