[libdvdnav-devel] [Git][videolan/libdvdnav][master] 4 commits: meson: Add Meson build support
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Sun Aug 31 10:15:07 UTC 2025
Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdnav
Commits:
8ad2a404 by robxnano at 2025-08-30T17:40:29+01:00
meson: Add Meson build support
- - - - -
9305b63f by robxnano at 2025-08-30T17:40:29+01:00
Fix include in dvdnav.h
- - - - -
24f9f165 by robxnano at 2025-08-30T17:40:29+01:00
meson: Add cross files from libdvdread
- - - - -
a13cb822 by robxnano at 2025-08-30T17:40:29+01:00
ci: Update to newer images
- - - - -
16 changed files:
- .gitignore
- .gitlab-ci.yml
- ChangeLog
- doc/doxy.conf
- + doc/meson.build
- + examples/meson.build
- + meson.build
- + meson_options.txt
- + package/crossfiles/aarch64-w64-mingw32.meson
- + package/crossfiles/arm-linux-gnueabihf.meson
- + package/crossfiles/armv7-w64-mingw32.meson
- + package/crossfiles/i686-w64-mingw32.meson
- + package/crossfiles/x86_64-w64-mingw32.meson
- src/dvdnav/dvdnav.h
- + src/dvdnav/meson.build
- + src/meson.build
Changes:
=====================================
.gitignore
=====================================
@@ -34,3 +34,5 @@
/src/vm/*.o
/src/vm/.libs/
/src/vm/.dirstamp
+/subprojects/*/
+/subprojects/.wraplock
=====================================
.gitlab-ci.yml
=====================================
@@ -5,136 +5,67 @@ variables:
GIT_SUBMODULE_STRATEGY: normal
build-debian:
- image: registry.videolan.org/vlc-debian-unstable:20200529132440
+ image: registry.videolan.org/dav1d-debian-unstable:20250207200301
stage: build
tags:
- docker
- amd64
script:
- - autoreconf -fisv
- - mkdir build
- - cd build
- - ../configure
- - make -j $(getconf _NPROCESSORS_ONLN)
+ - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
+ - meson setup build
+ - meson compile -C build
-build-macos-x86_64:
+build-raspberry:
+ image: registry.videolan.org/vlc-ubuntu-raspberry:20240806085528
stage: build
tags:
- - monterey
+ - docker
+ - amd64
script:
- - curl -sS -O https://artifacts.videolan.org/vlc/macos-x86_64/vlc-contrib-x86_64-apple-darwin19-b9001b49855ae2e96274777da57d8da8ad52face.tar.bz2
- - tar xf vlc-contrib-x86_64-apple-darwin19-b9001b49855ae2e96274777da57d8da8ad52face.tar.bz2
- - cd x86_64-apple-darwin19
- - curl -sS -o ./change_prefix.sh 'https://code.videolan.org/videolan/vlc/-/raw/master/contrib/src/change_prefix.sh?inline=false'
- - chmod +x ./change_prefix.sh
- - ./change_prefix.sh
- - curl -sS -o ./env.build.sh 'https://code.videolan.org/videolan/vlc/-/raw/master/extras/package/macosx/env.build.sh?inline=false'
- - chmod +x ./env.build.sh
- - source ./env.build.sh "contrib"
- - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`pwd -P`/lib/pkgconfig/"
- - export PATH="$PATH:`pwd -P`/bin/"
- - cd ../
- - autoreconf -fisv
- - mkdir build
- - cd build
- - ../configure
- - make -j $(getconf _NPROCESSORS_ONLN)
- - make install DESTDIR=`pwd`/artifacts
- variables:
- VLC_PATH: /Users/videolanci/sandbox/bin
- VLC_FORCE_KERNELVERSION: 19
- HOST_ARCH: x86_64
- artifacts:
- name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
- paths:
- - build/artifacts/
- expire_in: 1 week
+ - MESON_VERSION=1.8.4
+ - MESON_URL=https://github.com/mesonbuild/meson/releases/download/${MESON_VERSION}/meson-${MESON_VERSION}.tar.gz
+ - MESON_SHASUM512=3325c3968649847621e4d39309222741e5158b204ff6cc88410f364634c9978b5fb4c02c73968b3b7df46c89371a5b27aec9a997917dae757415bd77f5db39f2
+ - curl -LsO "${MESON_URL}" && echo $MESON_SHASUM512 meson-${MESON_VERSION}.tar.gz | sha512sum -c - && tar xvzf meson-${MESON_VERSION}.tar.gz
+
+ - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
+ - meson-${MESON_VERSION}/meson.py setup build --cross-file package/crossfiles/arm-linux-gnueabihf.meson
+ - meson-${MESON_VERSION}/meson.py compile -C build
-build-macos-arm64:
+build-macos:
stage: build
tags:
- - macos-xcode15
+ - amd64
+ - macos
script:
- - curl -sS -O https://artifacts.videolan.org/vlc/macos-arm64/vlc-contrib-aarch64-apple-darwin19-b9001b49855ae2e96274777da57d8da8ad52face.tar.bz2
- - tar xf vlc-contrib-aarch64-apple-darwin19-b9001b49855ae2e96274777da57d8da8ad52face.tar.bz2
- - cd aarch64-apple-darwin19
- - curl -sS -o ./change_prefix.sh 'https://code.videolan.org/videolan/vlc/-/raw/master/contrib/src/change_prefix.sh?inline=false'
- - chmod +x ./change_prefix.sh
- - ./change_prefix.sh
- - curl -sS -o ./env.build.sh 'https://code.videolan.org/videolan/vlc/-/raw/master/extras/package/macosx/env.build.sh?inline=false'
- - chmod +x ./env.build.sh
- - source ./env.build.sh "contrib"
- - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`pwd -P`/lib/pkgconfig/"
- - export PATH="$PATH:`pwd -P`/bin/"
- - cd ../
- - autoreconf -fisv
- - mkdir build
- - cd build
- - ../configure
- - make -j $(getconf _NPROCESSORS_ONLN)
- - make install DESTDIR=`pwd`/artifacts
- variables:
- VLC_PATH: /Users/videolanci/sandbox/bin
- VLC_FORCE_KERNELVERSION: 19
- HOST_ARCH: aarch64
- artifacts:
- name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
- paths:
- - build/artifacts/
- expire_in: 1 week
+ - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
+ - meson setup build
+ - meson compile -C build
-build-win64:
- image: registry.videolan.org/vlc-debian-win64-posix:20241118101328
+build-win:
+ image: registry.videolan.org/dav1d-debian-unstable:20250207200301
stage: build
tags:
- docker
- amd64
script:
- - wget -nv https://artifacts.videolan.org/vlc/win64/vlc-contrib-x86_64-w64-mingw32-639e528b4c58661401c6c88bc3774b39ab07592e.tar.bz2
- - tar xf vlc-contrib-x86_64-w64-mingw32-639e528b4c58661401c6c88bc3774b39ab07592e.tar.bz2
- - cd x86_64-w64-mingw32
- - wget -nv -O ./change_prefix.sh 'https://code.videolan.org/videolan/vlc/-/raw/master/contrib/src/change_prefix.sh?inline=false'
- - chmod +x ./change_prefix.sh
- - ./change_prefix.sh
- - cd ..
- - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`realpath x86_64-w64-mingw32`/lib/pkgconfig/"
- - export PATH="$PATH:`realpath x86_64-w64-mingw32`/bin/"
- - autoreconf -fisv
- - mkdir build
- - cd build
- - ../configure --host=x86_64-w64-mingw32
- - make -j $(getconf _NPROCESSORS_ONLN)
- - make install DESTDIR=`pwd`/artifacts
- artifacts:
- name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
- paths:
- - build/artifacts/
- expire_in: 1 week
+ - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
+ - meson setup build --cross-file package/crossfiles/${CROSSFILE}.meson
+ - meson compile -C build
+ parallel:
+ matrix:
+ - CROSSFILE: [i686-w64-mingw32, x86_64-w64-mingw32]
+
-build-win32:
- image: registry.videolan.org/vlc-debian-llvm-msvcrt:20241118101328
+build-win-arm:
+ image: registry.videolan.org/vlc-debian-llvm-msvcrt:20250305204125
stage: build
tags:
- docker
- amd64
script:
- - wget -nv https://artifacts.videolan.org/vlc/win32-llvm/vlc-contrib-i686-w64-mingw32-639e528b4c58661401c6c88bc3774b39ab07592e.tar.bz2
- - tar xf vlc-contrib-i686-w64-mingw32-639e528b4c58661401c6c88bc3774b39ab07592e.tar.bz2
- - cd i686-w64-mingw32
- - wget -nv -O ./change_prefix.sh 'https://code.videolan.org/videolan/vlc/-/raw/master/contrib/src/change_prefix.sh?inline=false'
- - chmod +x ./change_prefix.sh
- - ./change_prefix.sh
- - cd ..
- - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`realpath i686-w64-mingw32`/lib/pkgconfig/"
- - export PATH="$PATH:`realpath i686-w64-mingw32`/bin/"
- - autoreconf -fisv
- - mkdir build
- - cd build
- - ../configure --host=i686-w64-mingw32
- - make -j $(getconf _NPROCESSORS_ONLN)
- - make install DESTDIR=`pwd`/artifacts
- artifacts:
- name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
- paths:
- - build/artifacts/
- expire_in: 1 week
+ - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
+ - meson setup build --cross-file package/crossfiles/${CROSSFILE}.meson
+ - meson compile -C build
+ parallel:
+ matrix:
+ - CROSSFILE: [armv7-w64-mingw32, aarch64-w64-mingw32]
=====================================
ChangeLog
=====================================
@@ -5,6 +5,7 @@ libdvdnav (6.2.0)
* add dvdnav_toggle_spu_stream API to enable/disable the current SPU stream
* add dvdnav_get_disk_region_mask API to get the reported version from the disk
* expose dvdnav_jump_to_sector_by_time to the API
+ * switch build system to Meson
* fix crashes and avoid asserts
libdvdnav (6.1.1)
=====================================
doc/doxy.conf
=====================================
@@ -30,7 +30,7 @@ PROJECT_NUMBER =
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
-OUTPUT_DIRECTORY =
+OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
@@ -316,7 +316,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = .
+INPUT = @INPUT_DIRECTORY@
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
=====================================
doc/meson.build
=====================================
@@ -0,0 +1,31 @@
+# Copyright (C) 2025 Rob Hall
+# SPDX-License-Identifier: MIT
+
+if not get_option('enable_docs')
+ subdir_done()
+endif
+
+doxygen = find_program('doxygen', required: true)
+
+doxyfile_conf = configuration_data()
+doxyfile_conf.set('INPUT', f'@dvdnav_src_root@/src/dvdnav \\\n @dvdnav_build_root@/src/dvdnav')
+doxyfile_conf.set('PROJECT_NAME', 'libdvdnav')
+doxyfile_conf.set('STRIP_FROM_PATH', f'@dvdnav_src_root@/src \\\n @dvdnav_build_root@/src')
+doxyfile_conf.set('OUTPUT_DIRECTORY', meson.current_build_dir())
+doxyfile_conf.set('INPUT_DIRECTORY', meson.current_source_dir())
+doxyfile_conf.set('PROJECT_VERSION', meson.project_version())
+
+doxyfile = configure_file(
+ input: 'doxy.conf',
+ output: 'Doxyfile',
+ configuration: doxyfile_conf,
+)
+
+custom_target('docs',
+ depend_files: dvdnav_api_headers,
+ command: [doxygen, '-q', doxyfile],
+ output: ['html'],
+ install: true,
+ install_dir: get_option('datadir') / 'doc/libdvdnav',
+ install_tag: 'doc',
+)
=====================================
examples/meson.build
=====================================
@@ -0,0 +1,9 @@
+# Copyright (C) 2025 Rob Hall
+# SPDX-License-Identifier: MIT
+
+if not get_option('enable_examples')
+ subdir_done()
+endif
+
+executable('menus', 'menus.c',
+ dependencies: [dvdnav_dep, dvdread_dependency])
=====================================
meson.build
=====================================
@@ -0,0 +1,124 @@
+# Copyright (C) 2025 Rob Hall
+# SPDX-License-Identifier: MIT
+
+project('libdvdnav', 'c',
+ version: '6.2.0',
+ meson_version: '>= 0.60.0',
+ default_options: ['buildtype=debugoptimized',
+ 'c_std=c17',
+ 'default_library=both',
+ 'warning_level=2'])
+
+dvdnav_src_root = meson.current_source_dir()
+dvdnav_build_root = meson.current_build_dir()
+cc = meson.get_compiler('c')
+
+# Configuration data for config.h
+cdata = configuration_data()
+
+# Include directories
+dvdnav_inc_dirs = [include_directories('.', 'src', 'src/dvdnav', 'src/vm')]
+if cc.get_argument_syntax() == 'msvc'
+ # extra POSIX headers not found in the Windows SDK
+ dvdnav_inc_dirs += include_directories('msvc/include')
+endif
+
+# The version number for the shared library
+dvdnav_soname_version = '4.4.0'
+
+dvdnav_version = meson.project_version()
+dvdnav_version_split = dvdnav_version.split('.')
+cdata.set_quoted('VERSION', dvdnav_version)
+
+#
+# OS/Compiler checks and defines
+#
+
+# Arguments in test_args will be used even on feature tests
+test_args = ['-D_DEFAULT_SOURCE']
+
+if cc.get_argument_syntax() == 'msvc'
+ test_args += ['-D_CRT_NONSTDC_NO_WARNINGS', '-D_CRT_SECURE_NO_WARNINGS']
+elif host_machine.system() == 'freebsd'
+ test_args += '-DTHREAD_SAFE'
+elif host_machine.system() == 'sunos'
+ test_args += '-D__EXTENSIONS__'
+endif
+
+optional_arguments = []
+optional_link_arguments = []
+
+add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
+
+# Header checks
+
+check_headers = [
+ 'dlfcn.h',
+ 'inttypes.h',
+ 'memory.h',
+ 'stdint.h',
+ 'stdlib.h',
+ 'strings.h',
+ 'string.h',
+ 'sys/stat.h',
+ 'sys/types.h',
+ 'unistd.h',
+]
+
+foreach h : check_headers
+ if cc.has_header(h)
+ cdata.set('HAVE_' + h.underscorify().to_upper(), 1)
+ endif
+endforeach
+
+if host_machine.endian() == 'big'
+ cdata.set('WORDS_BIGENDIAN', 1)
+endif
+
+if cc.has_function('gettimeofday', prefix: '#include <sys/time.h>')
+ cdata.set('HAVE_GETTIMEOFDAY', 1)
+endif
+
+# External dependencies and libraries
+
+dvdread_dependency = dependency('dvdread', version: '>=6.0.0', fallback: 'libdvdread')
+
+if host_machine.system() in ['windows', 'cygwin', 'android']
+ thread_dependency = []
+else
+ thread_dependency = dependency('threads')
+endif
+
+# Compiler flag tests
+
+# Compiler flags that should be set
+# But when the compiler does not supports them
+# it is not an error and silently tolerated
+if cc.get_argument_syntax() != 'msvc'
+ optional_arguments += [
+ '-mno-ms-bitfields',
+ '-Wsign-compare',
+ ]
+endif
+
+add_project_arguments(cc.get_supported_arguments(optional_arguments), language: 'c')
+add_project_link_arguments(cc.get_supported_link_arguments(optional_link_arguments), language: 'c')
+add_project_arguments(test_args, language: 'c')
+
+# Generate config.h
+configure_file(output: 'config.h', configuration: cdata)
+
+install_data(['AUTHORS', 'ChangeLog', 'COPYING', 'README.md', 'TODO'],
+ install_dir: get_option('datadir') / 'doc/libdvdnav',
+ install_tag: 'doc')
+
+# Include subdir meson.build files
+# The order is important!
+
+subdir('src/dvdnav')
+
+subdir('src')
+
+subdir('examples')
+
+subdir('doc')
=====================================
meson_options.txt
=====================================
@@ -0,0 +1,14 @@
+# Copyright (C) 2025 Rob Hall
+# SPDX-License-Identifier: MIT
+
+# General options
+
+option('enable_docs',
+ type: 'boolean',
+ value: false,
+ description: 'Build (with Doxygen) and install API documentation')
+
+option('enable_examples',
+ type: 'boolean',
+ value: false,
+ description: 'Build libdvdnav examples')
=====================================
package/crossfiles/aarch64-w64-mingw32.meson
=====================================
@@ -0,0 +1,16 @@
+[binaries]
+c = 'aarch64-w64-mingw32-clang'
+cpp = 'aarch64-w64-mingw32-clang++'
+ar = 'aarch64-w64-mingw32-ar'
+strip = 'aarch64-w64-mingw32-strip'
+windres = 'aarch64-w64-mingw32-windres'
+pkgconfig = 'pkg-config'
+
+[built-in options]
+c_link_args = ['-static-libgcc']
+
+[host_machine]
+system = 'windows'
+cpu_family = 'aarch64'
+cpu = 'aarch64'
+endian = 'little'
=====================================
package/crossfiles/arm-linux-gnueabihf.meson
=====================================
@@ -0,0 +1,15 @@
+[binaries]
+c = 'arm-linux-gnueabihf-gcc'
+cpp = 'arm-linux-gnueabihf-gcc++'
+ar = 'arm-linux-gnueabihf-ar'
+strip = 'arm-linux-gnueabihf-strip'
+pkg-config = 'pkg-config'
+
+[built-in options]
+c_link_args = ['-static-libgcc']
+
+[host_machine]
+system = 'linux'
+cpu_family = 'arm'
+cpu = 'arm'
+endian = 'little'
=====================================
package/crossfiles/armv7-w64-mingw32.meson
=====================================
@@ -0,0 +1,16 @@
+[binaries]
+c = 'armv7-w64-mingw32-clang'
+cpp = 'armv7-w64-mingw32-clang++'
+ar = 'armv7-w64-mingw32-ar'
+strip = 'armv7-w64-mingw32-strip'
+windres = 'armv7-w64-mingw32-windres'
+pkgconfig = 'pkg-config'
+
+[built-in options]
+c_link_args = ['-static-libgcc']
+
+[host_machine]
+system = 'windows'
+cpu_family = 'arm'
+cpu = 'armv7'
+endian = 'little'
=====================================
package/crossfiles/i686-w64-mingw32.meson
=====================================
@@ -0,0 +1,17 @@
+[binaries]
+c = 'i686-w64-mingw32-gcc'
+cpp = 'i686-w64-mingw32-g++'
+ar = 'i686-w64-mingw32-ar'
+strip = 'i686-w64-mingw32-strip'
+windres = 'i686-w64-mingw32-windres'
+pkgconfig = 'i686-w64-mingw32-pkg-config'
+exe_wrapper = 'wine'
+
+[built-in options]
+c_link_args = ['-static-libgcc']
+
+[host_machine]
+system = 'windows'
+cpu_family = 'x86'
+cpu = 'i686'
+endian = 'little'
=====================================
package/crossfiles/x86_64-w64-mingw32.meson
=====================================
@@ -0,0 +1,17 @@
+[binaries]
+c = 'x86_64-w64-mingw32-gcc'
+cpp = 'x86_64-w64-mingw32-g++'
+ar = 'x86_64-w64-mingw32-ar'
+strip = 'x86_64-w64-mingw32-strip'
+windres = 'x86_64-w64-mingw32-windres'
+pkgconfig = 'x86_64-w64-mingw32-pkg-config'
+exe_wrapper = 'wine'
+
+[built-in options]
+c_link_args = ['-static-libgcc']
+
+[host_machine]
+system = 'windows'
+cpu_family = 'x86_64'
+cpu = 'x86_64'
+endian = 'little'
=====================================
src/dvdnav/dvdnav.h
=====================================
@@ -40,7 +40,7 @@ extern "C" {
# define DVDNAV_API
#endif
-#include "version.h"
+#include <dvdnav/version.h>
#include <dvdnav/dvd_types.h>
#include <dvdread/dvd_reader.h>
#include <dvdread/nav_types.h>
=====================================
src/dvdnav/meson.build
=====================================
@@ -0,0 +1,18 @@
+# Copyright (C) 2025 Rob Hall
+# SPDX-License-Identifier: MIT
+
+dvdnav_api_headers = files(
+ 'dvdnav.h',
+ 'dvdnav_events.h',
+ 'dvd_types.h',
+)
+
+dvdnav_api_headers += configure_file(input: 'version.h.in',
+ output: 'version.h',
+ configuration: {'DVDNAV_MAJOR': dvdnav_version_split[0],
+ 'DVDNAV_MINOR': dvdnav_version_split[1],
+ 'DVDNAV_SUB': dvdnav_version_split[2]})
+
+# Install headers
+install_headers(dvdnav_api_headers,
+ subdir: 'dvdnav')
=====================================
src/meson.build
=====================================
@@ -0,0 +1,56 @@
+# Copyright (C) 2025 Rob Hall
+# SPDX-License-Identifier: MIT
+
+# libdvdnav source files
+dvdnav_src = files(
+ 'dvdnav.c',
+ 'highlight.c',
+ 'logger.c',
+ 'navigation.c',
+ 'read_cache.c',
+ 'searching.c',
+ 'settings.c',
+ 'vm/decoder.c',
+ 'vm/getset.c',
+ 'vm/play.c',
+ 'vm/vm.c',
+ 'vm/vmcmd.c',
+ 'vm/vmget.c',
+)
+
+# Library definitions
+#
+
+if host_machine.system() == 'windows' and get_option('default_library') == 'static'
+ api_export_flags = []
+else
+ api_export_flags = '-DDVDNAV_API_EXPORT'
+endif
+
+# The final libdvdnav library
+libdvdnav = library('dvdnav', dvdnav_src,
+ include_directories: dvdnav_inc_dirs,
+ dependencies: [
+ dvdread_dependency,
+ thread_dependency,
+ ],
+ c_args: [api_export_flags],
+ gnu_symbol_visibility: 'hidden',
+ version: dvdnav_soname_version,
+ install: true,
+)
+
+# Make the library usable as a dependency in this and other projects
+dvdnav_dep = declare_dependency(link_with: libdvdnav,
+ include_directories: include_directories('.'))
+
+meson.override_dependency('dvdnav', dvdnav_dep)
+
+# Generate pkg-config .pc file
+pkg_mod = import('pkgconfig')
+pkg_mod.generate(libraries: libdvdnav,
+ version: meson.project_version(),
+ filebase: 'dvdnav',
+ name: 'libdvdnav',
+ description: 'DVD Navigation library',
+)
View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/compare/1ebcbb3a2d82c7ab887d559ea941ba6ba3eb3c3a...a13cb8221689500543fd70450b754d674f108bd8
--
View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/compare/1ebcbb3a2d82c7ab887d559ea941ba6ba3eb3c3a...a13cb8221689500543fd70450b754d674f108bd8
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the libdvdnav-devel
mailing list