Skip to content

Commit 127f7ba

Browse files
authored
Merge pull request #28 from blinemedical/1.24-lldc-cerbero-action-patches
[VIDEO-2852] Re-Deux (re-submit requested)
2 parents fc83fdb + 5528f88 commit 127f7ba

12 files changed

+1603
-116
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ minimum base to bootstrap on top of.
2121

2222
### Linux Setup
2323

24-
On Linux, you will only need a distribution with python >= 3.7. Cerbero will
24+
On Linux, you will only need a distribution with python >= 3.10. Cerbero will
2525
use your package manager to install all other required packages during
2626
[bootstrap](#Bootstrap).
2727

@@ -30,7 +30,7 @@ use your package manager to install all other required packages during
3030
On macOS you will need to have install the following software:
3131

3232
* XCode
33-
* Python 3.7+ https://www.python.org/downloads/
33+
* Python 3.10+ https://www.python.org/downloads/
3434

3535
Cerbero will build all other required packages during [bootstrap](#Bootstrap).
3636

cerbero-uninstalled

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ import shlex
107107
108108
os.environ['CERBERO_UNINSTALLED'] = '1'
109109
110-
if not sys.version_info >= (3, 7, 0):
111-
print('We require Python 3.7 or newer, but you have {}'.format(sys.version), file=sys.stderr)
110+
if not sys.version_info >= (3, 10, 0):
111+
print('We require Python 3.10 or newer, but you have {}'.format(sys.version), file=sys.stderr)
112112
sys.exit(1)
113113
114114
# __file__ is not set when we're called with -c

cerbero/bootstrap/build_tools.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ def setup_venv(self):
119119
if os.path.isfile(tof):
120120
os.remove(tof)
121121
shutil.move(os.path.join(scriptsdir, f), tof)
122-
os.rmdir(scriptsdir)
122+
if os.path.exists(scriptsdir):
123+
os.rmdir(scriptsdir)
123124
python = os.path.join(self.config.build_tools_prefix, 'bin', 'python')
124125
shell.new_call([python, '-m', 'pip', 'install', 'setuptools', 'packaging'])
125126

data/ndk-build/gstreamer-1.0.mk

+31
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,37 @@ ifeq ($(GSTREAMER_INCLUDE_CA_CERTIFICATES),yes)
8383
GSTREAMER_DEPS += gio-2.0
8484
endif
8585

86+
NEEDS_NOTEXT_FIX := no
87+
NEEDS_BSYMBOLIC_FIX := no
88+
ifeq ($(TARGET_ARCH_ABI),armeabi)
89+
NEEDS_NOTEXT_FIX := yes
90+
NEEDS_BSYMBOLIC_FIX := yes
91+
else ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
92+
NEEDS_NOTEXT_FIX := yes
93+
NEEDS_BSYMBOLIC_FIX := yes
94+
else ifeq ($(TARGET_ARCH_ABI),x86)
95+
NEEDS_NOTEXT_FIX := yes
96+
NEEDS_BSYMBOLIC_FIX := yes
97+
else ifeq ($(TARGET_ARCH_ABI),x86_64)
98+
NEEDS_BSYMBOLIC_FIX := yes
99+
endif
100+
101+
# Text relocations are required for all 32-bit objects. We
102+
# must disable the warning to allow linking with lld. Unlike gold, ld which
103+
# will silently allow text relocations, lld support must be explicit.
104+
#
105+
# See https://crbug.com/911658#c19 for more information. See also
106+
# https://trac.ffmpeg.org/ticket/7878
107+
ifeq ($(NEEDS_NOTEXT_FIX),yes)
108+
GSTREAMER_LD := $(GSTREAMER_LD) -Wl,-z,notext
109+
endif
110+
111+
# resolve textrels in the x86 asm
112+
ifeq ($(NEEDS_BSYMBOLIC_FIX),yes)
113+
GSTREAMER_LD := $(GSTREAMER_LD) -Wl,-Bsymbolic
114+
endif
115+
116+
86117
################################
87118
# NDK Build Prebuilt library #
88119
################################

recipes/gst-plugins-bad-1.0.recipe

+5
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ class Recipe(custom.GStreamer):
8383
'win32ipc': 'disabled',
8484
'wildmidi': 'disabled',
8585
}
86+
87+
patches = [
88+
'gst-plugins-bad/0001-d3d12-Fix-shaders-failing-to-compile-with-newer-dxc-.patch',
89+
]
90+
8691
deps = ['gstreamer-1.0', 'gst-plugins-base-1.0', 'bzip2', 'libass',
8792
'zlib', 'openh264', 'opus', 'librtmp', 'libxml2',
8893
'libsrtp', 'libdca', 'libdvdnav', 'libnice',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From 41504330a05792a0e3e56d86bac99b97775aac7d Mon Sep 17 00:00:00 2001
2+
From: Monty C <montyc1999@gmail.com>
3+
Date: Thu, 9 Jan 2025 16:13:44 -0500
4+
Subject: [PATCH] d3d12: Fix shaders failing to compile with newer dxc versions
5+
6+
Newer dxc versions enable HLSL 2021 by default, which disallows implicit casting of structs.
7+
8+
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8274>
9+
---
10+
sys/d3d12/hlsl/VSMain_color.hlsl | 2 +-
11+
sys/d3d12/hlsl/VSMain_coord.hlsl | 2 +-
12+
sys/d3d12/hlsl/VSMain_pos.hlsl | 2 +-
13+
3 files changed, 3 insertions(+), 3 deletions(-)
14+
15+
diff --git a/sys/d3d12/hlsl/VSMain_color.hlsl b/sys/d3d12/hlsl/VSMain_color.hlsl
16+
index c9e2f631ee..d245d7348f 100644
17+
--- a/sys/d3d12/hlsl/VSMain_color.hlsl
18+
+++ b/sys/d3d12/hlsl/VSMain_color.hlsl
19+
@@ -31,5 +31,5 @@ struct VS_OUTPUT
20+
21+
VS_OUTPUT VSMain_color (VS_INPUT input)
22+
{
23+
- return input;
24+
+ return VS_OUTPUT(input);
25+
}
26+
diff --git a/sys/d3d12/hlsl/VSMain_coord.hlsl b/sys/d3d12/hlsl/VSMain_coord.hlsl
27+
index 06d41d6e18..7fa301e112 100644
28+
--- a/sys/d3d12/hlsl/VSMain_coord.hlsl
29+
+++ b/sys/d3d12/hlsl/VSMain_coord.hlsl
30+
@@ -31,5 +31,5 @@ struct VS_OUTPUT
31+
32+
VS_OUTPUT VSMain_coord (VS_INPUT input)
33+
{
34+
- return input;
35+
+ return VS_OUTPUT(input);
36+
}
37+
diff --git a/sys/d3d12/hlsl/VSMain_pos.hlsl b/sys/d3d12/hlsl/VSMain_pos.hlsl
38+
index df069fd5de..a910d99235 100644
39+
--- a/sys/d3d12/hlsl/VSMain_pos.hlsl
40+
+++ b/sys/d3d12/hlsl/VSMain_pos.hlsl
41+
@@ -29,5 +29,5 @@ struct VS_OUTPUT
42+
43+
VS_OUTPUT VSMain_pos (VS_INPUT input)
44+
{
45+
- return input;
46+
+ return VS_OUTPUT(input);
47+
}
48+
--
49+
2.48.1.windows.1
50+

recipes/wavpack.recipe

+2-11
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ from cerbero.tools.libtool import LibtoolLibrary
44

55
class Recipe(recipe.Recipe):
66
name = 'wavpack'
7-
version = '5.4.0'
7+
version = '5.7.0'
88
stype = SourceType.TARBALL
99
url = 'https://github.com/dbry/WavPack/archive/%(version)s.tar.gz'
1010
tarball_dirname = 'WavPack-%(version)s'
11-
tarball_checksum = 'abbe5ca3fc918fdd64ef216200a5c896243ea803a059a0662cd362d0fa827cd2'
11+
tarball_checksum = 'c5742ba1054d36ff3d22f0101a9be066f55f6becb9b2a7352c79fa362f2d3d76'
1212
licenses = [{License.BSD_like: ['COPYING']}]
1313

1414
btype = BuildType.CMAKE
@@ -61,15 +61,6 @@ class Recipe(recipe.Recipe):
6161
shell.replace(os.path.join(self.config_src_dir, 'wavpack.pc.in'),
6262
{'-lwavpack': '-lwavpack @LIBM@'})
6363

64-
async def install(self):
65-
await super().install()
66-
# CMake build system installs include/wavpack.h but we want
67-
# include/wavpack/wavpack.h
68-
incdir = Path(self.config.prefix) / 'include'
69-
todir = incdir / 'wavpack'
70-
todir.mkdir(exist_ok=True)
71-
(incdir / 'wavpack.h').replace(todir / 'wavpack.h')
72-
7364
def post_install(self):
7465
deps = ['-lm']
7566
libtool_la = LibtoolLibrary('wavpack', None, None, None, self.config.libdir,
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
From ba720c11041f65fd34e6b814899d3fa8466e8867 Mon Sep 17 00:00:00 2001
2-
From: Nirbheek Chauhan <nirbheek@centricular.com>
3-
Date: Fri, 21 Jan 2022 15:34:21 +0530
1+
From 3d0c4f86946a84275592ba5d47a6c41b2914ed53 Mon Sep 17 00:00:00 2001
2+
From: Jeffery Wilson <jeff@jeffalwilson.com>
3+
Date: Fri, 11 Oct 2024 15:29:49 -0400
44
Subject: [PATCH] cmake: Don't name MSVC DLL 'wavpackdll.dll'
55

66
It breaks the pkgconfig file and is very unexpected overall. Probably
@@ -10,18 +10,18 @@ can't be upstreamed.
1010
1 file changed, 1 insertion(+), 1 deletion(-)
1111

1212
diff --git a/CMakeLists.txt b/CMakeLists.txt
13-
index 7cd940c..970505b 100644
13+
index c9f9e70..d2bb794 100644
1414
--- a/CMakeLists.txt
1515
+++ b/CMakeLists.txt
16-
@@ -229,7 +229,7 @@ endif()
17-
18-
if(WIN32 AND (NOT MINGW))
19-
if(BUILD_SHARED_LIBS)
20-
- set_target_properties(wavpack PROPERTIES OUTPUT_NAME wavpackdll)
21-
+ set_target_properties(wavpack PROPERTIES OUTPUT_NAME wavpack)
16+
@@ -234,7 +234,7 @@ if(WIN32)
17+
endif()
2218
else()
23-
set_target_properties(wavpack PROPERTIES OUTPUT_NAME libwavpack)
24-
endif()
19+
if(BUILD_SHARED_LIBS)
20+
- set_target_properties(wavpack PROPERTIES OUTPUT_NAME wavpackdll)
21+
+ set_target_properties(wavpack PROPERTIES OUTPUT_NAME wavpack)
22+
else()
23+
set_target_properties(wavpack PROPERTIES OUTPUT_NAME libwavpack)
24+
endif()
2525
--
26-
2.34.1.windows.1
26+
2.47.0
2727

recipes/x264.recipe

+21-50
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,27 @@ from cerbero.tools.libtool import LibtoolLibrary
33

44

55
class Recipe(recipe.Recipe):
6-
version = '20191217-2245'
6+
version = '0.164.3108+git31e19f9'
77
name = 'x264'
8-
licenses = [License.GPLv2Plus]
98
stype = SourceType.TARBALL
10-
configure_tpl = "%(config-sh)s --prefix=%(prefix)s "\
11-
"--libdir=%(libdir)s"
12-
configure_options = '--enable-shared --enable-static --enable-pic ' \
13-
'--disable-strip --disable-lavf'
14-
url = 'https://download.videolan.org/pub/x264/snapshots/x264-snapshot-%(version)s-stable.tar.bz2'
15-
tarball_dirname= 'x264-snapshot-%(version)s-stable'
16-
tarball_checksum = 'b2495c8f2930167d470994b1ce02b0f4bfb24b3317ba36ba7f112e9809264160'
9+
btype = BuildType.MESON
10+
# The snapshotting service is discontinued.
11+
# However, there's no pinned tag for each stable commit.
12+
# See https://download.videolan.org/pub/x264/snapshots/x264-snapshot-20191218-README.txt
13+
# Patch and tarball must match the below port (keeping it for reference)
14+
# remotes = {'origin': 'https://gitlab.freedesktop.org/gstreamer/meson-ports/%(name)s.git'}
15+
# commit = 'origin/164.3108-meson'
16+
# Source url = 'https://deb.debian.org/debian/pool/main/x/x264/x264_%(version)s.orig.tar.gz'
17+
url = 'https://gstreamer.freedesktop.org/src/mirror/%(name)s_%(version)s.orig.tar.gz'
18+
tarball_checksum = '41606cb8e788a7f8c4514290646d4ba5c7bc68d9e1ccd1a73f446a90546913eb'
19+
20+
licenses = [License.GPLv2Plus]
21+
22+
patches = [
23+
f'{name}/0001-Add-Meson-build.patch',
24+
]
1725

18-
patches = ['x264/0001-configure-Force-pkgconfig-file-to-have-relative-valu.patch']
26+
meson_options = {}
1927

2028
files_libs = ['libx264']
2129
files_bins = ['x264']
@@ -25,48 +33,11 @@ class Recipe(recipe.Recipe):
2533
allow_parallel_build = False
2634

2735
def prepare(self):
28-
# clang x86-32 fails at generating proper asm PIC code
29-
# See bug https://bugzilla.gnome.org/show_bug.cgi?id=727079
30-
enable_asm = True
31-
AS = ['nasm']
32-
33-
arch = self.config.target_arch
34-
if self.config.target_arch == Architecture.X86:
35-
arch = 'i686'
36-
if Architecture.is_arm(self.config.target_arch):
37-
cc = self.get_env('CC')
38-
if cc:
39-
AS = [cc]
40-
else:
41-
AS = []
42-
if self.config.target_platform in [Platform.IOS, Platform.DARWIN]:
43-
if Architecture.is_arm(self.config.target_arch):
44-
# x264 ships its own gas-preprocessor.pl
45-
AS = ['tools/' + self.get_env('GAS')]
46-
elif self.config.target_arch == Architecture.X86:
47-
enable_asm = False
48-
4936
if self.config.target_platform == Platform.ANDROID:
50-
v = DistroVersion.get_android_api_version(self.config.target_distro_version)
51-
# Don't build the cli on Android, it fails with NDK 16
52-
self.configure_options += ' --disable-cli'
37+
self.meson_options['cli'] = 'false'
5338
self.files_bins.remove('x264')
54-
if self.config.target_arch in [Architecture.X86_64]:
55-
# Fails linking into an android application
56-
enable_asm = False
57-
elif self.config.target_arch in [Architecture.X86] and v < 24:
58-
# passing -mstackrealign consumes an extra register and will
59-
# fail compliation.
60-
# https://github.com/android-ndk/ndk/issues/690
61-
# https://github.com/android-ndk/ndk/issues/693
62-
enable_asm = False
63-
64-
self.set_env('AS', *AS)
65-
if enable_asm is False:
66-
self.configure_options += ' --disable-asm '
6739

6840
def post_install(self):
69-
libtool_la = LibtoolLibrary('x264', 148, None, None, self.config.libdir,
70-
self.config.target_platform)
71-
libtool_la.save()
41+
LibtoolLibrary('x264', 164, None, None, self.config.libdir,
42+
self.config.target_platform).save()
7243
super().post_install()

0 commit comments

Comments
 (0)