Skip to content
Snippets Groups Projects
Commit b4cd6a8b authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by Jean-Baptiste Kempf
Browse files

contrib: librist: patch meson.build for libcjson

Debian is using cJSON from github.com/DaveGamble/cJSON, as well as
archlinux and homebrew, which is shipping a libcjson.pc file. Only
ubuntu is using a different version not including the .pc file.

Homebrew is also shipping a libcjson.pc file, and without this, it would
generate a pc file like that:

    prefix=/foo/bar/vlc/contrib/x86_64-apple-darwin21
    libdir=${prefix}/lib
    includedir=${prefix}/include

    Name: librist
    Description: Reliable Internet Stream Transport (RIST)
    Version: 0.2.4
    Libs: -L${libdir} -lrist /usr/local/Cellar/cjson/1.7.15/lib/libcjson.1.7.15.dylib
    Cflags: -I${includedir} -I/usr/local/Cellar/cjson/1.7.15/include

Which won't be valid, especially for a standalone build with the
macosx/build.sh script.

It was leading to undefined references to cJSON symbols when it's
installed from homebrew.

Backport from upstream 809390b3b75a259a704079d0fb4d8f1b5f7fa956.

Refs #26860
parent 3c181d46
No related branches found
No related tags found
Loading
Pipeline #215797 passed with stage
in 14 minutes and 22 seconds
diff --git a/meson.build b/meson.build
index a77780667dfb07d700d39c6c3353c0ba4906b178..0ed820152476e0caed3ba6d203ba236083fb8438 100755
--- a/meson.build
+++ b/meson.build
@@ -156,7 +156,7 @@ endif
#On ubuntu cjson does not come with pkgconfig files, hence the extended checking.
if not builtin_cjson
- cjson_lib = dependency('cJSON', required: false)
+ cjson_lib = dependency('libcjson', required: false)
if not cjson_lib.found()
cjson_lib = cc.find_library('cjson', required: required_library, has_headers: ['cjson/cJSON.h'])
if not cjson_lib.found()
......@@ -20,6 +20,7 @@ $(TARBALLS)/librist-$(LIBRIST_VERSION).tar.gz:
librist: librist-$(LIBRIST_VERSION).tar.gz .sum-librist
$(UNPACK)
$(APPLY) $(SRC)/librist/librist-fix-libcjson-meson.patch
$(MOVE)
.librist: librist crossfile.meson
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment