diff --git a/patches/dav1d-dll-version.patch b/patches/dav1d-dll-version.patch new file mode 100644 index 00000000..2de9dd30 --- /dev/null +++ b/patches/dav1d-dll-version.patch @@ -0,0 +1,11 @@ +--- dav1d-1.3.0/src/meson.build.orig 2023-10-03 17:36:52.000000000 +0200 ++++ dav1d-1.3.0/src/meson.build 2023-10-06 08:30:26.038159600 +0200 +@@ -304,7 +304,7 @@ + endforeach + + # The final dav1d library +-if host_machine.system() == 'windows' ++if host_machine.system() == 'windows' and cc.get_id() == 'msvc' + dav1d_soversion = '' + else + dav1d_soversion = dav1d_api_version_major diff --git a/patches/ffmpeg-4.3.1-ff_seek_frame_binary.diff b/patches/ffmpeg-4.3.1-ff_seek_frame_binary.diff deleted file mode 100644 index 8dc731d7..00000000 --- a/patches/ffmpeg-4.3.1-ff_seek_frame_binary.diff +++ /dev/null @@ -1,21 +0,0 @@ -commit 7460b9d54d0b2e1059efc59a99e3461927e90c44 -Author: Tom Rothamel -Date: Mon Jan 16 22:44:24 2023 -0500 - - Fixes uninitialized variables that cause a crash in clang. - - Based on https://github.com/FFmpeg/FFmpeg/commit/ab792634197e364ca1bb194f9abe36836e42f12d . - -diff --git a/libavformat/utils.c b/libavformat/utils.c -index ba8aaeb..d3f76f5 100644 ---- a/libavformat/utils.c -+++ b/libavformat/utils.c -@@ -2178,7 +2178,7 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index, - int64_t target_ts, int flags) - { - const AVInputFormat *avif = s->iformat; -- int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit; -+ int64_t pos_min = 0, pos_max = 0, pos, pos_limit; - int64_t ts_min, ts_max, ts; - int index; - int64_t ret; diff --git a/patches/ffmpeg-4.3.1-sse.diff b/patches/ffmpeg-4.3.1-sse.diff deleted file mode 100644 index 55ce3451..00000000 --- a/patches/ffmpeg-4.3.1-sse.diff +++ /dev/null @@ -1,62 +0,0 @@ -From ba3e771a42c29ee02c34e7769cfc1b2dbc5c760a Mon Sep 17 00:00:00 2001 -From: James Almer -Date: Sun, 12 Jul 2020 21:32:01 -0300 -Subject: [PATCH] x86/yuv2rgb: fix crashes when storing data on unaligned - buffers - -Regression since fc6a5883d6af8cae0e96af84dda0ad74b360a084 on SSSE3 enabled -CPUs. - -Fixes ticket #8747 - -Signed-off-by: James Almer ---- - libswscale/x86/yuv_2_rgb.asm | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/libswscale/x86/yuv_2_rgb.asm b/libswscale/x86/yuv_2_rgb.asm -index 575a84d921..003dff1f25 100644 ---- a/libswscale/x86/yuv_2_rgb.asm -+++ b/libswscale/x86/yuv_2_rgb.asm -@@ -268,9 +268,9 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters - por m2, m7 - por m1, m6 ; g5 b5 r6 g6 b6 r7 g7 b7 r8 g8 b8 r9 g9 b9 r10 g10 - por m2, m3 ; b10 r11 g11 b11 r12 g12 b12 r13 g13 b13 r14 g14 b14 r15 g15 b15 -- mova [imageq], m0 -- mova [imageq + 16], m1 -- mova [imageq + 32], m2 -+ movu [imageq], m0 -+ movu [imageq + 16], m1 -+ movu [imageq + 32], m2 - %endif ; mmsize = 16 - %else ; PACK RGB15/16/32 - packuswb m0, m1 -@@ -300,10 +300,10 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters - punpckhwd m_green, m_red - punpcklwd m5, m6 - punpckhwd m_alpha, m6 -- mova [imageq + 0], m_blue -- mova [imageq + 8 * time_num], m_green -- mova [imageq + 16 * time_num], m5 -- mova [imageq + 24 * time_num], m_alpha -+ movu [imageq + 0], m_blue -+ movu [imageq + 8 * time_num], m_green -+ movu [imageq + 16 * time_num], m5 -+ movu [imageq + 24 * time_num], m_alpha - %else ; PACK RGB15/16 - %define depth 2 - %if cpuflag(ssse3) -@@ -342,8 +342,8 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters - mova m2, m0 - punpcklbw m0, m1 - punpckhbw m2, m1 -- mova [imageq], m0 -- mova [imageq + 8 * time_num], m2 -+ movu [imageq], m0 -+ movu [imageq + 8 * time_num], m2 - %endif ; PACK RGB15/16 - %endif ; PACK RGB15/16/32 - --- -2.20.1 - diff --git a/patches/ffmpeg-5.0-backport-ranlib-build-fix.patch b/patches/ffmpeg-5.0-backport-ranlib-build-fix.patch new file mode 100644 index 00000000..1c264f75 --- /dev/null +++ b/patches/ffmpeg-5.0-backport-ranlib-build-fix.patch @@ -0,0 +1,59 @@ +From bc5ccea3b9d2c71929af6271bd8afe9b6cfab436 Mon Sep 17 00:00:00 2001 +From: Adrian Ratiu +Date: Mon, 14 Feb 2022 15:00:07 +0200 +Subject: [PATCH] configure: move ranlib -D test after setting defaults +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Backport [from master bc5ccea3b9d2c7] + +In Gentoo and ChromeOS we want to allow pure LLVM builds without +using GNU tools, so we block any unwanted mixed GNU/LLVM usages +(GNU tools are still kept around in our chroots for projects +like glibc which cannot yet be built otherwise). + +The default ${cross_prefix}${ranlib_default} points to GNU and +fails, so move the test a bit later - after the defaults are +set and the proper values get overriden - such that ffmpeg +configure calls the llvm-ranlib we desire. [1] + +[1] https://gitweb.gentoo.org/repo/gentoo.git/tree/media-video/ffmpeg/ffmpeg-4.4.1-r1.ebuild?id=7a34377e3277a6a0e2eedd40e90452a44c55f1e6#n477 + +Signed-off-by: Adrian Ratiu +Signed-off-by: Martin Storsjö +--- + configure | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configure b/configure +index 7d22c2a345..82642deabe 100755 +--- a/configure ++++ b/configure +@@ -4403,11 +4403,7 @@ cc_default="${cross_prefix}${cc_default}" + cxx_default="${cross_prefix}${cxx_default}" + nm_default="${cross_prefix}${nm_default}" + pkg_config_default="${cross_prefix}${pkg_config_default}" +-if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then +- ranlib_default="${cross_prefix}${ranlib_default} -D" +-else +- ranlib_default="${cross_prefix}${ranlib_default}" +-fi ++ranlib_default="${cross_prefix}${ranlib_default}" + strip_default="${cross_prefix}${strip_default}" + windres_default="${cross_prefix}${windres_default}" + +@@ -4440,6 +4436,10 @@ set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \ + enabled cross_compile || host_cc_default=$cc + set_default host_cc + ++if ${ranlib} 2>&1 | grep -q "\-D "; then ++ ranlib="${ranlib} -D" ++fi ++ + pkg_config_fail_message="" + if ! $pkg_config --version >/dev/null 2>&1; then + warn "$pkg_config not found, library detection may fail." +-- +2.35.1 + diff --git a/renios/prototype/prototype.xcodeproj/project.pbxproj b/renios/prototype/prototype.xcodeproj/project.pbxproj index 13ffc65b..2f0a85ee 100644 --- a/renios/prototype/prototype.xcodeproj/project.pbxproj +++ b/renios/prototype/prototype.xcodeproj/project.pbxproj @@ -344,7 +344,7 @@ "-lSDL2_image", "-lSDL2", "-lavif", - "-laom", + "-ldav1d", "-lyuv", "-lturbojpeg", "-lpng16", @@ -392,7 +392,7 @@ "-lSDL2_image", "-lSDL2", "-lavif", - "-laom", + "-ldav1d", "-lyuv", "-lturbojpeg", "-lpng16", diff --git a/renpybuild/run.py b/renpybuild/run.py index 7621b667..37251b48 100644 --- a/renpybuild/run.py +++ b/renpybuild/run.py @@ -120,6 +120,9 @@ def build_environment(c): c.var("configure", "./configure") c.var("cmake", "cmake") + c.var("meson_configure", "meson setup") + c.var("meson_compile", "meson compile -j " + str(cpuccount)) + c.var("sysroot", c.tmp / f"sysroot.{c.platform}-{c.arch}") c.var("build_platform", sysconfig.get_config_var("HOST_GNU_TYPE")) @@ -218,6 +221,11 @@ def build_environment(c): c.var("cmake_system_processor", "x86_64") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH='{{ install }};{{ sysroot }}' -DCMAKE_SYSROOT={{ sysroot }}") + c.var("meson_cross_system", "linux") + c.var("meson_cross_kernel", "linux") + c.var("meson_cross_cpu_family", "x86_64") + c.var("meson_cross_cpu", "x86_64") + elif (c.platform == "linux") and (c.arch == "aarch64"): llvm(c, clang_args="-target {{ host_platform }} --sysroot {{ sysroot }} -fPIC -pthread") @@ -229,6 +237,11 @@ def build_environment(c): c.var("cmake_system_processor", "aarch64") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH='{{ install }};{{ sysroot }}' -DCMAKE_SYSROOT={{ sysroot }}") + c.var("meson_cross_system", "linux") + c.var("meson_cross_kernel", "linux") + c.var("meson_cross_cpu_family", "aarch64") + c.var("meson_cross_cpu", "aarch64") + elif (c.platform == "linux") and (c.arch == "armv7l"): llvm(c, clang_args="-target {{ host_platform }} --sysroot {{ sysroot }} -fPIC -pthread -mfpu=neon -mfloat-abi=hard") @@ -240,6 +253,11 @@ def build_environment(c): c.var("cmake_system_processor", "armv7") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH='{{ install }};{{ sysroot }}' -DCMAKE_SYSROOT={{ sysroot }}") + c.var("meson_cross_system", "linux") + c.var("meson_cross_kernel", "linux") + c.var("meson_cross_cpu_family", "arm") + c.var("meson_cross_cpu", "armhf") + elif (c.platform == "windows") and (c.arch == "x86_64"): llvm( @@ -254,6 +272,11 @@ def build_environment(c): c.var("cmake_system_processor", "x86_64") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH='{{ install }};{{ cross }}/llvm-mingw/x86_64-w64-mingw32' -DCMAKE_SYSROOT={{ cross }}/llvm-mingw/x86_64-w64-mingw32") + c.var("meson_cross_system", "windows") + c.var("meson_cross_kernel", "nt") + c.var("meson_cross_cpu_family", "x86_64") + c.var("meson_cross_cpu", "x86_64") + elif (c.platform == "android") and (c.arch == "x86_64"): android_llvm(c, "x86_64") @@ -265,6 +288,11 @@ def build_environment(c): c.var("android_abi", "x86_64") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH={{ install }} -DCMAKE_TOOLCHAIN_FILE={{cross}}/{{ndk_version}}/build/cmake/android.toolchain.cmake -DANDROID_ABI={{ android_abi }} -DANDROID_PLATFORM=android-21 -DANDROID_USE_LEGACY_TOOLCHAIN_FILE=OFF") + c.var("meson_cross_system", "android") + c.var("meson_cross_kernel", "linux") + c.var("meson_cross_cpu_family", "x86_64") + c.var("meson_cross_cpu", "x86_64") + elif (c.platform == "android") and (c.arch == "arm64_v8a"): android_llvm(c, "aarch64") @@ -276,6 +304,11 @@ def build_environment(c): c.var("android_abi", "arm64-v8a") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH={{ install }} -DCMAKE_TOOLCHAIN_FILE={{cross}}/{{ndk_version}}/build/cmake/android.toolchain.cmake -DANDROID_ABI={{ android_abi }} -DANDROID_PLATFORM=android-21 -DANDROID_USE_LEGACY_TOOLCHAIN_FILE=OFF") + c.var("meson_cross_system", "android") + c.var("meson_cross_kernel", "linux") + c.var("meson_cross_cpu_family", "aarch64") + c.var("meson_cross_cpu", "aarch64") + elif (c.platform == "android") and (c.arch == "armeabi_v7a"): android_llvm(c, "armv7a") @@ -287,6 +320,11 @@ def build_environment(c): c.var("android_abi", "armeabi-v7a") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH={{ install }} -DCMAKE_TOOLCHAIN_FILE={{cross}}/{{ndk_version}}/build/cmake/android.toolchain.cmake -DANDROID_ABI={{ android_abi }} -DANDROID_PLATFORM=android-21 -DANDROID_USE_LEGACY_TOOLCHAIN_FILE=OFF") + c.var("meson_cross_system", "android") + c.var("meson_cross_kernel", "linux") + c.var("meson_cross_cpu_family", "arm") + c.var("meson_cross_cpu", "armv7") + elif (c.platform == "mac") and (c.arch == "x86_64"): llvm( @@ -302,6 +340,12 @@ def build_environment(c): c.var("cmake_system_processor", "x86_64") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH='{{ install }};{{ cross }}/sdk' -DCMAKE_SYSROOT={{ cross }}/sdk") + c.var("meson_cross_system", "darwin") + c.var("meson_cross_subsystem", "macos") + c.var("meson_cross_kernel", "xnu") + c.var("meson_cross_cpu_family", "x86_64") + c.var("meson_cross_cpu", "x86_64") + elif (c.platform == "mac") and (c.arch == "arm64"): llvm( @@ -317,6 +361,12 @@ def build_environment(c): c.var("cmake_system_processor", "aarch64") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH='{{ install }};{{ cross }}/sdk' -DCMAKE_SYSROOT={{ cross }}/sdk") + c.var("meson_cross_system", "darwin") + c.var("meson_cross_subsystem", "macos") + c.var("meson_cross_kernel", "xnu") + c.var("meson_cross_cpu_family", "aarch64") + c.var("meson_cross_cpu", "arm64") + elif (c.platform == "ios") and (c.arch == "arm64"): llvm( @@ -331,6 +381,12 @@ def build_environment(c): c.var("cmake_system_processor", "aarch64") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH='{{ install }};{{ cross }}/sdk' -DCMAKE_SYSROOT={{ cross }}/sdk") + c.var("meson_cross_system", "darwin") + c.var("meson_cross_subsystem", "ios") + c.var("meson_cross_kernel", "xnu") + c.var("meson_cross_cpu_family", "aarch64") + c.var("meson_cross_cpu", "aarch64") + elif (c.platform == "ios") and (c.arch == "sim-arm64"): llvm( @@ -345,6 +401,12 @@ def build_environment(c): c.var("cmake_system_processor", "aarch64") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH='{{ install }};{{ cross }}/sdk' -DCMAKE_SYSROOT={{ cross }}/sdk") + c.var("meson_cross_system", "darwin") + c.var("meson_cross_subsystem", "ios-simulator") + c.var("meson_cross_kernel", "xnu") + c.var("meson_cross_cpu_family", "aarch64") + c.var("meson_cross_cpu", "aarch64") + elif (c.platform == "ios") and (c.arch == "sim-x86_64"): llvm( @@ -359,6 +421,12 @@ def build_environment(c): c.var("cmake_system_processor", "x86_64") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH='{{ install }};{{ cross }}/sdk' -DCMAKE_SYSROOT={{ cross }}/sdk") + c.var("meson_cross_system", "darwin") + c.var("meson_cross_subsystem", "ios-simulator") + c.var("meson_cross_kernel", "xnu") + c.var("meson_cross_cpu_family", "x86_64") + c.var("meson_cross_cpu", "x86_64") + elif (c.platform == "web") and (c.arch == "wasm") and (c.name != "web"): # Use emscripten wrapper to configure and build @@ -399,6 +467,11 @@ def build_environment(c): c.var("cmake_system_processor", "generic") c.var("cmake_args", "-DCMAKE_FIND_ROOT_PATH={{ install }}") + c.var("meson_cross_system", "emscripten") + c.var("meson_cross_kernel", "none") + c.var("meson_cross_cpu_family", "wasm32") + c.var("meson_cross_cpu", "wasm32") + if c.kind not in ( "host", "host-python", "cross" ): c.env("PKG_CONFIG_LIBDIR", "{{ install }}/lib/pkgconfig:{{ PKG_CONFIG_LIBDIR }}") @@ -411,6 +484,17 @@ def build_environment(c): c.var("cmake", "{{cmake}} {{ cmake_args }} -DCMAKE_PROJECT_INCLUDE_BEFORE={{root}}/tools/cmake_build_variables.cmake -DCMAKE_BUILD_TYPE=Release") + if not "meson_cross_subsystem" in c.variables: + c.var("meson_cross_subsystem", "{{ meson_cross_system }} ") + + if c.kind not in ( "host", "host-python", "cross" ): + c.var("meson_build_kind", "cross") + else: + c.var("meson_build_kind", "native") + + c.var("meson_config_file", "{{ install }}/meson_{{meson_build_kind}}_file.txt") + c.var("meson_args", "--{{meson_build_kind}}-file={{meson_config_file}} --buildtype=release -Dc_std=gnu17 -Dcpp_std=gnu++17") + # Used by zlib. if c.kind != "host": c.var("cross_config", "--host={{ host_platform }} --build={{ build_platform }}") diff --git a/requirements.txt b/requirements.txt index ab7d948c..8a64e912 100644 --- a/requirements.txt +++ b/requirements.txt @@ -37,3 +37,4 @@ sphinxcontrib-qthelp==2.0.0 sphinxcontrib-serializinghtml==2.0.0 typing==3.7.4.3 urllib3==2.2.2 +meson>=1.4.1 diff --git a/source/dav1d-1.5.0.tar.xz b/source/dav1d-1.5.0.tar.xz new file mode 100644 index 00000000..98c57e65 Binary files /dev/null and b/source/dav1d-1.5.0.tar.xz differ diff --git a/source/ffmpeg-4.4.5.tar.gz b/source/ffmpeg-4.4.5.tar.gz new file mode 100644 index 00000000..5d0551b5 Binary files /dev/null and b/source/ffmpeg-4.4.5.tar.gz differ diff --git a/source/ffmpeg-5.0-backport-ranlib-build-fix.patch b/source/ffmpeg-5.0-backport-ranlib-build-fix.patch new file mode 100644 index 00000000..1c264f75 --- /dev/null +++ b/source/ffmpeg-5.0-backport-ranlib-build-fix.patch @@ -0,0 +1,59 @@ +From bc5ccea3b9d2c71929af6271bd8afe9b6cfab436 Mon Sep 17 00:00:00 2001 +From: Adrian Ratiu +Date: Mon, 14 Feb 2022 15:00:07 +0200 +Subject: [PATCH] configure: move ranlib -D test after setting defaults +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Backport [from master bc5ccea3b9d2c7] + +In Gentoo and ChromeOS we want to allow pure LLVM builds without +using GNU tools, so we block any unwanted mixed GNU/LLVM usages +(GNU tools are still kept around in our chroots for projects +like glibc which cannot yet be built otherwise). + +The default ${cross_prefix}${ranlib_default} points to GNU and +fails, so move the test a bit later - after the defaults are +set and the proper values get overriden - such that ffmpeg +configure calls the llvm-ranlib we desire. [1] + +[1] https://gitweb.gentoo.org/repo/gentoo.git/tree/media-video/ffmpeg/ffmpeg-4.4.1-r1.ebuild?id=7a34377e3277a6a0e2eedd40e90452a44c55f1e6#n477 + +Signed-off-by: Adrian Ratiu +Signed-off-by: Martin Storsjö +--- + configure | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configure b/configure +index 7d22c2a345..82642deabe 100755 +--- a/configure ++++ b/configure +@@ -4403,11 +4403,7 @@ cc_default="${cross_prefix}${cc_default}" + cxx_default="${cross_prefix}${cxx_default}" + nm_default="${cross_prefix}${nm_default}" + pkg_config_default="${cross_prefix}${pkg_config_default}" +-if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then +- ranlib_default="${cross_prefix}${ranlib_default} -D" +-else +- ranlib_default="${cross_prefix}${ranlib_default}" +-fi ++ranlib_default="${cross_prefix}${ranlib_default}" + strip_default="${cross_prefix}${strip_default}" + windres_default="${cross_prefix}${windres_default}" + +@@ -4440,6 +4436,10 @@ set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \ + enabled cross_compile || host_cc_default=$cc + set_default host_cc + ++if ${ranlib} 2>&1 | grep -q "\-D "; then ++ ranlib="${ranlib} -D" ++fi ++ + pkg_config_fail_message="" + if ! $pkg_config --version >/dev/null 2>&1; then + warn "$pkg_config not found, library detection may fail." +-- +2.35.1 + diff --git a/tasks/__init__.py b/tasks/__init__.py index 3b36307b..67f35a2b 100644 --- a/tasks/__init__.py +++ b/tasks/__init__.py @@ -4,6 +4,7 @@ from . import cython from . import env_sh +from . import meson_setup from . import sysroot from . import toolchain @@ -25,7 +26,8 @@ from . import libwebp from . import libyuv -from . import aom +# from . import aom +from . import dav1d from . import libavif from . import hostpython3 diff --git a/tasks/dav1d.py b/tasks/dav1d.py new file mode 100644 index 00000000..c88d4fe4 --- /dev/null +++ b/tasks/dav1d.py @@ -0,0 +1,39 @@ +from renpybuild.context import Context +from renpybuild.task import task, annotator + +version = "1.5.0" + + +@task(platforms="all") +def unpack(c: Context): + c.clean() + + c.var("version", version) + c.run("tar xJf {{source}}/dav1d-{{version}}.tar.xz") + + c.var("version", version) + c.chdir("dav1d-{{version}}") + + c.patch("dav1d-dll-version.patch") + + +@task(platforms="all") +def build(c: Context): + c.var("version", version) + c.chdir("dav1d-{{version}}") + + c.run(""" + {{ meson_configure }} {{ meson_args }} + --prefix={{install}} + --default-library=static + -Denable_tests=false + -Denable_tools=false + build + """) + + try: + c.run("{{ meson_compile }} -C build") + except: + c.run("meson compile -j 1 -C build -v") + + c.run("meson install -C build") diff --git a/tasks/ffmpeg.py b/tasks/ffmpeg.py index d9f3fa07..e3372438 100644 --- a/tasks/ffmpeg.py +++ b/tasks/ffmpeg.py @@ -1,7 +1,7 @@ from renpybuild.context import Context from renpybuild.task import task -version = "4.3.1" +version = "4.4.5" @task(platforms="all") @@ -14,8 +14,7 @@ def unpack(c: Context): c.var("version", version) c.chdir("ffmpeg-{{version}}") - c.patch("ffmpeg-4.3.1-sse.diff") - c.patch("ffmpeg-4.3.1-ff_seek_frame_binary.diff") + c.patch("ffmpeg-5.0-backport-ranlib-build-fix.patch") @task() @@ -106,7 +105,7 @@ def build(c: Context): --enable-swscale --enable-avfilter --enable-avresample - --enable-libaom + --enable-libdav1d --disable-bzlib @@ -149,7 +148,7 @@ def build(c: Context): --enable-decoder=vp3 --enable-decoder=vp8 --enable-decoder=vp9 - --enable-decoder=libaom_av1 + --enable-decoder=libdav1d --enable-parser=mpegaudio --enable-parser=mpegvideo diff --git a/tasks/libavif.py b/tasks/libavif.py index dc2d4336..6e03073a 100644 --- a/tasks/libavif.py +++ b/tasks/libavif.py @@ -15,7 +15,8 @@ def build(c : Context): c.run(""" {{ cmake }} -DCMAKE_INSTALL_PREFIX={{install}} - -DAVIF_CODEC_AOM=1 + -DAVIF_CODEC_DAV1D=1 + -DAVIF_CODEC_AOM=0 -DAVIF_CODEC_AOM_ENCODE=0 -DBUILD_SHARED_LIBS=0 {{ tmp }}/source/libavif diff --git a/tasks/meson_setup.py b/tasks/meson_setup.py new file mode 100644 index 00000000..0c1c810e --- /dev/null +++ b/tasks/meson_setup.py @@ -0,0 +1,61 @@ +from renpybuild.context import Context +from renpybuild.task import task + +@task(platforms="all") +def unpack(c: Context): + + # Remove flags for compiler and set them using meson's method + for compiler_var in ("CC", "CXX", "CPP"): + updated_var = c.environ[compiler_var].replace("-fuse-ld=lld -Wno-unused-command-line-argument ", "") + + if compiler_var == "CXX": + updated_var = updated_var.replace(" -std=gnu++17", "") + else: + updated_var = updated_var.replace(" -std=gnu17", "") + + c.env(compiler_var, updated_var) + + # Set linker type + c.env("CC_LD", "lld") + c.env("CXX_LD", "lld") + + if c.platform == "mac" or c.platform == "ios": + c.env("OBJC_LD", "lld") + c.env("OBJCXX_LD", "lld") + + c.run(""" + meson env2mfile --cross + -o "{{ install }}/meson_cross_file.txt" + --system={{ meson_cross_system }} + --subsystem={{ meson_cross_subsystem }} + --kernel={{ meson_cross_kernel }} + --cpu-family={{ meson_cross_cpu_family }} + --cpu={{ meson_cross_cpu }} + """) + + # Delete option if its value is "none" + c.run(""" sed -i "/'none'/d" "{{ install }}/meson_cross_file.txt" """) + +@task(kind="host", platforms="all") +def unpack(c: Context): + + # Remove flags for compiler and set them using meson's method + for compiler_var in ("CC", "CXX", "CPP"): + updated_var = c.environ[compiler_var].replace("-fuse-ld=lld -Wno-unused-command-line-argument ", "") + + if compiler_var == "CC": + updated_var = updated_var.replace(" -std=gnu17", "") + elif compiler_var == "CXX": + updated_var = updated_var.replace(" -std=gnu++17", "") + + c.env(compiler_var, updated_var) + + # Set linker type + c.env("CC_LD", "lld") + c.env("CXX_LD", "lld") + + if c.platform == "mac" or c.platform == "ios": + c.env("OBJC_LD", "lld") + c.env("OBJCXX_LD", "lld") + + c.run("""meson env2mfile --native -o "{{ install }}/meson_native_file.txt" """) diff --git a/tasks/renpython.py b/tasks/renpython.py index a7749fe0..ab82213b 100644 --- a/tasks/renpython.py +++ b/tasks/renpython.py @@ -66,7 +66,7 @@ def link_linux(c: Context): -lSDL2 -lGL -lavif - -laom + -ldav1d -lyuv -ljpeg -lpng @@ -147,7 +147,7 @@ def link_android(c: Context): -lOpenSLES -lavif - -laom + -ldav1d -lyuv -ljpeg -lpng @@ -204,7 +204,7 @@ def link_mac(c: Context): -lSDL2_image -lSDL2 -lavif - -laom + -ldav1d -lyuv -ljpeg -lpng @@ -351,7 +351,7 @@ def link_windows(c: Context): -lSDL2 -lopengl32 -lavif - -laom + -ldav1d -lyuv -ljpeg -lpng16 @@ -571,7 +571,7 @@ def link_web(c: Context): -lSDL2_image -lSDL2 -lavif - -laom + -ldav1d -lyuv -ljpeg -lpng diff --git a/tasks/sdl2_image.py b/tasks/sdl2_image.py index a4387a99..51ff8a10 100644 --- a/tasks/sdl2_image.py +++ b/tasks/sdl2_image.py @@ -28,7 +28,7 @@ def build(c: Context): # c.run("""./autogen.sh""") c.run("autoreconf -f") - c.env("LIBAVIF_LIBS", "-lavif -laom -lyuv") + c.env("LIBAVIF_LIBS", "-lavif -ldav1d -lyuv") if c.platform == "web": c.env("SDL_CFLAGS", "-sUSE_SDL=2")