Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gstreamer/cerbero
  • slomo/cerbero
  • ystreet/cerbero
  • ndufresne/cerbero
  • jvanegmond/cerbero
  • nirbheek/cerbero
  • H1Gdev/cerbero
  • tpm/cerbero
  • udo_of_aachen/cerbero
  • leemgs/cerbero
  • ylatuya/cerbero
  • ocrete/cerbero
  • bshankstd/cerbero
  • bilboed/cerbero
  • ianblenke/cerbero
  • nacho.garglez/cerbero
  • a-morales/cerbero
  • codinho/cerbero
  • dabrain34/cerbero
  • seungha.yang/cerbero
  • jh-hsd/cerbero
  • neodesys/cerbero
  • turran/cerbero
  • bsu/cerbero
  • pamarcos/cerbero
  • DengkeDu/cerbero
  • alatiera/cerbero
  • jcelaya/cerbero
  • Xima/cerbero
  • ray.tiley/cerbero
  • raytiley/cerbero
  • andrewes/cerbero
  • xiaolinz/cerbero
  • marek.olejnik315/cerbero
  • molejnik-fluendo/cerbero
  • joykim/cerbero
  • thaytan/cerbero
  • ding/cerbero
  • bmx666/cerbero
  • drakkan/cerbero
  • rgonzalez/cerbero
  • mjimeno/cerbero
  • leio/cerbero
  • aleb/cerbero
  • cgriffin/cerbero
  • fanchao/cerbero
  • rompelstompel/cerbero
  • tic/cerbero
  • dememax/cerbero
  • thiblahute/cerbero
  • joshuadoe/cerbero
  • aperezdc/cerbero
  • zhiyuan.sraf/cerbero
  • xclaesse/cerbero
  • avantgardnerio/cerbero
  • jensgoe/cerbero
  • gstreamer-release-bot/cerbero
  • JonLatane/cerbero
  • arun/cerbero
  • philn/cerbero
  • geneukum/cerbero
  • jorge.olmos/cerbero
  • mortimergoro/cerbero
  • 0ct0cat/cerbero
  • B3QL/cerbero
  • altanai/cerbero
  • leeys888/cerbero
  • kunal-mahatha/cerbero
  • kevmo314/cerbero
  • nibbleshift/cerbero
  • JonasVautherin/cerbero
  • fark/cerbero
  • yh1224/cerbero
  • dstmath/cerbero
  • rabindra-harlalka/cerbero
  • xiemeilong.ok/cerbero
  • hilbertspace05/cerbero
  • hilbertspace05/cerberofordebianbookworm
  • yatinmaan/cerbero
  • thewildtree/cerbero
  • cfoch/cerbero
  • paul.goulpie1/cerbero
  • msolsona-fluendo/cerbero
  • dumanovskis/cerbero
  • eerimoq/cerbero
  • hectoradrianzapata4/cerbero
  • amyspark/cerbero
  • rpavlik/cerbero
  • tkanakamalla/cerbero
  • gstreamer-backport-bot/cerbero
  • ogauthier_sat/cerbero
  • SanchayanMaity/cerbero
  • gdesmott/cerbero
  • pwall/cerbero
  • lubosz/cerbero
  • korejan/cerbero
  • dpaoliello/cerbero
  • btgoodwin/cerbero
  • jawilson/cerbero
  • lyram/cerbero
  • eerii/cerbero
  • pgsancho/cerbero
  • fluendo/cerbero
  • Tjitte/cerbero
  • tomaszmi/cerbero
  • maohan4761/cerbero
  • cadubentzen/cerbero
107 results
Show changes
Commits on Source (24)
Showing
with 14353 additions and 603 deletions
......@@ -86,6 +86,8 @@ default:
rules:
# If this pipeline is triggered from gstreamer, trigger the pipeline automatically
- if: '$CI_PIPELINE_SOURCE == "pipeline"'
# If this pipeline is triggered by a schedule, trigger the pipeline automatically
- if: '$CI_PIPELINE_SOURCE == "schedule"'
# If this matches, it means the pipeline is running against either the main
# or a stable branch, so make it automatic cause they need to update artifacts,
# like the docs site or cerbero deps
......@@ -408,7 +410,7 @@ cerbero cross-android universal examples:
- "gstreamer-1.0-devel-1.*.pkg"
.cerbero macos arm64 image:
image: "registry.freedesktop.org/gstreamer/cerbero/macos-arm64/13-ventura:2023-07-27.5"
image: "registry.freedesktop.org/gstreamer/cerbero/macos-arm64/14-sonoma:2023-10-25.2"
tags:
- gst-mac-arm
......@@ -592,6 +594,13 @@ cerbero deps msvc x86_64:
ARCH: 'msvc_x86_64'
script:
- C:\msys64\msys2_shell.cmd -ucrt64 -defterm -no-start -here -use-full-path -lc "./ci/cerbero_setup.sh cerbero_deps_script"
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
# Don't run automatically for scheduled pipeline
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: 'manual'
# workaround for gitlab bug where it otherwise blocks the pipeline for manual jobs from rules
allow_failure: true
cerbero deps mingw x86_64:
extends: ['.cerbero deps', '.cerbero windows native']
......@@ -618,7 +627,20 @@ cerbero deps msvc x86_64 msi package:
- "*/sources/*/*/_builddir/CMakeFiles/CMakeError.log"
- "*/sources/*/*/_builddir/CMakeFiles/CMakeLog.log"
- "*.msi"
when: 'manual'
rules:
# Run automatically if it's a scheduled pipeline
- if: '$CI_PIPELINE_SOURCE == "schedule"'
# Otherwise require manual trigger
- if: '$CI_PIPELINE_SOURCE != "schedule"'
when: 'manual'
# workaround for gitlab bug where it otherwise blocks the pipeline for manual jobs from rules
allow_failure: true
cerbero deps msvc x86 msi package:
extends: ['cerbero deps msvc x86_64 msi package']
variables:
ARCH: 'msvc_x86'
CONFIG: 'win32.cbc'
build cerbero msvc x86_64:
extends: ['.cerbero mr', '.cerbero windows native']
......
......@@ -37,7 +37,7 @@ class RustBootstrapper(BootstrapperBase):
SERVER = 'https://static.rust-lang.org'
RUSTUP_VERSION = '1.26.0'
RUST_VERSION = '1.72.0'
RUST_VERSION = '1.73.0'
RUSTUP_URL_TPL = '{server}/rustup/archive/{version}/{triple}/rustup-init{exe_suffix}'
RUSTUP_NAME_TPL = 'rustup-init-{version}-{triple}{exe_suffix}'
CHANNEL_URL_TPL = '{server}/dist/channel-rust-{version}.toml'
......@@ -46,7 +46,7 @@ class RustBootstrapper(BootstrapperBase):
TOMLI_URL = 'https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3/tomli-2.0.1.tar.gz'
DOWNLOAD_CHECKSUMS = {
# Rust packages metadata
'channel-rust-1.72.0.toml': '43d520cf3bf12e2e31f5a5942539feff91177a40bdf0e0d15354f0854b3d4676',
'channel-rust-1.73.0.toml': 'acb3fcf9f4f19cf1e847de9926209aff9027b353a88c8ecc2ec992a91da2a7ca',
# Tomli Python module
'tomli-2.0.1.tar.gz': 'de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f',
# Rustup
......
......@@ -22,6 +22,7 @@ import glob
import copy
import shutil
import shlex
import sys
import subprocess
import asyncio
from pathlib import Path
......@@ -29,7 +30,7 @@ from itertools import chain
from cerbero.enums import Platform, Architecture, Distro, LibraryType
from cerbero.errors import FatalError, InvalidRecipeError
from cerbero.utils import shell, to_unixpath, to_winpath, add_system_libs
from cerbero.utils import shell, to_unixpath, to_winpath, add_system_libs, determine_num_of_cpus, determine_total_ram
from cerbero.utils import EnvValue, EnvValueSingle, EnvValueArg, EnvValueCmd, EnvValuePath
from cerbero.utils import messages as m
......@@ -386,7 +387,6 @@ class Build(object):
return self.config.num_of_cpus
return None
class CustomBuild(Build, ModifyEnvBase):
def __init__(self):
......@@ -1215,15 +1215,36 @@ class Cargo(Build, ModifyEnvBase):
self.config.target_platform, self.using_msvc())
except FatalError as e:
raise InvalidRecipeError(self.name, e.msg)
self.cargo_args = [
'--verbose', '--offline',
'--target', self.target_triple,
'--target-dir', self.cargo_dir,
]
jobs = self.num_of_rustc_jobs()
if jobs is not None:
self.cargo_args += [f'-j{jobs}']
# https://github.com/lu-zero/cargo-c/issues/278
if self.config.target_platform in (Platform.ANDROID, Platform.IOS):
self.library_type = LibraryType.STATIC
def num_of_rustc_jobs(self):
'''
Restricts parallelism with <= 4 threads or with <= 8 GB RAM.
'''
ncpu = super().num_of_cpus()
num_of_jobs = determine_num_of_cpus()
has_enough_ram = determine_total_ram() > (8 * 1 << 30) # 8 GB
if num_of_jobs <= 4 or not has_enough_ram:
return 1
elif ncpu:
return ncpu
return None
def get_cargo_features_args(self):
if not self.cargo_features:
return []
......
......@@ -136,6 +136,7 @@ class DistroVersion:
WINDOWS_8 = 'windows_08'
WINDOWS_8_1 = 'windows_08_1'
WINDOWS_10 = 'windows_10'
WINDOWS_11 = 'windows_11'
OS_X_MAVERICKS = 'osx_mavericks'
OS_X_MOUNTAIN_LION = 'osx_mountain_lion'
OS_X_YOSEMITE = 'osx_yosemite'
......
......@@ -184,7 +184,7 @@ class ZipFile(zipfile_ZipFile):
# destination.
try:
os.unlink(targetpath)
except FileNotFoundError:
except (FileNotFoundError, IsADirectoryError):
pass
if member.is_dir():
......
......@@ -16,7 +16,9 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
import functools
import os
import subprocess
import sys
import shlex
import shutil
......@@ -76,8 +78,8 @@ def user_is_root():
''' Check if the user running the process is root '''
return hasattr(os, 'getuid') and os.getuid() == 0
def determine_num_of_cpus():
@functools.lru_cache()
def determine_num_of_cpus() -> int:
''' Number of virtual or logical CPUs on this system '''
# Python 2.6+
......@@ -87,6 +89,26 @@ def determine_num_of_cpus():
except (ImportError, NotImplementedError):
return 1
@functools.lru_cache()
def determine_total_ram() -> int:
''' Total amount of RAM in this system, in bytes '''
platform = system_info()[0]
if platform == Platform.DARWIN:
ram_size_query = subprocess.run([shutil.which('sysctl'), '-n', 'hw.memsize'], stdout=subprocess.PIPE, text=True)
if ram_size_query.returncode() == 0:
return int(ram_size_query.stdout.strip())
elif platform == Platform.WINDOWS:
ram_size_query = subprocess.run([shutil.which('wmic'), 'computersystem', 'get', 'totalphysicalmemory'], stdout=subprocess.PIPE, text=True)
if ram_size_query.returncode() == 0:
return int(ram_size_query.stdout.strip())
elif platform == Platform.LINUX:
ram_size_query = subprocess.run([shutil.which('free'), '-b'], stdout=subprocess.PIPE, text=True)
if ram_size_query.returncode() == 0:
return int(re.split(r'\s+', ram_size_query.stdout.splitlines()[1]))
return 4 << 30 # Assume 4GB
def to_winpath(path):
if path.startswith('/'):
......@@ -365,7 +387,8 @@ Terminating.''', file=sys.stderr)
'8': DistroVersion.WINDOWS_8,
'post2012Server': DistroVersion.WINDOWS_8_1,
'8.1': DistroVersion.WINDOWS_8_1,
'10': DistroVersion.WINDOWS_10}
'10': DistroVersion.WINDOWS_10,
'11': DistroVersion.WINDOWS_11}
if win32_ver in dmap:
distro_version = dmap[win32_ver]
else:
......
......@@ -145,8 +145,11 @@ cerbero_deps_script() {
# doing something silly like [[ -n ${CERBERO_...} ]] because it will get
# printed in the CI logs due to set -x
if env | grep -q -e CERBERO_PRIVATE_SSH_KEY; then
time $CERBERO $CERBERO_ARGS gen-cache --branch "${GST_UPSTREAM_BRANCH}"
time $CERBERO $CERBERO_ARGS upload-cache --branch "${GST_UPSTREAM_BRANCH}"
# Don't generate and upload caches for scheduled pipelines on main branch
if [[ "x${CI_PIPELINE_SOURCE}" != "xschedule" ]]; then
time $CERBERO $CERBERO_ARGS gen-cache --branch "${GST_UPSTREAM_BRANCH}"
time $CERBERO $CERBERO_ARGS upload-cache --branch "${GST_UPSTREAM_BRANCH}"
fi
fi
cerbero_package_and_check
......
......@@ -133,10 +133,7 @@ else:
env['CFLAGS'] = env['CPPFLAGS']
env['LDFLAGS'] = env['CPPFLAGS'] + ' -L{} '.format(lib_dir)
if ios_platform == 'iPhoneOS':
env['LDFLAGS'] += '-Wl,-iphoneos_version_min,{0} '.format(ios_min_version)
env['CCASFLAGS'] = '-miphoneos-version-min={} '.format(ios_min_version)
else:
env['LDFLAGS'] += '-Wl,-ios_simulator_version_min,{0} '.format(ios_min_version)
env['CFLAGS'] += extra_cflags
env['LDFLAGS'] += extra_ldflags
env['OBJCFLAGS'] = env['CFLAGS'] + extra_objcflags
......
......@@ -2,22 +2,17 @@
class Recipe(recipe.Recipe):
name = 'cargo-c'
version = '0.9.24'
version = '0.9.27'
stype = SourceType.TARBALL
btype = BuildType.CARGO
url = 'https://github.com/lu-zero/cargo-c/archive/refs/tags/v0.9.24.tar.gz'
tarball_checksum = '32f2f5c802c01c51cf93471fcf876d0cc68edbc31d22005b9f07e4549d5b98b1'
url = 'https://github.com/lu-zero/cargo-c/archive/refs/tags/v0.9.27.tar.gz'
tarball_checksum = 'caca521e893ae7cc63a9e2c5e58f2151b7b74754a4fd884c8eb5939b967ae0d5'
tarball_dirname = '%(name)s-%(version)s'
# Get this from the release page on github
cargo_lock = f'{name}/{version}-Cargo.lock'
# Need system openssl on Linux
use_system_libs = True
patches = [
# https://github.com/lu-zero/cargo-c/pull/277
name + '/0001-Fix-linking-with-Android-NDK-linker.patch',
]
deps = ['zlib', 'pkg-config']
# Need openssl on macOS. On Windows, a prebuilt openssl crate is downloaded.
platform_deps = {
......
From 18348bd65ce67bcd6f85e309f126792a96732943 Mon Sep 17 00:00:00 2001
From: Nirbheek Chauhan <nirbheek@centricular.com>
Date: Thu, 1 Sep 2022 21:33:29 +0530
Subject: [PATCH] Fix linking with Android NDK linker
Android ld.gold cannot handle -Wl, and it's incorrect anyway since all
the other linker arguments passed by cargo do not have a -Wl prefix.
---
src/target.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/target.rs b/src/target.rs
index 0cc2018..4c9d369 100644
--- a/src/target.rs
+++ b/src/target.rs
@@ -70,7 +70,7 @@ impl Target {
let env = &self.env;
if os == "android" {
- lines.push(format!("-Wl,-soname,lib{lib_name}.so"));
+ lines.push(format!("-soname,lib{lib_name}.so"));
} else if os == "linux"
|| os == "freebsd"
|| os == "dragonfly"
--
2.39.1
......@@ -6,7 +6,7 @@ from pathlib import PurePath, Path
class Recipe(recipe.Recipe):
name = 'meson'
version = '1.1.1'
version = '1.2.3'
licenses = [License.Apachev2]
btype = BuildType.CUSTOM
......@@ -18,16 +18,11 @@ class Recipe(recipe.Recipe):
else:
stype = SourceType.TARBALL
url = 'https://github.com/mesonbuild/meson/releases/download/%(version)s/meson-%(version)s.tar.gz'
tarball_checksum = 'd04b541f97ca439fb82fab7d0d480988be4bd4e62563a5ca35fadb5400727b1c'
tarball_checksum = '4533a43c34548edd1f63a276a42690fce15bde9409bcf20c4b8fa3d7e4d7cac1'
files_bin = ['bin/meson']
files_python = []
patches = [
# https://github.com/mesonbuild/meson/pull/11101
'meson/0001-dependencies-qt-add-support-for-Qt-frameworks-refere.patch',
]
async def install(self):
# setup.py barfs if using posix paths on Windows
if self.config.platform == Platform.WINDOWS:
......
From dcbd46813b57289e5d115b2011bf1399312c7e8c Mon Sep 17 00:00:00 2001
From: Matthew Waters <matthew@centricular.com>
Date: Tue, 22 Nov 2022 13:08:06 +1100
Subject: [PATCH] dependencies/qt: add support for Qt frameworks referencing
includes in include directory
e.g. QtQml with Qt 6.4.0 referencing QtQmlIntegration is one such example
---
mesonbuild/dependencies/qt.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/mesonbuild/dependencies/qt.py b/mesonbuild/dependencies/qt.py
index e1e9e07..09731e5 100644
--- a/mesonbuild/dependencies/qt.py
+++ b/mesonbuild/dependencies/qt.py
@@ -103,9 +103,10 @@ def _get_modules_lib_suffix(version: str, info: 'MachineInfo', is_debug: bool) -
class QtExtraFrameworkDependency(ExtraFrameworkDependency):
- def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any], language: T.Optional[str] = None):
+ def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any], qvars: T.Dict[str, str], language: T.Optional[str] = None):
super().__init__(name, env, kwargs, language=language)
self.mod_name = name[2:]
+ self.qt_extra_include_directory = qvars['QT_INSTALL_HEADERS']
def get_compile_args(self, with_private_headers: bool = False, qt_version: str = "0") -> T.List[str]:
if self.found():
@@ -113,6 +114,8 @@ class QtExtraFrameworkDependency(ExtraFrameworkDependency):
args = ['-I' + mod_inc_dir]
if with_private_headers:
args += ['-I' + dirname for dirname in _qt_get_private_includes(mod_inc_dir, self.mod_name, qt_version)]
+ if self.qt_extra_include_directory:
+ args += ['-I' + self.qt_extra_include_directory]
return args
return []
@@ -359,7 +362,7 @@ class QmakeQtDependency(_QtBase, ConfigToolDependency, metaclass=abc.ABCMeta):
for m in modules:
fname = 'Qt' + m
mlog.debug('Looking for qt framework ' + fname)
- fwdep = QtExtraFrameworkDependency(fname, self.env, fw_kwargs, language=self.language)
+ fwdep = QtExtraFrameworkDependency(fname, self.env, fw_kwargs, qvars, language=self.language)
if fwdep.found():
self.compile_args.append('-F' + libdir)
self.compile_args += fwdep.get_compile_args(with_private_headers=self.private_headers,
--
2.37.0 (Apple Git-136)
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
class Recipe(recipe.Recipe):
version = '3.1.8'
name = 'directxmath'
licenses = [{License.MIT: ['LICENSE']}]
stype = SourceType.TARBALL
btype = BuildType.MESON
url = 'https://github.com/microsoft/DirectXMath/archive/refs/tags/dec2022.tar.gz'
tarball_checksum = '70a18f35343ff07084d31afa7a7978b3b59160f0533424365451c72475ff480f'
tarball_name = 'dec2022.tar.gz'
tarball_dirname = 'DirectXMath-dec2022'
patches = [
# https://wrapdb.mesonbuild.com/v2/directxmath_3.1.8-1/get_patch
'directxmath/0001-Add-DirectXMath-wrap.patch',
]
From 060db52c6eaf47273317de67522f54f87bbad5b3 Mon Sep 17 00:00:00 2001
From: Seungha Yang <seungha@centricular.com>
Date: Fri, 27 Oct 2023 00:33:55 +0900
Subject: [PATCH] Add DirectXMath wrap
---
meson.build | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 meson.build
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..c7f9d46
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,29 @@
+project('directxmath', 'cpp', version: '3.1.8')
+
+incdirs = include_directories('Inc')
+
+directxmath_headers = files(
+ 'Inc/DirectXCollision.h',
+ 'Inc/DirectXCollision.inl',
+ 'Inc/DirectXColors.h',
+ 'Inc/DirectXMath.h',
+ 'Inc/DirectXMathConvert.inl',
+ 'Inc/DirectXMathMatrix.inl',
+ 'Inc/DirectXMathMisc.inl',
+ 'Inc/DirectXMathVector.inl',
+ 'Inc/DirectXPackedVector.h',
+ 'Inc/DirectXPackedVector.inl',
+)
+
+directxmath_dep = declare_dependency(
+ include_directories: incdirs
+)
+
+install_headers(directxmath_headers, subdir: 'directxmath')
+
+pkgconfig = import('pkgconfig')
+pkgconfig.generate(name: 'directxmath',
+ version: meson.project_version(),
+ subdirs: 'directxmath',
+ description: 'DirectXMath SIMD C++ math library')
+
--
2.42.0.windows.2
......@@ -9,137 +9,101 @@ class Recipe(recipe.Recipe):
url = 'https://ffmpeg.org/releases/%(name)s-%(version)s.tar.xz'
tarball_checksum = '57be87c22d9b49c112b6d24bc67d42508660e6b718b3db89c44e47e289137082'
patches = [
name + '/0001-pkgconfig-fix-generation-to-use-prefix.patch',
name + '/0001-Add-Meson-build.patch',
]
btype = BuildType.MAKEFILE
configure_tpl = './configure --prefix=%(prefix)s --libdir=%(libdir)s \
--ar="$AR" --as="$AS" --cc="$CC" --ld="$CC" --nm="$NM" --ranlib="$RANLIB" \
--strip="$STRIP" --windres="$RC" \
--enable-static --enable-pic --enable-shared \
--disable-avdevice --disable-postproc --disable-swscale \
--disable-programs --disable-ffplay --disable-ffprobe --disable-ffmpeg \
--disable-encoder=flac --disable-protocols --disable-devices \
--disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau \
--disable-filters --enable-filter=yadif --disable-doc --disable-d3d11va \
--disable-audiotoolbox --disable-videotoolbox --disable-vaapi --disable-crystalhd \
--disable-mediacodec --disable-mediafoundation --disable-nvenc --disable-mmal --disable-omx \
--disable-omx-rpi --disable-cuda --disable-cuvid --disable-libmfx \
--disable-libnpp --disable-iconv --disable-jni --disable-v4l2_m2m \
--disable-vulkan --disable-large-tests --disable-stripping \
--enable-optimizations --disable-nonfree --disable-version3 %(options)s'
btype = BuildType.MESON
meson_options = {
'avdevice': 'disabled',
'programs': 'disabled',
'flac_encoder': 'disabled',
'protocols': 'disabled',
'devices': 'disabled',
'network': 'disabled',
'hwaccels': 'disabled',
'dxva2': 'disabled',
'vdpau': 'disabled',
'filters': 'disabled',
'yadif_filter': 'enabled',
# Uncomment the following option once implemented in the port
# 'doc': 'disabled',
'd3d11va': 'disabled',
'audiotoolbox': 'disabled',
'videotoolbox': 'disabled',
'vaapi': 'disabled',
'crystalhd': 'disabled',
'mediacodec': 'disabled',
'mediafoundation' : 'disabled',
'nvenc': 'disabled',
'mmal': 'disabled',
'omx': 'disabled',
'omx_rpi': 'disabled',
'cuda': 'disabled',
'cuvid': 'disabled',
'libmfx': 'disabled',
'libnpp': 'disabled',
'libnpp': 'disabled',
'iconv': 'disabled',
'jni': 'disabled',
'v4l2_m2m': 'disabled',
'vulkan': 'disabled',
'tests': 'disabled', # To not waste time
# These two are redundant with Meson
# 'stripping': 'disabled',
# 'optimizations': 'enabled,
'nonfree': 'disabled',
'version3': 'disabled',
}
deps = ['bzip2', 'zlib']
files_libs = ['libavcodec', 'libavformat', 'libavutil', 'libswresample', 'libavfilter']
files_libs = ['libavcodec', 'libavformat', 'libavutil', 'libswresample', 'libavfilter', 'libpostproc', 'libswscale']
files_devel = []
def prepare(self):
# Arch-specific flags
if self.config.target_arch == Architecture.X86:
if self.config.target_platform == Platform.IOS:
# Simulator doesn't like shared libs
self.library_type = LibraryType.STATIC
elif self.config.target_platform == Platform.ANDROID:
# ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
# See https://github.com/FFmpeg/FFmpeg/blob/n6.0/libavutil/x86/x86inc.asm#L104-L108
self.meson_options['asm'] = 'disabled'
# Populate self.files_devel
files_devel_tpl = ['%(libdir)s/{}.la', '%(libdir)s/pkgconfig/{}.pc', 'include/{}']
# ffmpeg can only build either shared or static on Windows, not both
if self.config.target_platform == Platform.WINDOWS:
self.library_type = LibraryType.SHARED
else:
if self.library_type != LibraryType.SHARED:
files_devel_tpl += ['%(libdir)s/{}.a']
for lib in self.files_libs:
self.files_devel += [tpl.format(lib) for tpl in files_devel_tpl]
# Default AS is $CC, except iOS (set below)
if Architecture.is_arm(self.config.target_arch):
if self.config.target_platform == Platform.IOS:
gas = self.get_env('GAS')
if gas:
self.set_env('AS', gas)
self.set_env('ASFLAGS', self.get_env('CPPFLAGS'))
else:
cc = self.get_env('CC')
if cc:
self.set_env('AS', cc)
libavextraconf = ''
# Arch-specific flags
if self.config.target_platform == Platform.ANDROID:
if self.config.target_arch == Architecture.X86:
# libav internally aligns stacks, while Android doesn't
libavextraconf += " --extra-cflags='-mstackrealign'"
if self.config.target_arch in [Architecture.X86]:
# Fails to link into an android app with relocation warnings
# in the custom assembly
# https://stackoverflow.com/questions/34691970/ffmpeg-for-android-neon-build-has-text-relocations/34697703#34697703
# https://issuetracker.google.com/issues/37067983
# https://trac.ffmpeg.org/ticket/4928
libavextraconf += " --disable-asm"
elif self.config.target_platform == Platform.IOS:
# Some optimisations that were previously silently disabled
# cause warnings now. Ignore them
libavextraconf += " --extra-cflags='-Wno-ignored-optimization-argument' "
if self.config.target_arch == Architecture.X86:
# Fails to link in gst-libav due to text relocations in
# custom assembly:
# ld: illegal text-relocation to 'anon' in libavfilter.a(vf_yadif.o)
# from '_ff_yadif_filter_line_ssse3' in libavfilter.a(vf_yadif.o)
# for architecture i386
libavextraconf += ' --disable-asm '
# On windows, being a multilib toolchain, we have to always configure
# the cross-prefix
if self.config.cross_compiling() or \
self.config.target_platform == Platform.WINDOWS:
libavextraconf += ' --enable-cross-compile'
target_os = self.config.target_platform
if target_os == Platform.WINDOWS:
target_os = 'mingw32'
elif target_os == Platform.IOS:
target_os = 'darwin'
target_arch = self.config.host.split('-', 1)[0]
if target_arch == 'aarch64':
target_arch = 'arm64'
libavextraconf += ' --target-os=' + target_os
libavextraconf += ' --arch=' + target_arch
libavextraconf += ' --cross-prefix={} '\
.format(self.config.tools_prefix or self.config.host)
self.configure_options += libavextraconf
# On Windows, make fails if V=1 is passed with:
# `couldn't commit memory for cygwin heap, Win32 error 0`
if self.config.platform == Platform.WINDOWS:
self.make.remove('V=1')
async def configure(self):
await super(recipe.Recipe, self).configure()
libav_path = self.build_dir
if self.config.target_platform in [Platform.DARWIN, Platform.IOS]:
if self.config.target_arch == Architecture.X86:
replacements = {'HAVE_EBX_AVAILABLE=yes': 'HAVE_EBX_AVAILABLE=no',
'HAVE_EBX_AVAILABLE 1': 'HAVE_EBX_AVAILABLE 0',}
shell.replace(os.path.join(libav_path, 'ffbuild', 'config.mak'), replacements)
shell.replace(os.path.join(libav_path, 'config.h'), replacements)
# log2 and log2f are not provided by bionic, but they are not checked
# properly
elif self.config.target_platform == Platform.ANDROID:
replacements = {'HAVE_LOG2 1': 'HAVE_LOG2 0',
'HAVE_LOG2F 1': 'HAVE_LOG2F 0',}
shell.replace(os.path.join(libav_path, 'config.h'), replacements)
v = DistroVersion.get_android_api_version(self.config.target_distro_version)
if self.config.target_arch in [Architecture.ARM, Architecture.ARMv7, Architecture.X86] and v < 21:
replacements = {'-D_FILE_OFFSET_BITS=64': '',}
shell.replace(os.path.join(libav_path, 'ffbuild', 'config.mak'), replacements)
def post_install(self):
LibtoolLibrary('avutil', None, None, None,
self.config.libdir, self.config.target_platform).save()
LibtoolLibrary('swresample', None, None, None,
self.config.libdir, self.config.target_platform,
deps=['avutil']).save()
# Meson does not generate la files
LibtoolLibrary('avcodec', None, None, None,
self.config.libdir, self.config.target_platform,
deps=['swresample', 'avutil', 'z']).save()
deps=['swresample', 'avutil', 'z'],
static_only=self.library_type == LibraryType.STATIC).save()
LibtoolLibrary('avfilter', None, None, None,
self.config.libdir, self.config.target_platform,
deps=['avformat', 'avcodec', 'swresample', 'avutil'],
static_only=self.library_type == LibraryType.STATIC).save()
LibtoolLibrary('avformat', None, None, None,
self.config.libdir, self.config.target_platform,
deps=['avcodec', 'swresample', 'avutil', 'bz2', 'z']).save()
LibtoolLibrary('avfilter', None, None, None,
deps=['avcodec', 'swresample', 'avutil', 'bz2', 'z'],
static_only=self.library_type == LibraryType.STATIC).save()
LibtoolLibrary('avutil', None, None, None,
self.config.libdir, self.config.target_platform,
static_only=self.library_type == LibraryType.STATIC).save()
LibtoolLibrary('postproc', None, None, None,
self.config.libdir, self.config.target_platform,
static_only=self.library_type == LibraryType.STATIC).save()
LibtoolLibrary('swresample', None, None, None,
self.config.libdir, self.config.target_platform,
deps=['avutil'],
static_only=self.library_type == LibraryType.STATIC).save()
LibtoolLibrary('swscale', None, None, None,
self.config.libdir, self.config.target_platform,
deps=['avformat', 'avcodec', 'swresample', 'avutil']).save()
deps=['avutil'],
static_only=self.library_type == LibraryType.STATIC).save()
super().post_install()
This diff is collapsed.
From 8f5d2c0283c4cbc430ac30a6efef999c33bdb2c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= <scerveau@igalia.com>
Date: Fri, 4 Nov 2022 12:20:25 +0100
Subject: [PATCH] pkgconfig: fix generation to use prefix
---
ffbuild/pkgconfig_generate.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ffbuild/pkgconfig_generate.sh b/ffbuild/pkgconfig_generate.sh
index e5de671..679413e 100755
--- a/ffbuild/pkgconfig_generate.sh
+++ b/ffbuild/pkgconfig_generate.sh
@@ -29,8 +29,8 @@ version=$(grep ${name}_VERSION= $name/${name}.version | cut -d= -f2)
cat <<EOF > $name/$fullname.pc
prefix=$prefix
exec_prefix=\${prefix}
-libdir=$libdir
-includedir=$incdir
+libdir=\${prefix}/lib
+includedir=\${prefix}/include
Name: $fullname
Description: $comment
--
2.34.1
......@@ -47,6 +47,8 @@ class Recipe(recipe.Recipe):
'glib/0001-gio-fix-duplicate-g_trace_-symbols-in-static-libs-wi.patch',
# From post-2.74.4 glib upstream (remove when bumping version)
'glib/0001-gthread-posix-need-to-include-errno.h.patch',
# Upstreamed since 2.75 (remove when bumping version)
'glib/0001-giomodule-Automatically-detect-modules-on-macOS.patch',
]
files_libs = [
......
From fdfadfc27604b58886d7a33cf5f78bb0617733e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Tue, 31 Mar 2020 23:15:23 +0300
Subject: [PATCH] Add missing 'extern' to the dllexport version of
GLIB_VAR/GOBJECT_VAR
The __declspec(dllexport) attribute in itself doesn't imply
'extern' - thus any intended variable declaration with
GLIB_VAR/GOBJECT_VAR would actually be a variable definition. With
C compilers defaulting to -fcommon, this isn't an issue, but
upcoming compilers (GCC 10 and Clang 11) will default to -fno-common,
ending up with duplicate definitions of these variables.
---
glib/gtypes.h | 2 +-
gobject/gparamspecs.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/glib/gtypes.h b/glib/gtypes.h
index df65836a0..23c5a1295 100644
--- a/glib/gtypes.h
+++ b/glib/gtypes.h
@@ -565,7 +565,7 @@ G_END_DECLS
# else /* !GLIB_STATIC_COMPILATION */
# ifdef GLIB_COMPILATION
# ifdef DLL_EXPORT
-# define GLIB_VAR __declspec(dllexport)
+# define GLIB_VAR extern __declspec(dllexport)
# else /* !DLL_EXPORT */
# define GLIB_VAR extern
# endif /* !DLL_EXPORT */
diff --git a/gobject/gparamspecs.h b/gobject/gparamspecs.h
index 0309f9bb3..d0e4d5953 100644
--- a/gobject/gparamspecs.h
+++ b/gobject/gparamspecs.h
@@ -1150,7 +1150,7 @@ GParamSpec* g_param_spec_variant (const gchar *name,
# else /* !GOBJECT_STATIC_COMPILATION */
# ifdef GOBJECT_COMPILATION
# ifdef DLL_EXPORT
-# define GOBJECT_VAR __declspec(dllexport)
+# define GOBJECT_VAR extern __declspec(dllexport)
# else /* !DLL_EXPORT */
# define GOBJECT_VAR extern
# endif /* !DLL_EXPORT */
--
2.25.1