forked from NetBSD/pkgsrc
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gerbera: fix build on systems that use const in second argument to iconv
- Loading branch information
nros
committed
Oct 6, 2022
1 parent
abb05ac
commit a1760c6
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
$NetBSD: distinfo,v 1.2 2022/07/11 11:49:48 adam Exp $ | ||
$NetBSD: distinfo,v 1.3 2022/10/06 08:41:03 nros Exp $ | ||
|
||
BLAKE2s (gerbera-1.11.0.tar.gz) = b5262860214cd153029adb3895f4c6d332a3ebd40d38f45728af001b80a71eaa | ||
SHA512 (gerbera-1.11.0.tar.gz) = ae2b3342b3b57ce6d656d0ebadfd73b5f2764f2164314f6b0deac170a82e6861349c37732e6914454918112124038b221dbd4882001b5de51a49326432ccd70f | ||
Size (gerbera-1.11.0.tar.gz) = 4115178 bytes | ||
SHA1 (patch-CMakeLists.txt) = 97f56d9c927c40ad8179d80f97f338441fae142f | ||
SHA1 (patch-src_main.cc) = b7b59975bc477141c8a92af9200ba2b301e55926 | ||
SHA1 (patch-src_util_string__converter.cc) = f60a91b8ccdb851c5e939254e429ac08f5715196 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
$NetBSD: patch-CMakeLists.txt,v 1.1 2022/10/06 08:41:03 nros Exp $ | ||
|
||
* fix build on systems that have const in second argument to iconv | ||
|
||
--- CMakeLists.txt.orig 2022-05-03 17:39:25.000000000 +0000 | ||
+++ CMakeLists.txt | ||
@@ -326,6 +326,16 @@ target_link_libraries(libgerbera PUBLIC | ||
|
||
find_package(Iconv REQUIRED) | ||
target_link_libraries(libgerbera PUBLIC Iconv::Iconv) | ||
+include(CheckPrototypeDefinition) | ||
+set(CMAKE_REQUIRED_LIBRARIES Iconv::Iconv) | ||
+check_prototype_definition(iconv | ||
+ "size_t iconv(iconv_t cd, const char ** src, size_t * srcl, char ** dst, size_t * dstl)" | ||
+ 0 "iconv.h" ICONV_CONST) | ||
+if(ICONV_CONST) | ||
+ target_compile_definitions(libgerbera PRIVATE ICONV_CONST) | ||
+endif() | ||
+unset(CMAKE_REQUIRED_LIBRARIES) | ||
+ | ||
|
||
find_package(UUID REQUIRED) | ||
target_link_libraries(libgerbera PUBLIC UUID::UUID) |
17 changes: 17 additions & 0 deletions
17
multimedia/gerbera/patches/patch-src_util_string__converter.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$NetBSD: patch-src_util_string__converter.cc,v 1.3 2022/10/06 08:41:03 nros Exp $ | ||
|
||
* fix build on systems that have const in second argument to iconv | ||
|
||
--- src/util/string_converter.cc.orig 2022-10-06 08:09:22.564707578 +0000 | ||
+++ src/util/string_converter.cc | ||
@@ -122,8 +122,8 @@ std::string StringConverter::_convert(co | ||
// log_debug(("iconv: BEFORE: input bytes left: {} output bytes left: {}", | ||
// input_bytes, output_bytes)); | ||
#if defined(ICONV_CONST) || defined(SOLARIS) | ||
- int ret = iconv(cd, inputPtr, &input_bytes, | ||
- output_ptr, &output_bytes); | ||
+ int ret = iconv(cd, inputPtr, &inputBytes, | ||
+ outputPtr, &outputBytes); | ||
#else | ||
int ret = iconv(cd, const_cast<char**>(inputPtr), &inputBytes, | ||
outputPtr, &outputBytes); |