gerbera: update to 1.6.1

Removed upstream ffmpeg backport.

Updated npupnp patch with latest upstream version.

Enabled CURL since it's needed for libnpupnp anyway.

Fixed up GCC filesystem CMake variables to be more accurate.

Removed npupnp include hack since it was properly fixed now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-09-03 14:43:20 -07:00
parent 8b36a761fe
commit 65fbf39e2c
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
3 changed files with 43 additions and 69 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gerbera
PKG_VERSION:=1.6.0
PKG_RELEASE:=2
PKG_VERSION:=1.6.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/gerbera/gerbera/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=3a4956ec5fea1101e8daa32d9cfb985db908a49e2ac6137a1b2bf509e2684a6c
PKG_HASH:=9bb119ee422c8e7a053c309256215a8899dfd6707f6b93496e6facea7978ac7c
PKG_MAINTAINER:=
PKG_LICENSE:=GPL-2.0-or-later
@ -45,13 +45,13 @@ define Package/gerbera/conffiles
endef
CMAKE_OPTIONS += \
-DCXX_FILESYSTEM_NO_LINK_NEEDED=$(if $(CONFIG_GCC_USE_VERSION_9),ON,OFF) \
-DCXX_FILESYSTEM_STDCPPFS_NEEDED=$(if $(CONFIG_GCC_USE_VERSION_8),OFF,ON) \
-DCXX_FILESYSTEM_NO_LINK_NEEDED=$(if $(CONFIG_GCC_USE_VERSION_8),OFF,ON) \
$(if $(CONFIG_GCC_USE_VERSION_8),-DCXX_FILESYSTEM_STDCPPFS_NEEDED=OFF) \
-DIconv_INCLUDE_DIR=$(ICONV_PREFIX)/include \
-DIconv_LIBRARY=$(ICONV_PREFIX)/lib/libiconv.a \
-DWITH_MAGIC=ON \
-DWITH_MYSQL=OFF \
-DWITH_CURL=OFF \
-DWITH_CURL=ON \
-DWITH_INOTIFY=ON \
-DWITH_JS=OFF \
-DWITH_TAGLIB=ON \
@ -69,8 +69,7 @@ CMAKE_OPTIONS += \
TARGET_CFLAGS += \
-ffunction-sections \
-fdata-sections \
-flto \
-I$(STAGING_DIR)/usr/include/npupnp/upnp
-flto
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed

View File

@ -1,31 +0,0 @@
From 72f9db7bd75f03e9e7afeaaa0aa0ab7af9fe81a5 Mon Sep 17 00:00:00 2001
From: Yuri Timenkov <yuri@timenkov.ru>
Date: Sun, 26 Jul 2020 12:17:15 +0000
Subject: [PATCH] Fixed build with ffmnpeg but without thumbnailer
Fixes: #953
---
src/metadata/ffmpeg_handler.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/metadata/ffmpeg_handler.cc b/src/metadata/ffmpeg_handler.cc
index 4bba5655..e0ff84bb 100644
--- a/src/metadata/ffmpeg_handler.cc
+++ b/src/metadata/ffmpeg_handler.cc
@@ -265,6 +265,8 @@ void FfmpegHandler::fillMetadata(std::shared_ptr<CdsItem> item)
avformat_close_input(&pFormatCtx);
}
+#ifdef HAVE_FFMPEGTHUMBNAILER
+
fs::path getThumbnailCacheBasePath(Config& config)
{
if (auto configuredDir = config.getOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_CACHE_DIR);
@@ -284,7 +286,6 @@ fs::path getThumbnailCachePath(const fs::path& base, const fs::path& movie)
return path;
}
-#ifdef HAVE_FFMPEGTHUMBNAILER
std::optional<std::vector<std::byte>> FfmpegHandler::readThumbnailCacheFile(const fs::path& movie_filename) const
{
auto path = getThumbnailCachePath(getThumbnailCacheBasePath(*config), movie_filename);

View File

@ -1,4 +1,4 @@
From 993e4e157e4a8c4898b45982045cf63e3b57a6a1 Mon Sep 17 00:00:00 2001
From a13f3588f78e9ffda5e915f44cbf1957f12513c4 Mon Sep 17 00:00:00 2001
From: Jean-Francois Dockes <jf@dockes.org>
Date: Fri, 13 Mar 2020 09:19:04 +0100
Subject: [PATCH] Quick changes for working with NPUPNP
@ -6,27 +6,27 @@ Subject: [PATCH] Quick changes for working with NPUPNP
(Rebased and made default)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
CMakeLists.txt | 35 +++++++++++++++---------
src/action_request.cc | 11 +++++++-
CMakeLists.txt | 43 +++++++++++++++++-------
src/action_request.cc | 11 +++++-
src/device_description_handler.cc | 4 +++
src/file_request_handler.cc | 4 +++
src/iohandler/file_io_handler.cc | 1 -
src/iohandler/io_handler.cc | 1 -
src/iohandler/mem_io_handler.cc | 1 -
src/serve_request_handler.cc | 8 ++++++
src/server.cc | 8 ++++++
src/serve_request_handler.cc | 8 +++++
src/server.cc | 8 +++++
src/transcoding/transcode_ext_handler.cc | 1 -
src/upnp_cds.cc | 11 ++++++++
src/upnp_cm.cc | 11 ++++++++
src/upnp_mrreg.cc | 7 ++++-
src/url_request_handler.cc | 5 +++-
src/util/upnp_clients.cc | 12 ++++++++
src/util/upnp_headers.cc | 14 ++++++++++
src/upnp_cds.cc | 11 ++++++
src/upnp_cm.cc | 11 ++++++
src/upnp_mrreg.cc | 7 +++-
src/url_request_handler.cc | 5 ++-
src/util/upnp_clients.cc | 12 +++++++
src/util/upnp_headers.cc | 12 +++++++
src/web/web_request_handler.cc | 4 +++
17 files changed, 118 insertions(+), 20 deletions(-)
17 files changed, 124 insertions(+), 20 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 81f7818e..56472b97 100644
index 8b6db993..b23dad57 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,7 @@ if (CONAN_EXPORTED)
@ -37,17 +37,25 @@ index 81f7818e..56472b97 100644
set(WITH_MAGIC 1 CACHE BOOL "Use libmagic to identify file mime types")
set(WITH_MYSQL 0 CACHE BOOL "Store media information in MySQL DB")
set(WITH_CURL 1 CACHE BOOL "CURL required for online services")
@@ -303,23 +304,31 @@ add_definitions(${LFS_DEFINITIONS})
@@ -303,23 +304,39 @@ add_definitions(${LFS_DEFINITIONS})
add_compile_options(${LFS_COMPILE_OPTIONS})
target_link_libraries(libgerbera ${LFS_LIBRARIES})
-find_package (pupnp "1.12.1" REQUIRED)
+if (WITH_NPUPNP)
+ pkg_check_modules (NPUPNP REQUIRED libnpupnp)
+ include_directories (${NPUPNP_INCLUDE_DIRS})
+ set(CMAKE_REQUIRED_LIBRARIES npupnp)
+ add_definitions(-DUSING_NPUPNP)
+ target_link_libraries (libgerbera ${NPUPNP_LIBRARIES})
+ find_package(PkgConfig QUIET)
+ pkg_check_modules (NPUPNP QUIET libnpupnp>=4.0.11)
+ if (NOT NPUPNP_FOUND)
+ find_package (NPUPNP REQUIRED)
+ endif()
+ if (NPUPNP_FOUND)
+ include_directories (${NPUPNP_INCLUDE_DIRS})
+ set(CMAKE_REQUIRED_LIBRARIES npupnp)
+ add_definitions(-DUSING_NPUPNP)
+ target_link_libraries (libgerbera ${NPUPNP_LIBRARIES})
+ else()
+ message(FATAL_ERROR "libnpupnp not found")
+ endif()
+else()
+ find_package (pupnp "1.12.1" REQUIRED)
@ -190,7 +198,7 @@ index 5574a16d..223746ef 100644
#include <sys/types.h>
#include <unistd.h>
diff --git a/src/serve_request_handler.cc b/src/serve_request_handler.cc
index 210140a3..01dde69b 100644
index 59f37252..42d07e94 100644
--- a/src/serve_request_handler.cc
+++ b/src/serve_request_handler.cc
@@ -94,7 +94,11 @@ void ServeRequestHandler::getInfo(const char* filename, UpnpFileInfo* info)
@ -392,10 +400,10 @@ index f2a99c94..7de2227d 100644
/// \todo transcoding for get_info
diff --git a/src/util/upnp_clients.cc b/src/util/upnp_clients.cc
index 2033cf31..1dd7964d 100644
index 6fd40de2..28f0fb16 100644
--- a/src/util/upnp_clients.cc
+++ b/src/util/upnp_clients.cc
@@ -268,6 +268,17 @@ bool Clients::getInfoByType(const std::string& match, ClientMatchType type, cons
@@ -262,6 +262,17 @@ bool Clients::getInfoByType(const std::string& match, ClientMatchType type, cons
bool Clients::downloadDescription(const std::string& location, std::unique_ptr<pugi::xml_document>& xml)
{
@ -413,7 +421,7 @@ index 2033cf31..1dd7964d 100644
IXML_Document* descDoc = nullptr;
int errCode = UpnpDownloadXmlDoc(location.c_str(), &descDoc);
if (errCode != UPNP_E_SUCCESS) {
@@ -281,6 +292,7 @@ bool Clients::downloadDescription(const std::string& location, std::unique_ptr<p
@@ -275,6 +286,7 @@ bool Clients::downloadDescription(const std::string& location, std::unique_ptr<p
ixmlFreeDOMString(cxml);
ixmlDocument_free(descDoc);
@ -422,7 +430,7 @@ index 2033cf31..1dd7964d 100644
if (ret.status != pugi::xml_parse_status::status_ok) {
log_debug("Unable to parse xml client description from {}", location);
diff --git a/src/util/upnp_headers.cc b/src/util/upnp_headers.cc
index ef85106b..aec13850 100644
index 6eddedec..b7763444 100644
--- a/src/util/upnp_headers.cc
+++ b/src/util/upnp_headers.cc
@@ -25,11 +25,13 @@
@ -430,7 +438,7 @@ index ef85106b..aec13850 100644
#include "upnp_headers.h" // API
+#if !defined(USING_NPUPNP)
#if (UPNP_VERSION > 11201)
#if (UPNP_VERSION > 11299)
#include <UpnpExtraHeaders.h>
#else
#include <ExtraHeaders.h>
@ -439,14 +447,12 @@ index ef85106b..aec13850 100644
#include <string>
#include "common.h"
@@ -101,18 +103,29 @@ void Headers::writeHeaders(UpnpFileInfo* fileInfo) const
@@ -101,18 +103,27 @@ void Headers::writeHeaders(UpnpFileInfo* fileInfo) const
if (headers == nullptr)
return;
+#if defined(USING_NPUPNP)
+ for (const auto& iter : *headers) {
+ fileInfo->response_headers.push_back(iter);
+ }
+ std::copy(headers->begin(), headers->end(), std::back_inserter(fileInfo->response_headers));
+#else
auto head = const_cast<UpnpListHead*>(UpnpFileInfo_get_ExtraHeadersList(fileInfo));
for (const auto& iter : *headers) {
@ -469,7 +475,7 @@ index ef85106b..aec13850 100644
auto head = const_cast<UpnpListHead*>(UpnpFileInfo_get_ExtraHeadersList(fileInfo));
UpnpListIter pos;
for (pos = UpnpListBegin(head); pos != UpnpListEnd(head); pos = UpnpListNext(head, pos)) {
@@ -121,6 +134,7 @@ std::unique_ptr<std::map<std::string, std::string>> Headers::readHeaders(UpnpFil
@@ -121,6 +132,7 @@ std::unique_ptr<std::map<std::string, std::string>> Headers::readHeaders(UpnpFil
auto add = parseHeader(header);
ret->insert(add);
}