diff options
author | Jakob Linskeseder <jakob.linskeseder@gmail.com> | 2019-11-18 20:46:00 +0100 |
---|---|---|
committer | Lukas Rusak <lorusak@gmail.com> | 2020-03-03 17:03:19 -0800 |
commit | 2998537d5f048245c5bf5089d241edbb259c6d2f (patch) | |
tree | 73980a28048661929f9f7c5b0f11c5feddcbc8d4 | |
parent | 7bb56196e41327a46f7b5781b4b9d59fb71d7100 (diff) |
[cmake] ffmpeg: add support for libdav1d
-rw-r--r-- | .travis.yml | 5 | ||||
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | cmake/cpack/deb/copyright | 137 | ||||
-rw-r--r-- | cmake/modules/FindDav1d.cmake | 87 | ||||
-rw-r--r-- | cmake/modules/FindFFMPEG.cmake | 10 | ||||
-rw-r--r-- | docs/README.Linux.md | 4 | ||||
-rw-r--r-- | docs/README.Ubuntu.md | 2 | ||||
-rw-r--r-- | tools/depends/native/Makefile | 9 | ||||
-rw-r--r-- | tools/depends/target/Makefile | 7 | ||||
-rw-r--r-- | tools/depends/target/dav1d/DAV1D-VERSION | 3 | ||||
-rw-r--r-- | tools/depends/target/dav1d/Makefile | 56 | ||||
-rw-r--r-- | tools/depends/target/ffmpeg/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tools/depends/target/ffmpeg/Makefile | 1 | ||||
-rwxr-xr-x | tools/depends/target/ffmpeg/autobuild.sh | 1 |
14 files changed, 314 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml index 36649cde48..a3b46cafa4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,8 +73,11 @@ install: libpcre3-dev libplist-dev libpng-dev libpulse-dev libsmbclient-dev libsqlite3-dev libssl-dev libtag1-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libvdpau-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev mesa-utils - nasm pmount python-dev python-imaging python-sqlite rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev; + nasm ninja-build pmount python-dev python-imaging python-pip3 python-sqlite rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev; fi + # We can't use the `meson` distro-package, since dav1d requires at least meson >= 0.47.0. + # Ubuntu 18.04 ships the outdated 0.45.1 version. So we have to install it via pip. + - pip3 install meson # Prepare builds # diff --git a/CMakeLists.txt b/CMakeLists.txt index 433560fdfc..44afba0c6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ if(UNIX) option(ENABLE_INTERNAL_FMT "Enable internal fmt?" OFF) option(ENABLE_INTERNAL_FSTRCMP "Enable internal fstrcmp?" OFF) option(ENABLE_INTERNAL_FLATBUFFERS "Enable internal flatbuffers?" OFF) + option(ENABLE_INTERNAL_DAV1D "Enable internal dav1d?" OFF) endif() # System options if(NOT WIN32) diff --git a/cmake/cpack/deb/copyright b/cmake/cpack/deb/copyright index 3033afd865..3a3916cd94 100644 --- a/cmake/cpack/deb/copyright +++ b/cmake/cpack/deb/copyright @@ -2362,6 +2362,33 @@ LZO Library - LZO real-time data compression library You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. +dav1d - AV1 cross-platform decoder +<https://code.videolan.org/videolan/dav1d> + + Copyright © 2018-2019, VideoLAN and dav1d authors + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Licenses: License: GPL @@ -2908,3 +2935,113 @@ We are required to state that CompuServe Incorporated." -- End of IJG License -- + +License: Alliance for Open Media Patent License 1.0 + +1. License Terms. + +1.1. Patent License. Subject to the terms and conditions of this License, each + Licensor, on behalf of itself and successors in interest and assigns, + grants Licensee a non-sublicensable, perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as expressly stated in this + License) patent license to its Necessary Claims to make, use, sell, offer + for sale, import or distribute any Implementation. + +1.2. Conditions. + +1.2.1. Availability. As a condition to the grant of rights to Licensee to make, + sell, offer for sale, import or distribute an Implementation under + Section 1.1, Licensee must make its Necessary Claims available under + this License, and must reproduce this License with any Implementation + as follows: + + a. For distribution in source code, by including this License in the + root directory of the source code with its Implementation. + + b. For distribution in any other form (including binary, object form, + and/or hardware description code (e.g., HDL, RTL, Gate Level Netlist, + GDSII, etc.)), by including this License in the documentation, legal + notices, and/or other written materials provided with the + Implementation. + +1.2.2. Additional Conditions. This license is directly from Licensor to + Licensee. Licensee acknowledges as a condition of benefiting from it + that no rights from Licensor are received from suppliers, distributors, + or otherwise in connection with this License. + +1.3. Defensive Termination. If any Licensee, its Affiliates, or its agents + initiates patent litigation or files, maintains, or voluntarily + participates in a lawsuit against another entity or any person asserting + that any Implementation infringes Necessary Claims, any patent licenses + granted under this License directly to the Licensee are immediately + terminated as of the date of the initiation of action unless 1) that suit + was in response to a corresponding suit regarding an Implementation first + brought against an initiating entity, or 2) that suit was brought to + enforce the terms of this License (including intervention in a third-party + action by a Licensee). + +1.4. Disclaimers. The Reference Implementation and Specification are provided + "AS IS" and without warranty. The entire risk as to implementing or + otherwise using the Reference Implementation or Specification is assumed + by the implementer and user. Licensor expressly disclaims any warranties + (express, implied, or otherwise), including implied warranties of + merchantability, non-infringement, fitness for a particular purpose, or + title, related to the material. IN NO EVENT WILL LICENSOR BE LIABLE TO + ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, + INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF + ACTION OF ANY KIND WITH RESPECT TO THIS LICENSE, WHETHER BASED ON BREACH + OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR + NOT THE OTHER PARTRY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +2. Definitions. + +2.1. Affiliate. “Affiliate” means an entity that directly or indirectly + Controls, is Controlled by, or is under common Control of that party. + +2.2. Control. “Control” means direct or indirect control of more than 50% of + the voting power to elect directors of that corporation, or for any other + entity, the power to direct management of such entity. + +2.3. Decoder. "Decoder" means any decoder that conforms fully with all + non-optional portions of the Specification. + +2.4. Encoder. "Encoder" means any encoder that produces a bitstream that can + be decoded by a Decoder only to the extent it produces such a bitstream. + +2.5. Final Deliverable. “Final Deliverable” means the final version of a + deliverable approved by the Alliance for Open Media as a Final + Deliverable. + +2.6. Implementation. "Implementation" means any implementation, including the + Reference Implementation, that is an Encoder and/or a Decoder. An + Implementation also includes components of an Implementation only to the + extent they are used as part of an Implementation. + +2.7. License. “License” means this license. + +2.8. Licensee. “Licensee” means any person or entity who exercises patent + rights granted under this License. + +2.9. Licensor. "Licensor" means (i) any Licensee that makes, sells, offers + for sale, imports or distributes any Implementation, or (ii) a person + or entity that has a licensing obligation to the Implementation as a + result of its membership and/or participation in the Alliance for Open + Media working group that developed the Specification. + +2.10. Necessary Claims. "Necessary Claims" means all claims of patents or + patent applications, (a) that currently or at any time in the future, + are owned or controlled by the Licensor, and (b) (i) would be an + Essential Claim as defined by the W3C Policy as of February 5, 2004 + (https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential) + as if the Specification was a W3C Recommendation; or (ii) are infringed + by the Reference Implementation. + +2.11. Reference Implementation. “Reference Implementation” means an Encoder + and/or Decoder released by the Alliance for Open Media as a Final + Deliverable. + +2.12. Specification. “Specification” means the specification designated by + the Alliance for Open Media as a Final Deliverable for which this + License was issued. + +-- End of Alliance for Open Media Patent License 1.0 License --
\ No newline at end of file diff --git a/cmake/modules/FindDav1d.cmake b/cmake/modules/FindDav1d.cmake new file mode 100644 index 0000000000..4776610f09 --- /dev/null +++ b/cmake/modules/FindDav1d.cmake @@ -0,0 +1,87 @@ +#.rst: +# FindDav1d +# -------- +# Finds the dav1d library +# +# This will define the following variables:: +# +# DAV1D_FOUND - system has dav1d +# DAV1D_INCLUDE_DIRS - the dav1d include directories +# DAV1D_LIBRARIES - the dav1d libraries + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_DAV1D dav1d QUIET) +endif() + +find_library(DAV1D_LIBRARY NAMES dav1d + PATHS ${PC_DAV1D_LIBDIR}) + +find_path(DAV1D_INCLUDE_DIR NAMES dav1d/dav1d.h + PATHS ${PC_DAV1D_INCLUDEDIR}) + +set(DAV1D_VERSION ${PC_DAV1D_VERSION}) + +if (NOT DAV1D_LIBRARY AND NOT DAV1D_INCLUDE_DIR AND NOT DAV1D_VERSION) + set(ENABLE_INTERNAL_DAV1D ON) + message(STATUS "libdav1d not found, falling back to internal build") +endif() + +if(ENABLE_INTERNAL_DAV1D) + include(ExternalProject) + + # Extract version + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/dav1d/DAV1D-VERSION VER) + + string(REGEX MATCH "VERSION=[^ ]*$.*" DAV1D_VER "${VER}") + list(GET DAV1D_VER 0 DAV1D_VER) + string(SUBSTRING "${DAV1D_VER}" 8 -1 DAV1D_VER) + + # allow user to override the download URL with a local tarball + # needed for offline build envs + if(DAV1D_URL) + get_filename_component(DAV1D_URL "${DAV1D_URL}" ABSOLUTE) + else() + set(DAV1D_URL http://mirrors.kodi.tv/build-deps/sources/dav1d-${DAV1D_VER}.tar.gz) + endif() + + if(VERBOSE) + message(STATUS "DAV1D_URL: ${DAV1D_URL}") + endif() + + set(DAV1D_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libdav1d.a) + set(DAV1D_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) + set(DAV1D_VERSION ${DAV1D_VER}) + + externalproject_add(dav1d + URL ${DAV1D_URL} + DOWNLOAD_NAME dav1d-${DAV1D_VER}.tar.gz + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download + PREFIX ${CORE_BUILD_DIR}/dav1d + CONFIGURE_COMMAND meson + --buildtype=release + --default-library=static + --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} + --libdir=lib + -Denable_asm=true + -Denable_tools=false + -Denable_examples=false + -Denable_tests=false + ../dav1d + BUILD_COMMAND ninja + INSTALL_COMMAND ninja install + BUILD_BYPRODUCTS ${DAV1D_LIBRARY}) + + set_target_properties(dav1d PROPERTIES FOLDER "External Projects") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Dav1d + REQUIRED_VARS DAV1D_LIBRARY DAV1D_INCLUDE_DIR + VERSION_VAR DAV1D_VERSION) + +if(DAV1D_FOUND) + set(DAV1D_INCLUDE_DIRS ${DAVID_INCLUDE_DIR}) + set(DAV1D_LIBRARIES ${DAV1D_LIBRARY}) +endif() + +mark_as_advanced(DAVID_INCLUDE_DIR DAV1D_LIBRARY) diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index 26ee23944d..59c6600d95 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake @@ -229,10 +229,13 @@ if(NOT FFMPEG_FOUND) message(STATUS "FFMPEG_URL: ${FFMPEG_URL}") endif() + find_package(Dav1d) + set(FFMPEG_OPTIONS -DENABLE_CCACHE=${ENABLE_CCACHE} -DCCACHE_PROGRAM=${CCACHE_PROGRAM} -DENABLE_VAAPI=${ENABLE_VAAPI} - -DENABLE_VDPAU=${ENABLE_VDPAU}) + -DENABLE_VDPAU=${ENABLE_VDPAU} + -DENABLE_DAV1D=${DAV1D_FOUND}) if(KODI_DEPENDSBUILD) set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH} @@ -265,6 +268,7 @@ if(NOT FFMPEG_FOUND) -DCMAKE_EXE_LINKER_FLAGS=${LINKER_FLAGS} ${CROSS_ARGS} ${FFMPEG_OPTIONS} + -DPKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt <SOURCE_DIR> && @@ -272,6 +276,10 @@ if(NOT FFMPEG_FOUND) ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake <SOURCE_DIR>) + if (ENABLE_INTERNAL_DAV1D) + add_dependencies(ffmpeg dav1d) + endif() + find_program(BASH_COMMAND bash) if(NOT BASH_COMMAND) message(FATAL_ERROR "Internal FFmpeg requires bash.") diff --git a/docs/README.Linux.md b/docs/README.Linux.md index 02ee59b29a..5019a90def 100644 --- a/docs/README.Linux.md +++ b/docs/README.Linux.md @@ -74,7 +74,7 @@ The following is the list of packages that are used to build Kodi on Debian/Ubun **NOTE:** Kodi requires a compiler with C++14 support, i.e. gcc >= 4.9 or clang >= 3.4 -* autoconf, automake, autopoint, gettext, autotools-dev, cmake, curl, default-jre | openjdk-6-jre | openjdk-7-jre, gawk, gcc (>= 4.9) | gcc-4.9, g++ (>= 4.9) | g++-4.9, cpp (>= 4.9) | cpp-4.9, flatbuffers, gdc, gperf, libasound2-dev | libasound-dev, libass-dev (>= 0.9.8), libavahi-client-dev, libavahi-common-dev, libbluetooth-dev, libbluray-dev, libbz2-dev, libcdio-dev, libcec4-dev | libcec-dev, libp8-platform-dev, libcrossguid-dev, libcurl4-openssl-dev | libcurl4-gnutls-dev | libcurl-dev, libcwiid-dev, libdbus-1-dev, libegl1-mesa-dev, libenca-dev, libflac-dev, libfontconfig-dev, libfmt3-dev | libfmt-dev, libfreetype6-dev, libfribidi-dev, libfstrcmp-dev, libgcrypt-dev, libgif-dev (>= 5.0.5), libgles2-mesa-dev [armel] | libgl1-mesa-dev | libgl-dev, libglew-dev, libglu1-mesa-dev | libglu-dev, libgnutls-dev | libgnutls28-dev, libgpg-error-dev, libiso9660-dev, libjpeg-dev, liblcms2-dev, liblirc-dev, libltdl-dev, liblzo2-dev, libmicrohttpd-dev, libmysqlclient-dev, libnfs-dev, libogg-dev, libomxil-bellagio-dev [armel], libpcre3-dev, libplist-dev, libpng12-dev | libpng-dev, libpulse-dev, libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssl-dev, libtag1-dev (>= 1.8) | libtag1x8, libtiff5-dev | libtiff-dev | libtiff4-dev, libtinyxml-dev, libtool, libudev-dev, libva-dev, libvdpau-dev, libvorbis-dev, libxkbcommon-dev, libxmu-dev, libxrandr-dev, libxslt1-dev | libxslt-dev, libxt-dev, waylandpp-dev | netcat, wayland-protocols | wipe, lsb-release, nasm [!amd64], python3-dev, python3-pil | python-imaging, python-support | python3-minimal, rapidjson-dev, swig, unzip, uuid-dev, yasm, zip, zlib1g-dev +* autoconf, automake, autopoint, gettext, autotools-dev, cmake, curl, default-jre | openjdk-6-jre | openjdk-7-jre, gawk, gcc (>= 4.9) | gcc-4.9, g++ (>= 4.9) | g++-4.9, cpp (>= 4.9) | cpp-4.9, flatbuffers, gdc, gperf, libasound2-dev | libasound-dev, libass-dev (>= 0.9.8), libavahi-client-dev, libavahi-common-dev, libbluetooth-dev, libbluray-dev, libbz2-dev, libcdio-dev, libcec4-dev | libcec-dev, libp8-platform-dev, libcrossguid-dev, libcurl4-openssl-dev | libcurl4-gnutls-dev | libcurl-dev, libcwiid-dev, libdbus-1-dev, libegl1-mesa-dev, libenca-dev, libflac-dev, libfontconfig-dev, libfmt3-dev | libfmt-dev, libfreetype6-dev, libfribidi-dev, libfstrcmp-dev, libgcrypt-dev, libgif-dev (>= 5.0.5), libgles2-mesa-dev [armel] | libgl1-mesa-dev | libgl-dev, libglew-dev, libglu1-mesa-dev | libglu-dev, libgnutls-dev | libgnutls28-dev, libgpg-error-dev, libiso9660-dev, libjpeg-dev, liblcms2-dev, liblirc-dev, libltdl-dev, liblzo2-dev, libmicrohttpd-dev, libmysqlclient-dev, libnfs-dev, libogg-dev, libomxil-bellagio-dev [armel], libpcre3-dev, libplist-dev, libpng12-dev | libpng-dev, libpulse-dev, libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssl-dev, libtag1-dev (>= 1.8) | libtag1x8, libtiff5-dev | libtiff-dev | libtiff4-dev, libtinyxml-dev, libtool, libudev-dev, libva-dev, libvdpau-dev, libvorbis-dev, libxkbcommon-dev, libxmu-dev, libxrandr-dev, libxslt1-dev | libxslt-dev, libxt-dev, waylandpp-dev | netcat, wayland-protocols | wipe, lsb-release, meson (>= 0.47.0), nasm, ninja-build, python3-dev, python3-pil | python-imaging, python-support | python3-minimal, rapidjson-dev, swig, unzip, uuid-dev, yasm, zip, zlib1g-dev ### 3.1. Build missing dependencies Some packages may be missing or outdated in older distributions. Notably `crossguid, libfmt, waylandpp, wayland-protocols, etc.` are known to be outdated or missing. Fortunately there is an easy way to build individual dependencies with **[Kodi's unified depends build system](../tools/depends/README.md)**. @@ -114,7 +114,7 @@ sudo make -C tools/depends/target/waylandpp PREFIX=/usr/local **TIP:** Complete list of dependencies is available **[here](https://github.com/xbmc/xbmc/tree/master/tools/depends/target)**. ### 3.2. Enable internal dependencies -Some dependencies can be configured to build before Kodi. That's the case with `flatbuffers`, `crossguid, libfmt and rapidjson`. To enable the internal build of a dependency, append `-DENABLE_INTERNAL_<DEPENDENCY_NAME>=ON` to the configure command below. For example, configuring an X11 build with internal `fmt` would become `cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_INTERNAL_FMT=ON` instead of `cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local`. +Some dependencies can be configured to build before Kodi. That's the case with `flatbuffers`, `crossguid, libfmt, rapidjson and dav1d`. To enable the internal build of a dependency, append `-DENABLE_INTERNAL_<DEPENDENCY_NAME>=ON` to the configure command below. For example, configuring an X11 build with internal `fmt` would become `cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_INTERNAL_FMT=ON` instead of `cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local`. **[back to top](#table-of-contents)** | **[back to section top](#3-installing-the-required-packages)** diff --git a/docs/README.Ubuntu.md b/docs/README.Ubuntu.md index 56c844d2d6..4411b27c81 100644 --- a/docs/README.Ubuntu.md +++ b/docs/README.Ubuntu.md @@ -115,7 +115,7 @@ If you get a `package not found` type of message with the below command, remove Install build dependencies manually: ``` -sudo apt install debhelper autoconf automake autopoint gettext autotools-dev cmake curl default-jre doxygen gawk gcc gdc gperf libasound2-dev libass-dev libavahi-client-dev libavahi-common-dev libbluetooth-dev libbluray-dev libbz2-dev libcdio-dev libp8-platform-dev libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libdbus-1-dev libegl1-mesa-dev libenca-dev libflac-dev flatbuffers-dev libfontconfig-dev libfreetype6-dev libfribidi-dev libfstrcmp-dev libgcrypt-dev libgif-dev libgles2-mesa-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls28-dev libgpg-error-dev libiso9660-dev libjpeg-dev liblcms2-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmysqlclient-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libpulse-dev libshairplay-dev libsmbclient-dev libsqlite3-dev libssl-dev libtag1-dev libtiff5-dev libtinyxml-dev libtool libudev-dev libva-dev libvdpau-dev libvorbis-dev libxmu-dev libxrandr-dev libxslt1-dev libxt-dev lsb-release python3-dev python3-pil rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev +sudo apt install debhelper autoconf automake autopoint gettext autotools-dev cmake curl default-jre doxygen gawk gcc gdc gperf libasound2-dev libass-dev libavahi-client-dev libavahi-common-dev libbluetooth-dev libbluray-dev libbz2-dev libcdio-dev libp8-platform-dev libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libdbus-1-dev libegl1-mesa-dev libenca-dev libflac-dev flatbuffers-dev libfontconfig-dev libfreetype6-dev libfribidi-dev libfstrcmp-dev libgcrypt-dev libgif-dev libgles2-mesa-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls28-dev libgpg-error-dev libiso9660-dev libjpeg-dev liblcms2-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmysqlclient-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libpulse-dev libshairplay-dev libsmbclient-dev libsqlite3-dev libssl-dev libtag1-dev libtiff5-dev libtinyxml-dev libtool libudev-dev libva-dev libvdpau-dev libvorbis-dev libxmu-dev libxrandr-dev libxslt1-dev libxt-dev lsb-release nasm ninja-build python3-dev python3-pil python3-pip rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev ``` **WARNING:** Make sure you copy paste the entire line or you might receive an error or miss a few dependencies. diff --git a/tools/depends/native/Makefile b/tools/depends/native/Makefile index dea6d8be17..4e012d9b22 100644 --- a/tools/depends/native/Makefile +++ b/tools/depends/native/Makefile @@ -10,19 +10,14 @@ NATIVE= m4 gettext heimdal autoconf automake \ pcre swig \ libpng libjpeg-turbo liblzo2 giflib \ setuptools distutilscross JsonSchemaBuilder TexturePacker \ - flatbuffers + flatbuffers \ + meson ninja ifeq ($(OS),darwin_embedded) NATIVE += dpkg xz tar gen_entitlements ldid endif -ifeq ($(OS),linux) - ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),raspberry-pi gbm)) - NATIVE += meson ninja - endif -endif - ifeq ($(TARGET_PLATFORM),wayland) NATIVE += expat wayland-scanner waylandpp-scanner EXPAT = expat diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile index 835ad6d8e5..840c1a7111 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -15,10 +15,7 @@ DEPENDS = \ taglib libusb libnfs meson-cross-file \ pythonmodule-pil pythonmodule-pycryptodome pythonmodule-setuptools \ libxslt ffmpeg crossguid \ - libdvdread libdvdnav libdvdcss p8-platform flatbuffers - - -FFMPEG_DEPENDS = gnutls + libdvdread libdvdnav libdvdcss p8-platform flatbuffers dav1d ifeq ($(ENABLE_GPLV3),yes) DEPENDS+=samba-gplv3 libcdio-gplv3 @@ -107,7 +104,7 @@ pythonmodule-pycryptodome: $(PYMODULE_DEPS) python3 pythonmodule-setuptools pythonmodule-pil: bzip2 $(PYMODULE_DEPS) $(ZLIB) libjpeg-turbo libpng freetype2 python3 pythonmodule-setuptools pythonmodule-setuptools: $(PYMODULE_DEPS) python3 libxslt: libgcrypt libxml2 -ffmpeg: $(ICONV) $(ZLIB) bzip2 $(FFMPEG_DEPENDS) +ffmpeg: $(ICONV) $(ZLIB) bzip2 gnutls dav1d libcec: p8-platform crossguid: $(LIBUUID) libdvdnav: libdvdread diff --git a/tools/depends/target/dav1d/DAV1D-VERSION b/tools/depends/target/dav1d/DAV1D-VERSION new file mode 100644 index 0000000000..7e40a1e953 --- /dev/null +++ b/tools/depends/target/dav1d/DAV1D-VERSION @@ -0,0 +1,3 @@ +LIBNAME=dav1d +VERSION=0.5.2 +ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz diff --git a/tools/depends/target/dav1d/Makefile b/tools/depends/target/dav1d/Makefile new file mode 100644 index 0000000000..19808bba21 --- /dev/null +++ b/tools/depends/target/dav1d/Makefile @@ -0,0 +1,56 @@ +include ../../Makefile.include +include DAV1D-VERSION +DEPS = ../../Makefile.include Makefile DAV1D-VERSION + +MESON_BUILD_TYPE=release + +ifeq ($(DEBUG_BUILD), yes) + MESON_BUILD_TYPE=debug +endif + +# configuration settings +CONFIGURE = $(NATIVEPREFIX)/bin/python3 $(NATIVEPREFIX)/bin/meson \ + --buildtype=$(MESON_BUILD_TYPE) \ + --default-library=static \ + -Denable_asm=true \ + -Denable_tools=false \ + -Denable_examples=false \ + -Denable_tests=false + +ifeq ($(CROSS_COMPILING), yes) +CONFIGURE += --cross-file $(PREFIX)/share/cross-file.meson +export CC=$(CC_FOR_BUILD) +export CXX=$(CXX_FOR_BUILD) +export CFLAGS=$(CFLAGS_FOR_BUILD) +export CXXFLAGS=$(CXXFLAGS_FOR_BUILD) +else +export CC CXX CFLAGS CXXFLAGS +endif +export PKG_CONFIG_LIBDIR=$(PREFIX)/lib/pkgconfig + +LIBDYLIB=$(PLATFORM)/lib/lib$(LIBNAME).a + +all: .installed-$(PLATFORM) + +$(TARBALLS_LOCATION)/$(ARCHIVE): + cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) + +$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) + 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); $(CONFIGURE) . build + +$(LIBDYLIB): $(PLATFORM) + cd $(PLATFORM)/build; $(NATIVEPREFIX)/bin/ninja -v + +.installed-$(PLATFORM): $(LIBDYLIB) + cd $(PLATFORM)/build; $(NATIVEPREFIX)/bin/ninja -v install + touch $@ + +clean: + $(MAKE) -C $(PLATFORM) clean + rm -f .installed-$(PLATFORM) + +distclean: + rm -rf $(PLATFORM) .installed-$(PLATFORM) diff --git a/tools/depends/target/ffmpeg/CMakeLists.txt b/tools/depends/target/ffmpeg/CMakeLists.txt index f3959f9bb7..cc3086e15a 100644 --- a/tools/depends/target/ffmpeg/CMakeLists.txt +++ b/tools/depends/target/ffmpeg/CMakeLists.txt @@ -86,12 +86,19 @@ if(GNUTLS_FOUND) list(APPEND ffmpeg_conf --enable-gnutls) endif() +if(ENABLE_DAV1D) + list(APPEND ffmpeg_conf --enable-libdav1d) + set(pkgconf_path "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}") +else() + list(APPEND ffmpeg_conf --disable-libdav1d) +endif() + message(STATUS "FFMPEG_CONF: ${ffmpeg_conf}") include(ExternalProject) externalproject_add(ffmpeg SOURCE_DIR ${CMAKE_SOURCE_DIR} - CONFIGURE_COMMAND ${pkgconf} <SOURCE_DIR>/configure + CONFIGURE_COMMAND ${pkgconf} ${pkgconf_path} <SOURCE_DIR>/configure --prefix=${CMAKE_INSTALL_PREFIX} --extra-version="kodi-${FFMPEG_VER}" --disable-devices diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile index d3ce41fe36..848db2cdb1 100644 --- a/tools/depends/target/ffmpeg/Makefile +++ b/tools/depends/target/ffmpeg/Makefile @@ -21,6 +21,7 @@ ffmpg_config += --enable-encoder=ac3 --enable-encoder=aac ffmpg_config += --enable-encoder=wmav2 --enable-protocol=http ffmpg_config += --enable-gnutls ffmpg_config += --enable-encoder=png --enable-encoder=mjpeg +ffmpg_config += --enable-libdav1d ffmpg_config += $(FFMPEG_CONFIGURE_OPTIONS) ifeq ($(CROSS_COMPILING), yes) diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh index dc990b8ab0..fcbc8fa452 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh @@ -161,6 +161,7 @@ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ --enable-pthreads \ --enable-pic \ --enable-zlib \ + --enable-libdav1d \ --disable-mipsdsp \ --disable-mipsdspr2 \ ${FLAGS} |