[vlc-commits] [Git][videolan/vlc][master] 9 commits: contrib: allow setting the name of the binary tools in meson

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Nov 9 10:16:00 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b9ec2649 by Steve Lhomme at 2024-11-09T09:20:47+00:00
contrib: allow setting the name of the binary tools in meson

PKGS.tools should have the name of the contrib package to handle dependencies.
So we add an extra variable to set the actual name to write in the meson file.

- - - - -
1fdae1eb by Steve Lhomme at 2024-11-09T09:20:47+00:00
contrib: gcrypt: add libgcrypt-config to the meson binaries

Otherwise meson doesn't find it.

Only do it when we build our own version. Otherwise use whatever the system provides.

- - - - -
2caaed98 by Steve Lhomme at 2024-11-09T09:20:47+00:00
meson: unify the gcrypt detection

The proper detection was added in 62587d48feb8fbbeb9e8a374242c2c40e2b751f7.

- - - - -
c077cffd by Steve Lhomme at 2024-11-09T09:20:47+00:00
meson: create a srtp dependency

The dependency used in srtp_lib is not carried over in the module.
But it may contain compile_args that are not accessible another way.
We put everything need to use the srtp library in a meson dependency
that can be used from many places.

- - - - -
c373cc76 by Steve Lhomme at 2024-11-09T09:20:47+00:00
meson: fix cdda building when gcrypt is used

- - - - -
511b5827 by Steve Lhomme at 2024-11-09T09:20:47+00:00
meson: fix adaptive build when gcrypt is found

- - - - -
96ce4b7a by Steve Lhomme at 2024-11-09T09:20:47+00:00
meson: add a define for the gcrypt detection

As done by autotools.

- - - - -
2e6fe9a1 by Steve Lhomme at 2024-11-09T09:20:47+00:00
meson: handle stream output support for SRTP

- - - - -
9fa2f2d3 by Steve Lhomme at 2024-11-09T09:20:47+00:00
meson: add liveHTTP access output module

- - - - -


12 changed files:

- config.h.meson
- contrib/src/gcrypt/rules.mak
- contrib/src/lua/rules.mak
- contrib/src/meson-machinefile/rules.mak
- contrib/src/protobuf/rules.mak
- meson.build
- modules/access/meson.build
- modules/access/rtp/meson.build
- modules/access_output/meson.build
- modules/demux/meson.build
- modules/meson.build
- modules/stream_out/meson.build


Changes:

=====================================
config.h.meson
=====================================
@@ -131,6 +131,9 @@
 /* Define to 1 if you have the <sys/auxv.h> header file */
 #mesondefine HAVE_SYS_AUXV_H
 
+/* Defined if having gcrypt */
+#mesondefine HAVE_GCRYPT
+
 /* Define to 1 if you have the `getauxval' function. */
 #mesondefine HAVE_GETAUXVAL
 


=====================================
contrib/src/gcrypt/rules.mak
=====================================
@@ -5,6 +5,10 @@ GCRYPT_URL := $(GNUGPG)/libgcrypt/libgcrypt-$(GCRYPT_VERSION).tar.bz2
 PKGS += gcrypt
 ifeq ($(call need_pkg,"libgcrypt"),)
 PKGS_FOUND += gcrypt
+else
+PKGS.tools += gcrypt
+PKGS.tools.gcrypt.config-tool = libgcrypt-config
+PKGS.tools.gcrypt.path = $(PREFIX)/bin/libgcrypt-config
 endif
 
 $(TARBALLS)/libgcrypt-$(GCRYPT_VERSION).tar.bz2:


=====================================
contrib/src/lua/rules.mak
=====================================
@@ -30,6 +30,7 @@ PKGS += lua luac
 PKGS_TOOLS += luac
 PKGS_ALL += luac
 PKGS.tools += luac
+PKGS.tools.luac.config-tool = luac
 PKGS.tools.luac.path = $(BUILDBINDIR)/$(HOST)-luac
 
 LUAC_IF_NOT_CROSS =


=====================================
contrib/src/meson-machinefile/rules.mak
=====================================
@@ -21,7 +21,7 @@ meson-machinefile/contrib.ini: $(SRC)/gen-meson-machinefile.py meson-machinefile
 	PREFIX="$(PREFIX)" \
 	$(SRC)/gen-meson-machinefile.py \
 		--type external-$(CROSS_OR_NATIVE) \
-		$(foreach tool,$(filter-out $(PKGS_FOUND),$(PKGS.tools)),--binary $(tool):$(PKGS.tools.$(tool).path)) \
+		$(foreach tool,$(filter-out $(PKGS_FOUND),$(PKGS.tools)),--binary $(PKGS.tools.$(tool).config-tool):$(PKGS.tools.$(tool).path)) \
 		$@
 
 # Dummy target, there is nothing to check


=====================================
contrib/src/protobuf/rules.mak
=====================================
@@ -18,6 +18,7 @@ ifndef HAVE_CROSS_COMPILE
 PKGS_FOUND += protoc
 endif
 endif
+PKGS.tools.protoc.config-tool = protoc
 PKGS.tools.protoc.path = $(BUILDBINDIR)/protoc
 
 ifeq ($(call system_tool_majmin, protoc --version),$(PROTOBUF_MAJPACKAGE).$(PROTOBUF_MAJVERSION))


=====================================
meson.build
=====================================
@@ -1022,7 +1022,12 @@ if get_option('default_monospace_font_family') != ''
     cdata.set_quoted('DEFAULT_MONOSPACE_FAMILY', get_option('default_monospace_font_family'))
 endif
 
-gcrypt_dep = dependency('libgcrypt', required: get_option('libgcrypt'))
+gcrypt_dep = dependency('libgcrypt',
+                         version: '>= 1.6.0',
+                         required: get_option('libgcrypt'))
+if gcrypt_dep.found()
+    cdata.set('HAVE_GCRYPT', 1)
+endif
 
 # Flex/Bison support
 # This defines the `bison_gen` and `flex_gen` generator variables to be used


=====================================
modules/access/meson.build
=====================================
@@ -208,7 +208,6 @@ endif
 if get_option('vcd_module')
     vcd_cdda_flags = []
 
-    # TODO: Add gcrypt dependency if it's present
     libcddb_dep = dependency('libcddb', version: '>= 0.9.5', required: get_option('libcddb'))
     if libcddb_dep.found()
         vcd_cdda_flags += '-DHAVE_LIBCDDB'
@@ -226,7 +225,7 @@ if get_option('vcd_module')
         needed_vcd_unix_headers_present = false
     endif
 
-    if (needed_vcd_unix_headers_present or 
+    if (needed_vcd_unix_headers_present or
         host_system in ['windows'] or have_osx)
 
         vcd_cdda_darwin_deps = []
@@ -243,7 +242,7 @@ if get_option('vcd_module')
             ),
             'c_args' : vcd_cdda_flags,
             'link_with' : vlc_json_lib,
-            'dependencies' : [libcddb_dep, vcd_cdda_darwin_deps]
+            'dependencies' : [libcddb_dep, vcd_cdda_darwin_deps, gcrypt_dep]
         }
 
         vlc_modules += {


=====================================
modules/access/rtp/meson.build
=====================================
@@ -4,20 +4,23 @@ rtp_lib = static_library('rtp',
     install: false,
     pic: true)
 
-if libgcrypt_dep.found()
+if gcrypt_dep.found()
     srtp_lib = static_library('srtp',
                     files('srtp.c', 'srtp.h'),
-                    dependencies: [libgcrypt_dep],
+                    dependencies: [gcrypt_dep],
                     include_directories: [vlc_include_dirs])
-    srtp_rtp_c_args = ['-DHAVE_SRTP']
+    srtp_dep = declare_dependency(
+        link_with: [srtp_lib],
+        include_directories: [include_directories('.')],
+        dependencies: [gcrypt_dep],
+        compile_args: ['-DHAVE_SRTP'])
 else
-    srtp_lib = []
-    srtp_rtp_c_args = []
+    srtp_dep = disabler()
 endif
 
 vlc_modules += {
     'name': 'rtp',
-    'sources': 
+    'sources':
         files(
             'input.c',
             'sdp.c',
@@ -27,9 +30,8 @@ vlc_modules += {
             'rtp.c',
             'rtp.h',
         ),
-    'dependencies': [socket_libs],
-    'link_with': [rtp_lib, srtp_lib],
-    'c_args': srtp_rtp_c_args,
+    'dependencies': [socket_libs, srtp_dep],
+    'link_with': [rtp_lib],
 }
 
 vlc_modules += {


=====================================
modules/access_output/meson.build
=====================================
@@ -18,7 +18,14 @@ vlc_modules += {
     'sources' : files('http.c')
 }
 
-# TODO: Add HAVE_GCRYPT + livehttp
+# liveHTTP
+gpg_error_dep = cc.find_library('gpg-error', dirs: contrib_libdir, required: false)
+vlc_modules += {
+    'name' : 'access_output_livehttp',
+    'sources' : files('livehttp.c'),
+    'dependencies' : [ gcrypt_dep, gpg_error_dep ],
+    'enabled' : gcrypt_dep.found() and gpg_error_dep.found(),
+}
 
 # Shout (Icecast and old Shoutcast)
 shout_dep = dependency('shout', version: '>= 2.1', required: get_option('shout'))


=====================================
modules/demux/meson.build
=====================================
@@ -585,9 +585,8 @@ vlc_modules += {
 
     ),
     'include_directories' : include_directories('adaptive', './'),
-    'dependencies' : [socket_libs, m_lib, z_dep],
+    'dependencies' : [socket_libs, m_lib, z_dep, gcrypt_dep],
     'link_with' : vlc_http_lib,
-    # TODO: Add optional GCRYPT dependency!
 }
 
 # noseek demux


=====================================
modules/meson.build
=====================================
@@ -194,10 +194,6 @@ zvbi_dep = dependency('zvbi-0.2', version: '>= 0.2.28', required: false)
 # rsvg, used by SVG codec and text renderer
 rsvg_dep = dependency('librsvg-2.0', version: '>= 2.9.0', required: get_option('rsvg'))
 
-# libgcrypt, used by rtp, access, stream_out
-libgcrypt_dep = dependency('libgcrypt',
-                            version: '>= 1.6.0',
-                            required: get_option('libgcrypt'))
 # Rust support
 cargo_bin = find_program('cargo', required: get_option('rust'))
 


=====================================
modules/stream_out/meson.build
=====================================
@@ -135,8 +135,7 @@ vlc_modules += {
         'rtcp.c',
         'rtsp.c',
     ),
-    'dependencies' : [socket_libs]
-    # TODO: Add optional GCrypt dependency
+    'dependencies' : [socket_libs, srtp_dep]
 }
 
 # Chromaprint module



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/502ce07e08e0c3db51e30a87d0d07a17623b51fd...9fa2f2d31ec9acf1be20545b8177a88240baa65b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/502ce07e08e0c3db51e30a87d0d07a17623b51fd...9fa2f2d31ec9acf1be20545b8177a88240baa65b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list