From 7889de7865e81ea2504495e004662956addd3d85 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Mon, 7 Oct 2024 21:55:06 +0200 Subject: [PATCH 01/15] remove native nasm - remove native nasm, it is a prerequisite in the dev. environment since update to debian 12 - remove native yasm - update related Makefiles --- cross/dav1d/Makefile | 9 ++-- cross/ffmpeg4/Makefile | 12 +++--- cross/lame/Makefile | 12 +++--- cross/libvpx/Makefile | 10 ++--- cross/openh264/Makefile | 11 ++--- cross/x264/Makefile | 11 +++-- cross/x265/Makefile | 2 - mk/spksrc.cross-cmake-env.mk | 17 +++----- mk/spksrc.native-cmake-env.mk | 18 ++++---- native/nasm/Makefile | 16 ------- native/nasm/digests | 3 -- ...-remove-invalid-pure_func-qualifiers.patch | 42 ------------------- native/yasm/Makefile | 16 ------- native/yasm/digests | 3 -- 14 files changed, 50 insertions(+), 132 deletions(-) delete mode 100644 native/nasm/Makefile delete mode 100644 native/nasm/digests delete mode 100644 native/nasm/patches/001-remove-invalid-pure_func-qualifiers.patch delete mode 100644 native/yasm/Makefile delete mode 100644 native/yasm/digests diff --git a/cross/dav1d/Makefile b/cross/dav1d/Makefile index 3fd37cb7981..2597d2b3b57 100644 --- a/cross/dav1d/Makefile +++ b/cross/dav1d/Makefile @@ -22,10 +22,11 @@ include ../../mk/spksrc.archs.mk # Define x86asm ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) -BUILD_DEPENDS = native/nasm -NASM_PATH = $(abspath $(PWD)/../../native/nasm/work-native/install/usr/local/bin) -ENV += AS=$(NASM_PATH)/nasm -ENV += PATH=$(NASM_PATH):$$PATH +NASM_BINARY = $(shell which nasm) +ifeq ($(NASM_BINARY),) +$(error nasm not found. Please install NASM assembler) +endif +ENV += AS=$(NASM_BINARY) CONFIGURE_ARGS += -Denable_asm=true # Allow ASM on aarch64, disable on all others diff --git a/cross/ffmpeg4/Makefile b/cross/ffmpeg4/Makefile index 2715995c68f..673c320c3ce 100644 --- a/cross/ffmpeg4/Makefile +++ b/cross/ffmpeg4/Makefile @@ -36,8 +36,7 @@ CONFIGURE_ARGS += --extra-cflags=-Wno-deprecated-declarations include ../../mk/spksrc.common.mk -OPTIONAL_DEPENDS = native/nasm -OPTIONAL_DEPENDS += cross/chromaprint-fftw +OPTIONAL_DEPENDS = cross/chromaprint-fftw OPTIONAL_DEPENDS += cross/dav1d OPTIONAL_DEPENDS += cross/frei0r OPTIONAL_DEPENDS += cross/libass @@ -59,10 +58,11 @@ OPTIONAL_DEPENDS += cross/shine # Define x86asm ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) -BUILD_DEPENDS = native/nasm -NASM_PATH = $(abspath $(PWD)/../../native/nasm/work-native/install/usr/local/bin) -ENV += AS=$(NASM_PATH)/nasm -ENV += PATH=$(NASM_PATH):$$PATH +NASM_BINARY = $(shell which nasm) +ifeq ($(NASM_BINARY),) +$(error nasm not found. Please intall NASM assembler) +endif +ENV += AS=$(NASM_BINARY) CONFIGURE_ARGS += --x86asmexe=nasm # Allow ASM on aarch64, disable on all others diff --git a/cross/lame/Makefile b/cross/lame/Makefile index 3ced943c589..500c95d96cc 100644 --- a/cross/lame/Makefile +++ b/cross/lame/Makefile @@ -2,11 +2,10 @@ PKG_NAME = lame PKG_VERS = 3.100 PKG_EXT = tar.gz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) -PKG_DIST_SITE = https://downloads.sourceforge.net/project/lame/$(PKG_NAME)/$(PKG_VERS) +PKG_DIST_SITE = https://downloads.sourceforge.net/project/lame/lame/$(PKG_VERS) PKG_DIR = $(PKG_NAME)-$(PKG_VERS) DEPENDS = -OPTIONAL_DEPENDS = native/nasm HOMEPAGE = https://lame.sourceforge.net/ COMMENT = High quality MPEG Audio Layer III encoder. @@ -17,9 +16,10 @@ GNU_CONFIGURE = 1 include ../../mk/spksrc.cross-cc.mk ifeq ($(findstring $(ARCH),$(x64_ARCHS) $(i686_ARCHS)),$(ARCH)) -BUILD_DEPENDS = native/nasm -NASM_PATH = $(realpath $(WORK_DIR)/../../../native/nasm/work-native/install/usr/local/bin) -ENV += AS=$(NASM_PATH)/nasm -ENV += PATH=$(NASM_PATH):$$PATH +NASM_BINARY = $(shell which nasm) +ifeq ($(NASM_BINARY),) +$(error nasm not found. Please install NASM assembler) +endif +ENV += AS=$(NASM_BINARY) CONFIGURE_ARGS += --enable-nasm endif diff --git a/cross/libvpx/Makefile b/cross/libvpx/Makefile index c30303e7c2a..124510107dd 100644 --- a/cross/libvpx/Makefile +++ b/cross/libvpx/Makefile @@ -7,7 +7,6 @@ PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIR = $(PKG_NAME)-$(PKG_VERS) DEPENDS = -OPTIONAL_DEPENDS = native/nasm UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) @@ -48,10 +47,11 @@ endif # Define x86asm ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) -BUILD_DEPENDS = native/nasm -NASM_PATH = $(abspath $(PWD)/../../native/nasm/work-native/install/usr/local/bin) -ENV += AS=$(NASM_PATH)/nasm -ENV += PATH=$(NASM_PATH):$$PATH +NASM_BINARY = $(shell which nasm) +ifeq ($(NASM_BINARY),) +$(error nasm not found. Please install NASM assembler) +endif +ENV += AS=$(NASM_BINARY) CONFIGURE_ARGS += --as=nasm CONFIGURE_ARGS += --disable-sse4_1 endif diff --git a/cross/openh264/Makefile b/cross/openh264/Makefile index 04db374c2e9..121858e31d3 100644 --- a/cross/openh264/Makefile +++ b/cross/openh264/Makefile @@ -6,7 +6,7 @@ PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://github.com/cisco/openh264/archive/refs/tags PKG_DIR = $(PKG_NAME)-$(PKG_VERS) -DEPENDS = +DEPENDS = HOMEPAGE = http://www.openh264.org/ COMMENT = OpenH264 is a codec library which supports H.264 encoding and decoding. It is suitable for use in real time applications such as WebRTC. @@ -18,10 +18,11 @@ CONFIGURE_ARGS += -Dtests=disabled POST_INSTALL_TARGET = openh264-post_install -BUILD_DEPENDS = native/nasm -NASM_PATH = $(realpath $(WORK_DIR)/../../../native/nasm/work-native/install/usr/local/bin) -ENV += PATH=$(NASM_PATH):$$PATH -ENV += AS=$(NASM_PATH)/nasm +NASM_BINARY = $(shell which nasm) +ifeq ($(NASM_BINARY),) +$(error nasm not found. Please install NASM assembler) +endif +ENV += AS=$(NASM_BINARY) include ../../mk/spksrc.cross-meson.mk diff --git a/cross/x264/Makefile b/cross/x264/Makefile index ae64d18792b..f7c72f810ff 100644 --- a/cross/x264/Makefile +++ b/cross/x264/Makefile @@ -3,13 +3,11 @@ PKG_VERS = 20240512-stable PKG_EXT = tar.gz PKG_GIT_HASH = 4613ac3c15fd75cebc4b9f65b7fb95e70a3acce1 PKG_DIST_NAME = $(PKG_NAME)-master.$(PKG_EXT) -PKG_DIST_FILE = $(PKG_NAME)-$(PKG_GIT_HASH).$(PKG_EXT) PKG_DIST_SITE = https://code.videolan.org/videolan/x264/-/archive/$(PKG_GIT_HASH) PKG_DIST_FILE = $(PKG_NAME)-git$(PKG_GIT_HASH).$(PKG_EXT) PKG_DIR = $(PKG_NAME)-$(PKG_GIT_HASH) DEPENDS = -OPTIONAL_DEPENDS = native/nasm HOMEPAGE = https://www.videolan.org/developers/x264.html COMMENT = x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC forma @@ -47,10 +45,11 @@ endif # Define x86asm ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) -BUILD_DEPENDS = native/nasm -NASM_PATH = $(abspath $(PWD)/../../native/nasm/work-native/install/usr/local/bin) -ENV += AS=$(NASM_PATH)/nasm -ENV += PATH=$(NASM_PATH):$$PATH +NASM_BINARY = $(shell which nasm) +ifeq ($(NASM_BINARY),) +$(error nasm not found. Please install NASM assembler) +endif +ENV += AS=$(NASM_BINARY) endif ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH)) diff --git a/cross/x265/Makefile b/cross/x265/Makefile index 18bbd895137..09ac8b82159 100644 --- a/cross/x265/Makefile +++ b/cross/x265/Makefile @@ -5,8 +5,6 @@ PKG_DIST_NAME = $(PKG_NAME)_$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://bitbucket.org/multicoreware/x265_git/downloads PKG_DIR = $(PKG_NAME)_$(PKG_VERS) -OPTIONAL_DEPENDS = native/nasm - HOMEPAGE = http://x265.org/ COMMENT = x265 is an open source HEVC encoder. LICENSE = GPL diff --git a/mk/spksrc.cross-cmake-env.mk b/mk/spksrc.cross-cmake-env.mk index 5c53a57c059..19d452a6c36 100644 --- a/mk/spksrc.cross-cmake-env.mk +++ b/mk/spksrc.cross-cmake-env.mk @@ -102,18 +102,13 @@ endif ifeq ($(strip $(CMAKE_USE_NASM)),1) # Define x86asm ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) - HOST_NASM = $(shell command -v nasm 2>/dev/null) - ENABLE_ASSEMBLY = ON - ifneq ($(HOST_NASM),) - ENV += AS=$(HOST_NASM) - CMAKE_ASM_COMPILER = $(HOST_NASM) - else - DEPENDS += native/nasm - NASM_PATH = $(abspath $(CURDIR)/../../native/nasm/work-native/install/usr/local/bin) - ENV += PATH=$(NASM_PATH):$$PATH - ENV += AS=$(NASM_PATH)/nasm - CMAKE_ASM_COMPILER = $(NASM_PATH)/nasm + NASM_BINARY = $(shell which nasm) + ifeq ($(NASM_BINARY),) + $(error nasm not found. Please install NASM assembler for CMAKE_USE_NASM=1) endif + ENABLE_ASSEMBLY = ON + ENV += AS=$(NASM_BINARY) + CMAKE_ASM_COMPILER = $(NASM_BINARY) endif else CMAKE_USE_NASM = 0 diff --git a/mk/spksrc.native-cmake-env.mk b/mk/spksrc.native-cmake-env.mk index e8bc272b9ee..487cb594e64 100644 --- a/mk/spksrc.native-cmake-env.mk +++ b/mk/spksrc.native-cmake-env.mk @@ -1,7 +1,10 @@ -# Configuration for CMake build +# Configuration for CMake build of native packages # CMAKE_ARGS += -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Release +# CMAKE_SYSTEM_NAME soll nicht gesetzt werden, sonst wird cross compiling angenommen... +#CMAKE_SYSTEM_NAME = Linux +#CMAKE_ARGS += -DCMAKE_SYSTEM_NAME=$(CMAKE_SYSTEM_NAME) # Use native cmake (latest stable) ifeq ($(strip $(USE_NATIVE_CMAKE)),1) @@ -14,7 +17,7 @@ endif # Use native cmake (Debian 10 "Buster") ifeq ($(strip $(USE_NATIVE_CMAKE_LEGACY)),1) BUILD_DEPENDS += native/cmake-legacy - CMAKE_PATH = $(abspath $(CURDIR)/../../native/cmake-legacy/work-native/install/usr/local/bin) + CMAKE_PATH = $(abspath $(CURDIR)/../../native/cmake-3.2.6/work-native/install/usr/local/bin) ENV += PATH=$(CMAKE_PATH):$$PATH export PATH := $(CMAKE_PATH):$(PATH) endif @@ -29,12 +32,13 @@ endif # set default ASM build environment ifeq ($(strip $(CMAKE_USE_NASM)),1) - DEPENDS += native/nasm - NASM_PATH = $(realpath $(WORK_DIR)/../../../native/nasm/work-native/install/usr/local/bin) - ENV += PATH=$(NASM_PATH):$$PATH - ENV += AS=$(NASM_PATH)/nasm + NASM_BINARY = $(shell which nasm) + ifeq ($(NASM_BINARY),) + $(error nasm not found. Please install NASM assembler for CMAKE_USE_NASM=1) + endif + ENV += AS=$(NASM_BINARY) CMAKE_ARGS += -DENABLE_ASSEMBLY=ON - CMAKE_ARGS += -DCMAKE_ASM_COMPILER=$(NASM_PATH)/nasm + CMAKE_ARGS += -DCMAKE_ASM_COMPILER=$(NASM_BINARY) else CMAKE_USE_NASM = 0 endif diff --git a/native/nasm/Makefile b/native/nasm/Makefile deleted file mode 100644 index d47efd9ab7e..00000000000 --- a/native/nasm/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -PKG_NAME = nasm -PKG_VERS = 2.16.03 -PKG_EXT = tar.xz -PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) -PKG_DIST_SITE = https://fossies.org/linux/misc -PKG_DIR = $(PKG_NAME)-$(PKG_VERS) - -DEPENDS = - -HOMEPAGE = https://www.nasm.us/ -COMMENT = The Netwide Assembler (NASM), an asssembler for the x86 CPU architecture portable to nearly every modern platform, and with code generation for many platforms old and new. -LICENSE = 2-clause BSD - -GNU_CONFIGURE = 1 - -include ../../mk/spksrc.native-cc.mk diff --git a/native/nasm/digests b/native/nasm/digests deleted file mode 100644 index 5b94283afd7..00000000000 --- a/native/nasm/digests +++ /dev/null @@ -1,3 +0,0 @@ -nasm-2.16.03.tar.xz SHA1 d3ceab29f8c62bdf9240032349deb594cb642863 -nasm-2.16.03.tar.xz SHA256 1412a1c760bbd05db026b6c0d1657affd6631cd0a63cddb6f73cc6d4aa616148 -nasm-2.16.03.tar.xz MD5 2b8c72c52eee4f20085065e68ac83b55 diff --git a/native/nasm/patches/001-remove-invalid-pure_func-qualifiers.patch b/native/nasm/patches/001-remove-invalid-pure_func-qualifiers.patch deleted file mode 100644 index 8e071daf43d..00000000000 --- a/native/nasm/patches/001-remove-invalid-pure_func-qualifiers.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- include/nasmlib.h.orig 2019-01-11 10:27:42.527098886 +0100 -+++ include/nasmlib.h 2019-01-11 10:30:53.731190121 +0100 -@@ -150,7 +150,7 @@ - #elif defined(HAVE_STRICMP) - #define nasm_stricmp stricmp - #else --int pure_func nasm_stricmp(const char *, const char *); -+int nasm_stricmp(const char *, const char *); - #endif - - #if defined(HAVE_STRNCASECMP) -@@ -158,10 +158,10 @@ - #elif defined(HAVE_STRNICMP) - #define nasm_strnicmp strnicmp - #else --int pure_func nasm_strnicmp(const char *, const char *, size_t); -+int nasm_strnicmp(const char *, const char *, size_t); - #endif - --int pure_func nasm_memicmp(const char *, const char *, size_t); -+int nasm_memicmp(const char *, const char *, size_t); - - #if defined(HAVE_STRSEP) - #define nasm_strsep strsep -@@ -170,7 +170,7 @@ - #endif - - #ifndef HAVE_DECL_STRNLEN --size_t pure_func strnlen(const char *, size_t); -+size_t strnlen(const char *, size_t); - #endif - - /* This returns the numeric value of a given 'digit'. */ -@@ -306,7 +306,7 @@ - char * safe_alloc nasm_basename(const char *path); - char * safe_alloc nasm_catfile(const char *dir, const char *path); - --const char * pure_func prefix_name(int); -+const char * prefix_name(int); - - /* - * Wrappers around fopen()... for future change to a dedicated structure diff --git a/native/yasm/Makefile b/native/yasm/Makefile deleted file mode 100644 index 064e18b51f9..00000000000 --- a/native/yasm/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -PKG_NAME = yasm -PKG_VERS = 1.3.0 -PKG_EXT = tar.gz -PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) -PKG_DIST_SITE = https://github.com/yasm/yasm/releases/download/v$(PKG_VERS) -PKG_DIR = $(PKG_NAME)-$(PKG_VERS) - -DEPENDS = - -HOMEPAGE = https://yasm.tortall.net -COMMENT = Yasm is a complete rewrite of the NASM assembler under the new BSD License. -LICENSE = BSD - -GNU_CONFIGURE = 1 - -include ../../mk/spksrc.native-cc.mk diff --git a/native/yasm/digests b/native/yasm/digests deleted file mode 100644 index 5fa49c61a5f..00000000000 --- a/native/yasm/digests +++ /dev/null @@ -1,3 +0,0 @@ -yasm-1.3.0.tar.gz SHA1 b7574e9f0826bedef975d64d3825f75fbaeef55e -yasm-1.3.0.tar.gz SHA256 3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f -yasm-1.3.0.tar.gz MD5 fc9e586751ff789b34b1f21d572d96af From 2c4a9cbbaee2c2aa91ecf4459e82c3415d00ac68 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Mon, 7 Oct 2024 22:31:56 +0200 Subject: [PATCH 02/15] temp add output to analyze prepare action --- .github/actions/prepare.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/actions/prepare.sh b/.github/actions/prepare.sh index 8e940a041f8..e3974dcd143 100755 --- a/.github/actions/prepare.sh +++ b/.github/actions/prepare.sh @@ -28,14 +28,22 @@ DEPENDENT_PACKAGES=$(echo "${GH_FILES}" | tr ' ' '\n' | grep -oP "(cross|native) # get dependency list # dependencies in this list include the cross or native folder (i.e. native/python cross/glib) echo "Building dependency list..." +echo "pwd: $(pwd)" +echo "packages: $(find spk/ -maxdepth 1 -type d | cut -c 5- | sort)" DEPENDENCY_LIST= for package in $(find spk/ -maxdepth 1 -type d | cut -c 5- | sort) do if [ ! -f "./spk/${package}/BROKEN" ]; then DEPENDENCY_LIST+=$(DEPENDENCY_WALK=1 make -s -C spk/${package} dependency-list 2> /dev/null)$'\n' + else + echo "broken package ${package}, skip dependency-list entry" fi done +echo "dependency list:" +echo "${DEPENDENCY_LIST}" + + # search for dependent spk packages for package in ${DEPENDENT_PACKAGES} do From d8809672b3b970071f3cd6f2081ce65f86b85124 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 8 Oct 2024 00:19:59 +0200 Subject: [PATCH 03/15] Revert "temp add output to analyze prepare action" This reverts commit 2c4a9cbbaee2c2aa91ecf4459e82c3415d00ac68. --- .github/actions/prepare.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/actions/prepare.sh b/.github/actions/prepare.sh index e3974dcd143..8e940a041f8 100755 --- a/.github/actions/prepare.sh +++ b/.github/actions/prepare.sh @@ -28,22 +28,14 @@ DEPENDENT_PACKAGES=$(echo "${GH_FILES}" | tr ' ' '\n' | grep -oP "(cross|native) # get dependency list # dependencies in this list include the cross or native folder (i.e. native/python cross/glib) echo "Building dependency list..." -echo "pwd: $(pwd)" -echo "packages: $(find spk/ -maxdepth 1 -type d | cut -c 5- | sort)" DEPENDENCY_LIST= for package in $(find spk/ -maxdepth 1 -type d | cut -c 5- | sort) do if [ ! -f "./spk/${package}/BROKEN" ]; then DEPENDENCY_LIST+=$(DEPENDENCY_WALK=1 make -s -C spk/${package} dependency-list 2> /dev/null)$'\n' - else - echo "broken package ${package}, skip dependency-list entry" fi done -echo "dependency list:" -echo "${DEPENDENCY_LIST}" - - # search for dependent spk packages for package in ${DEPENDENT_PACKAGES} do From 448c8799c51435611aa0e4996118d22d0db30509 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 8 Oct 2024 00:51:02 +0200 Subject: [PATCH 04/15] avoid variable in DEPENDS - change affected packages to trigger build --- spk/chromaprint/Makefile | 2 +- spk/comskip/Makefile | 2 +- spk/ffmpeg5/Makefile | 2 +- spk/ffmpeg7/Makefile | 2 +- spk/tvheadend/Makefile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spk/chromaprint/Makefile b/spk/chromaprint/Makefile index 59a494e570b..66d3b7cbc8f 100644 --- a/spk/chromaprint/Makefile +++ b/spk/chromaprint/Makefile @@ -4,7 +4,7 @@ SPK_REV = 22 SPK_ICON = src/chromaprint.png FFMPEG_PACKAGE = ffmpeg7 -DEPENDS = cross/$(SPK_NAME) +DEPENDS = cross/chromaprint SPK_DEPENDS = $(FFMPEG_PACKAGE) # ffmpeg7 requires c11 support diff --git a/spk/comskip/Makefile b/spk/comskip/Makefile index 3029cf522cd..8c2cac4b2a8 100644 --- a/spk/comskip/Makefile +++ b/spk/comskip/Makefile @@ -4,7 +4,7 @@ SPK_REV = 12 SPK_ICON = src/comskip.png FFMPEG_PACKAGE = ffmpeg5 -DEPENDS = cross/$(SPK_NAME) +DEPENDS = cross/comskip SPK_DEPENDS = $(FFMPEG_PACKAGE) STARTABLE = no diff --git a/spk/ffmpeg5/Makefile b/spk/ffmpeg5/Makefile index b4bf92f0e25..ad688456c13 100644 --- a/spk/ffmpeg5/Makefile +++ b/spk/ffmpeg5/Makefile @@ -4,7 +4,7 @@ SPK_REV = 6 SPK_ICON = src/ffmpeg.png CHANGELOG = "1. Update to version 5.1.6" -DEPENDS = cross/$(SPK_NAME) +DEPENDS = cross/ffmpeg5 MAINTAINER = th0ma7 DESCRIPTION = FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec - the leading audio/video codec library. More information from SynoCommunity FFmpeg package available at https://github.com/SynoCommunity/spksrc/wiki/FAQ-FFmpeg diff --git a/spk/ffmpeg7/Makefile b/spk/ffmpeg7/Makefile index 8db2dfa9b69..7a13d1be9a7 100644 --- a/spk/ffmpeg7/Makefile +++ b/spk/ffmpeg7/Makefile @@ -4,7 +4,7 @@ SPK_REV = 1 SPK_ICON = src/ffmpeg.png CHANGELOG = "1. Initial release of version 7 release" -DEPENDS = cross/$(SPK_NAME) +DEPENDS = cross/ffmpeg7 # requires c11 support UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) $(OLD_PPC_ARCHS) diff --git a/spk/tvheadend/Makefile b/spk/tvheadend/Makefile index 5c8f35a0478..10bedec84a2 100644 --- a/spk/tvheadend/Makefile +++ b/spk/tvheadend/Makefile @@ -25,7 +25,7 @@ UNSUPPORTED_ARCHS += $(ARMv5_ARCHS) WHEELS = src/requirements-pure.txt -DEPENDS = cross/$(SPK_NAME) +DEPENDS = cross/tvheadend DEPENDS += cross/dtv-scan-tables DEPENDS += cross/zap2epg cross/docker-tvheadend From 52b31b8091f1ad0dd4f39f3347676719b3c989c2 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 8 Oct 2024 01:10:00 +0200 Subject: [PATCH 05/15] revert unintended changes --- mk/spksrc.native-cmake-env.mk | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mk/spksrc.native-cmake-env.mk b/mk/spksrc.native-cmake-env.mk index 487cb594e64..b04c1e27e51 100644 --- a/mk/spksrc.native-cmake-env.mk +++ b/mk/spksrc.native-cmake-env.mk @@ -2,9 +2,6 @@ # CMAKE_ARGS += -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Release -# CMAKE_SYSTEM_NAME soll nicht gesetzt werden, sonst wird cross compiling angenommen... -#CMAKE_SYSTEM_NAME = Linux -#CMAKE_ARGS += -DCMAKE_SYSTEM_NAME=$(CMAKE_SYSTEM_NAME) # Use native cmake (latest stable) ifeq ($(strip $(USE_NATIVE_CMAKE)),1) @@ -17,7 +14,7 @@ endif # Use native cmake (Debian 10 "Buster") ifeq ($(strip $(USE_NATIVE_CMAKE_LEGACY)),1) BUILD_DEPENDS += native/cmake-legacy - CMAKE_PATH = $(abspath $(CURDIR)/../../native/cmake-3.2.6/work-native/install/usr/local/bin) + CMAKE_PATH = $(abspath $(CURDIR)/../../native/cmake-legacy/work-native/install/usr/local/bin) ENV += PATH=$(CMAKE_PATH):$$PATH export PATH := $(CMAKE_PATH):$(PATH) endif From e5b50fa85e05edcc1ce2cb6497def1d54b156301 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 17 Dec 2024 20:56:52 +0100 Subject: [PATCH 06/15] cross/dav1d: update from v1.4.2 to v1.4.3 - update cross/dav1d - remove definitions for nasm, meson build completely auto detects nasm --- cross/dav1d/Makefile | 20 +------------------- cross/dav1d/digests | 6 +++--- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/cross/dav1d/Makefile b/cross/dav1d/Makefile index 2597d2b3b57..99fe61934f3 100644 --- a/cross/dav1d/Makefile +++ b/cross/dav1d/Makefile @@ -1,5 +1,5 @@ PKG_NAME = dav1d -PKG_VERS = 1.4.2 +PKG_VERS = 1.4.3 PKG_EXT = tar.xz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://download.videolan.org/pub/videolan/dav1d/$(PKG_VERS) @@ -18,22 +18,4 @@ CONFIGURE_ARGS += -Denable_examples=false CONFIGURE_ARGS += -Denable_docs=false ADDITIONAL_CFLAGS = -O -include ../../mk/spksrc.archs.mk - -# Define x86asm -ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) -NASM_BINARY = $(shell which nasm) -ifeq ($(NASM_BINARY),) -$(error nasm not found. Please install NASM assembler) -endif -ENV += AS=$(NASM_BINARY) -CONFIGURE_ARGS += -Denable_asm=true - -# Allow ASM on aarch64, disable on all others -else ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) -CONFIGURE_ARGS += -Denable_asm=true -else -CONFIGURE_ARGS += -Denable_asm=false -endif - include ../../mk/spksrc.cross-meson.mk diff --git a/cross/dav1d/digests b/cross/dav1d/digests index d9c7fbabb26..547e23c4bca 100644 --- a/cross/dav1d/digests +++ b/cross/dav1d/digests @@ -1,3 +1,3 @@ -dav1d-1.4.2.tar.xz SHA1 6137672cb64714ab192fed167b852127eb45a2f8 -dav1d-1.4.2.tar.xz SHA256 7392cf4c432734eebb383319b5e05e994bffdcdfe66f82287c38873601a4ef0b -dav1d-1.4.2.tar.xz MD5 cdfa07cb6641caad509ac8e46ae7aa2a +dav1d-1.4.3.tar.xz SHA1 daf40121d16d5f580c42b4e8374c91d34efd9835 +dav1d-1.4.3.tar.xz SHA256 42fe524bcc82ea3a830057178faace22923a79bad3d819a4962d8cfc54c36f19 +dav1d-1.4.3.tar.xz MD5 c84c685c76e51b98e998db0995bd365c From db9b00f9b84d62437bcb058ab36a486748d96903 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 17 Dec 2024 20:57:56 +0100 Subject: [PATCH 07/15] cross/openh264: remove nasm definitions - remove definitions for nasm, meson build completely auto detects nasm - create optimized code --- cross/openh264/Makefile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cross/openh264/Makefile b/cross/openh264/Makefile index 121858e31d3..17acd0f8d7c 100644 --- a/cross/openh264/Makefile +++ b/cross/openh264/Makefile @@ -1,9 +1,9 @@ PKG_NAME = openh264 PKG_VERS = 2.4.1 PKG_EXT = tar.gz -PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) -PKG_DIST_SITE = https://github.com/cisco/openh264/archive/refs/tags +PKG_DIST_SITE = https://github.com/cisco/openh264/archive +PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIR = $(PKG_NAME)-$(PKG_VERS) DEPENDS = @@ -15,15 +15,10 @@ LICENSE = BSD UNSUPPORTED_ARCHS = $(PPC_ARCHS) CONFIGURE_ARGS += -Dtests=disabled +ADDITIONAL_CPPFLAGS = -O POST_INSTALL_TARGET = openh264-post_install -NASM_BINARY = $(shell which nasm) -ifeq ($(NASM_BINARY),) -$(error nasm not found. Please install NASM assembler) -endif -ENV += AS=$(NASM_BINARY) - include ../../mk/spksrc.cross-meson.mk .PHONY: openh264-post_install From f7381e66c67eb1f9eb6e116de18e1b1079460a1c Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 17 Dec 2024 21:05:27 +0100 Subject: [PATCH 08/15] remove CMAKE_USE_NASM - cmake builds completely auto detect nasm --- cross/libaom/Makefile | 4 +--- cross/svt-av1/Makefile | 2 -- cross/svt-hevc/Makefile | 2 -- cross/x265/Makefile | 7 ------- mk/spksrc.cross-cmake-env.mk | 24 ------------------------ mk/spksrc.cross-cmake.mk | 9 --------- mk/spksrc.cross-ninja.mk | 3 --- mk/spksrc.native-cmake-env.mk | 13 ------------- mk/spksrc.native-cmake.mk | 1 - 9 files changed, 1 insertion(+), 64 deletions(-) diff --git a/cross/libaom/Makefile b/cross/libaom/Makefile index 1dea25e46e4..b7b10d9b83c 100644 --- a/cross/libaom/Makefile +++ b/cross/libaom/Makefile @@ -11,15 +11,13 @@ DEPENDS = HOMEPAGE = https://aomedia.googlesource.com/aom/ COMMENT = AOMedia Video 1 (AV1) is an open, royalty-free video coding format designed for video transmissions over the Internet. -LICENSE = Royalty-free +LICENSE = 2-Clause BSD and Alliance for Open Media Patent License 1.0 UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) $(OLD_PPC_ARCHS) # Set working directory PKG_WORK_DIR = $(WORK_DIR)/$(PKG_NAME)_$(PKG_VERS)-build -CMAKE_USE_NASM = 1 - # libaom specific cmake options CMAKE_ARGS += -DCONFIG_AV1_ENCODER=1 diff --git a/cross/svt-av1/Makefile b/cross/svt-av1/Makefile index 0b94c5c6313..83fec2978b2 100644 --- a/cross/svt-av1/Makefile +++ b/cross/svt-av1/Makefile @@ -13,8 +13,6 @@ LICENSE = SPDX short identifier: BSD-2-Clause-Patent UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) $(PPC_ARCHS) -CMAKE_USE_NASM = 1 - include ../../mk/spksrc.cross-cmake.mk ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) diff --git a/cross/svt-hevc/Makefile b/cross/svt-hevc/Makefile index a9533c8c601..1ee67376ce4 100644 --- a/cross/svt-hevc/Makefile +++ b/cross/svt-hevc/Makefile @@ -15,6 +15,4 @@ LICENSE = SPDX short identifier: BSD-2-Clause-Patent # SVT-HEVC is only supported on x86_64 Intel platforms UNSUPPORTED_ARCHS = $(ARM_ARCHS) $(PPC_ARCHS) $(i686_ARCHS) -CMAKE_USE_NASM = 1 - include ../../mk/spksrc.cross-cmake.mk diff --git a/cross/x265/Makefile b/cross/x265/Makefile index 09ac8b82159..ee8cda750d7 100644 --- a/cross/x265/Makefile +++ b/cross/x265/Makefile @@ -12,7 +12,6 @@ LICENSE = GPL PRE_CONFIGURE_TARGET = x265_pre_configure PRE_COMPILE_TARGET = x265_pre_compile -CMAKE_USE_NASM = 1 CMAKE_SOURCE_DIR = source # Build directories for default, 12 and 10 bit depth @@ -61,12 +60,6 @@ ifeq ($(call version_ge, $(TCVERSION), 7.0),1) CMAKE_ARGS += -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_C99_MATH endif -# For ppc853x-4.3, disable atomics -ifeq ($(ARCH)-$(TCVERSION), ppc853x-4.3) -CMAKE_ARGS += -DNO_ATOMICS=ON -CMAKE_ARGS += -DCMAKE_CXX_FLAGS="-DSPKSRC_FIX_PPC853X_4_3" -endif - .PHONY: x265_pre_configure x265_pre_configure: $(CMAKE_TOOLCHAIN_PKG) @$(MSG) Configure 12BIT libraries diff --git a/mk/spksrc.cross-cmake-env.mk b/mk/spksrc.cross-cmake-env.mk index 19d452a6c36..d013bb25d0d 100644 --- a/mk/spksrc.cross-cmake-env.mk +++ b/mk/spksrc.cross-cmake-env.mk @@ -90,30 +90,6 @@ ifeq ($(strip $(CMAKE_USE_NINJA)),1) CMAKE_ARGS += -G Ninja endif -# Set default X86ASM build environment -# At toolchain step variables are not yet evaluated -# resulting in inability to set in toolchain file -# -# ARM architecture may expect to be assembled with a C compiler as frontend: -# .s is raw assembly passed to as -# .S is assembly which expects to be preprocessed by a cpp then fed to assembler -# Setting the following for ARM may help: -# ENV += AS=$(abspath $(CURDIR)/../../toolchain/syno-$(ARCH)-$(TCVERSION)/work/$(TC_TARGET)/bin/$(TC_PREFIX)gcc) -ifeq ($(strip $(CMAKE_USE_NASM)),1) - # Define x86asm - ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) - NASM_BINARY = $(shell which nasm) - ifeq ($(NASM_BINARY),) - $(error nasm not found. Please install NASM assembler for CMAKE_USE_NASM=1) - endif - ENABLE_ASSEMBLY = ON - ENV += AS=$(NASM_BINARY) - CMAKE_ASM_COMPILER = $(NASM_BINARY) - endif -else - CMAKE_USE_NASM = 0 -endif - # set default use destdir ifeq ($(strip $(CMAKE_USE_DESTDIR)),) CMAKE_USE_DESTDIR = 1 diff --git a/mk/spksrc.cross-cmake.mk b/mk/spksrc.cross-cmake.mk index 4f5c8d43d88..3c69227975f 100644 --- a/mk/spksrc.cross-cmake.mk +++ b/mk/spksrc.cross-cmake.mk @@ -114,14 +114,6 @@ $(CMAKE_TOOLCHAIN_PKG): cmake_pkg_toolchain: @cat $(CMAKE_TOOLCHAIN_WRK) ; \ echo -ifeq ($(strip $(CMAKE_USE_NASM)),1) -ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) - @echo "# set assembly compiler" ; \ - echo "set(ENABLE_ASSEMBLY $(ENABLE_ASSEMBLY))" ; \ - echo "set(CMAKE_ASM_COMPILER $(CMAKE_ASM_COMPILER))" ; \ - echo -endif -endif @echo "# set compiler flags for cross-compiling" ; \ echo 'set(CMAKE_C_FLAGS "$(CFLAGS) $(CMAKE_C_FLAGS) $(ADDITIONAL_CFLAGS)")' ; \ echo 'set(CMAKE_CPP_FLAGS "$(CPPFLAGS) $(CMAKE_CPP_FLAGS) $(ADDITIONAL_CPPFLAGS)")' ; \ @@ -149,7 +141,6 @@ cmake_configure_target: $(CMAKE_TOOLCHAIN_PKG) @$(MSG) - Dependencies = $(DEPENDS) @$(MSG) - Optional Dependencies = $(OPTIONAL_DEPENDS) @$(MSG) - Use Toolchain File = $(CMAKE_USE_TOOLCHAIN_FILE) [$(CMAKE_TOOLCHAIN_PKG)] - @$(MSG) - Use NASM = $(CMAKE_USE_NASM) @$(MSG) - Use DESTDIR = $(CMAKE_USE_DESTDIR) @$(MSG) - CMake = $(shell which cmake) [$(shell cmake --version | head -1 | awk '{print $$NF}')] @$(MSG) - Path DESTDIR = $(CMAKE_DESTDIR) diff --git a/mk/spksrc.cross-ninja.mk b/mk/spksrc.cross-ninja.mk index 5c85e3bca7e..38a85039d88 100644 --- a/mk/spksrc.cross-ninja.mk +++ b/mk/spksrc.cross-ninja.mk @@ -66,9 +66,6 @@ endif ninja_compile_target: @$(MSG) - Ninja compile @$(MSG) - Ninja build path = $(WORK_DIR)/$(PKG_DIR)/$(NINJA_BUILD_DIR) -ifeq ($(strip $(CMAKE_USE_NINJA)),1) - @$(MSG) - Use NASM = $(CMAKE_USE_NASM) -endif $(RUN) ninja -C $(NINJA_BUILD_DIR) .PHONY: ninja_install_target diff --git a/mk/spksrc.native-cmake-env.mk b/mk/spksrc.native-cmake-env.mk index b04c1e27e51..cfc9eae108c 100644 --- a/mk/spksrc.native-cmake-env.mk +++ b/mk/spksrc.native-cmake-env.mk @@ -27,19 +27,6 @@ ifeq ($(strip $(CMAKE_USE_NINJA)),1) CMAKE_ARGS += -G Ninja endif -# set default ASM build environment -ifeq ($(strip $(CMAKE_USE_NASM)),1) - NASM_BINARY = $(shell which nasm) - ifeq ($(NASM_BINARY),) - $(error nasm not found. Please install NASM assembler for CMAKE_USE_NASM=1) - endif - ENV += AS=$(NASM_BINARY) - CMAKE_ARGS += -DENABLE_ASSEMBLY=ON - CMAKE_ARGS += -DCMAKE_ASM_COMPILER=$(NASM_BINARY) -else - CMAKE_USE_NASM = 0 -endif - # set default use destdir ifeq ($(strip $(CMAKE_USE_DESTDIR)),) CMAKE_USE_DESTDIR = 1 diff --git a/mk/spksrc.native-cmake.mk b/mk/spksrc.native-cmake.mk index 44d131471b6..d04d6cd05f0 100644 --- a/mk/spksrc.native-cmake.mk +++ b/mk/spksrc.native-cmake.mk @@ -98,7 +98,6 @@ cat_PLIST: cmake_configure_target: @$(MSG) - CMake configure @$(MSG) - Dependencies = $(DEPENDS) - @$(MSG) - Use NASM = $(CMAKE_USE_NASM) @$(MSG) - Use DESTDIR = $(CMAKE_USE_DESTDIR) @$(MSG) - Path DESTDIR = $(CMAKE_DESTDIR) @$(MSG) - Path BUILD_DIR = $(CMAKE_BUILD_DIR) From bffe33badbdf70ee524175a5304e6dbad3ce24e6 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Thu, 19 Dec 2024 19:37:32 +0100 Subject: [PATCH 09/15] cross/x264: update build - disable support for OLD_PPC_ARCHS - build with assembler, except for PPC_ARCHS - remove obsolete configure args --enable-pic is forced with --enable-shared --cross-prefix is not required - remove definition of GNU_CONFIGURE and define --host - simplify definition of gcc as assembler if not using x86asm --- cross/x264/Makefile | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/cross/x264/Makefile b/cross/x264/Makefile index f7c72f810ff..18577ac03a7 100644 --- a/cross/x264/Makefile +++ b/cross/x264/Makefile @@ -9,33 +9,39 @@ PKG_DIR = $(PKG_NAME)-$(PKG_GIT_HASH) DEPENDS = +# configure fails in "endian test" +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) + HOMEPAGE = https://www.videolan.org/developers/x264.html COMMENT = x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC forma LICENSE = GPLv2 -GNU_CONFIGURE = 1 - -CONFIGURE_ARGS = --enable-shared -CONFIGURE_ARGS += --enable-pic +# configure with "GNU_CONFIGURE = 1" complains: "Unknown option --build=i686-pc-linux, ignored" +CONFIGURE_ARGS = --prefix=$(INSTALL_PREFIX) +CONFIGURE_ARGS += --enable-shared CONFIGURE_ARGS += --disable-opencl -CONFIGURE_ARGS += --prefix=$(INSTALL_PREFIX) -CONFIGURE_ARGS += --cross-prefix=$(TC_PATH)$(TC_PREFIX) include ../../mk/spksrc.cross-cc.mk -ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH)) -ENV += x264_ARCH=ARM -CONFIGURE_ARGS += --disable-asm -endif +CONFIGURE_ARGS += --host=$(TC_TARGET) -ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) -ENV += x264_ARCH=ARM -CONFIGURE_ARGS += --host=aarch64-linux +# Define x86asm or use gcc as assembler +ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) +NASM_BINARY = $(shell which nasm) +ifeq ($(NASM_BINARY),) +$(error nasm not found. Please install NASM assembler) +endif +ENV += AS=$(NASM_BINARY) +else # Expects to be assembled with a C compiler as frontend # .s is raw assembly passed to as # .S is assembly which expects to be preprocessed by a cpp then fed to assembler # More info: https://code.videolan.org/videolan/x264/-/issues/61 -ENV += AS=$(abspath $(PWD)/../../toolchain/syno-$(ARCH)-$(TCVERSION)/work/$(TC_TARGET)/bin/$(TC_PREFIX)gcc) +ENV += AS=$(TC_PATH)$(TC_PREFIX)gcc +endif + +ifeq ($(findstring $(ARCH),$(ARM_ARCHS)),$(ARCH)) +ENV += x264_ARCH=ARM endif ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH)) @@ -43,15 +49,6 @@ ENV += x264_ARCH=PPC CONFIGURE_ARGS += --disable-asm endif -# Define x86asm -ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) -NASM_BINARY = $(shell which nasm) -ifeq ($(NASM_BINARY),) -$(error nasm not found. Please install NASM assembler) -endif -ENV += AS=$(NASM_BINARY) -endif - ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH)) ENV += x264_ARCH=X86_64 endif From 49d2ca735387d295974afa3631e71af315e88529 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Thu, 19 Dec 2024 19:42:00 +0100 Subject: [PATCH 10/15] update build of cross/libvpx - define --as=auto to use yasmm (prefered over nasm) - document why we don't define GNU_CONFIGRE - remove concurring patch - avoid duplicate definition of --disable-neon --- cross/libvpx/Makefile | 25 ++++++++----------- .../001-gcc-over-ld-configure-fix.patch | 13 ---------- 2 files changed, 10 insertions(+), 28 deletions(-) delete mode 100644 cross/libvpx/patches/DSM-5.2/001-gcc-over-ld-configure-fix.patch diff --git a/cross/libvpx/Makefile b/cross/libvpx/Makefile index 124510107dd..69f3dfca36b 100644 --- a/cross/libvpx/Makefile +++ b/cross/libvpx/Makefile @@ -16,7 +16,10 @@ LICENSE = https://raw.githubusercontent.com/webmproject/libvpx/master/LICENSE INSTALL_TARGET = libvpx_install -CONFIGURE_ARGS += --disable-static --enable-shared --prefix=$(INSTALL_PREFIX) +# configure does not work with GNU_CONFIGURE = 1 (Unknown option "--host=x86_64-pc-linux-gnu") +CONFIGURE_ARGS = --prefix=$(INSTALL_PREFIX) + +CONFIGURE_ARGS += --disable-static --enable-shared CONFIGURE_ARGS += --enable-vp8 --enable-vp9 --disable-examples --disable-docs --disable-unit_tests CONFIGURE_ARGS += --enable-postproc --enable-vp9-postproc --enable-pic CONFIGURE_ARGS += --enable-vp9-highbitdepth --enable-better-hw-compatibility @@ -27,41 +30,33 @@ include ../../mk/spksrc.archs.mk ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --target=generic-gnu -ADDITIONAL_CPPFLAGS = -std=c++0x ADDITIONAL_CXXFLAGS = -std=c++0x endif ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --target=armv7-linux-gcc -CONFIGURE_ARGS += --disable-neon endif ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --target=generic-gnu endif -# neon_asm does not work under armv8/arm64 ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --target=armv8-linux-gcc endif -# Define x86asm -ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) -NASM_BINARY = $(shell which nasm) -ifeq ($(NASM_BINARY),) -$(error nasm not found. Please install NASM assembler) -endif -ENV += AS=$(NASM_BINARY) -CONFIGURE_ARGS += --as=nasm -CONFIGURE_ARGS += --disable-sse4_1 -endif - ifeq ($(findstring $(ARCH),$(i686_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --target=x86-linux-gcc +# --as=auto: prefers yasm over nasm +CONFIGURE_ARGS += --as=auto +CONFIGURE_ARGS += --disable-sse4_1 endif ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --target=x86_64-linux-gcc +# --as=auto: prefers yasm over nasm +CONFIGURE_ARGS += --as=auto +CONFIGURE_ARGS += --disable-sse4_1 endif include ../../mk/spksrc.cross-cc.mk diff --git a/cross/libvpx/patches/DSM-5.2/001-gcc-over-ld-configure-fix.patch b/cross/libvpx/patches/DSM-5.2/001-gcc-over-ld-configure-fix.patch deleted file mode 100644 index cba964fd518..00000000000 --- a/cross/libvpx/patches/DSM-5.2/001-gcc-over-ld-configure-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -uprN ../libvpx-1.8.2/build/make/configure.sh ./build/make/configure.sh ---- ../libvpx-1.8.2/build/make/configure.sh 2019-12-09 18:09:20.000000000 -0500 -+++ ./build/make/configure.sh 2020-02-23 19:52:19.777660739 -0500 -@@ -689,7 +689,8 @@ setup_gnu_toolchain() { - CC=${CC:-${CROSS}gcc} - CXX=${CXX:-${CROSS}g++} - AR=${AR:-${CROSS}ar} -- LD=${LD:-${CROSS}${link_with_cc:-ld}} -+ #LD=${LD:-${CROSS}${link_with_cc:-ld}} -+ LD=${CC} - AS=${AS:-${CROSS}as} - STRIP=${STRIP:-${CROSS}strip} - NM=${NM:-${CROSS}nm} From 72cdfb96c21abe24e9c11d9a44c4ddca122461b8 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Mon, 20 Jan 2025 16:12:01 +0100 Subject: [PATCH 11/15] cross/lame: remove nasm configuration - it is not possible to enable or disable the use of nasm --- cross/lame/Makefile | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/cross/lame/Makefile b/cross/lame/Makefile index 500c95d96cc..bc74830d9af 100644 --- a/cross/lame/Makefile +++ b/cross/lame/Makefile @@ -13,13 +13,18 @@ LICENSE = LGPL GNU_CONFIGURE = 1 -include ../../mk/spksrc.cross-cc.mk +CONFIGURE_ARGS += --disable-static + +# Remarks: +# nasm is autodetected and used for evansport (i386) only +# +# we cannot activate NASM for x64 archs (checking for assembler routines for this processor type... no) +# and we cannot deactivate NASM for evansport (checking for assembler routines for this processor type... yes) +# none of the following args change anything related to nasm: +# --enable-nasm +# --disable-nasm +#ENV += NASM=$(shell which nasm) -ifeq ($(findstring $(ARCH),$(x64_ARCHS) $(i686_ARCHS)),$(ARCH)) -NASM_BINARY = $(shell which nasm) -ifeq ($(NASM_BINARY),) -$(error nasm not found. Please install NASM assembler) -endif -ENV += AS=$(NASM_BINARY) -CONFIGURE_ARGS += --enable-nasm -endif +ADDITIONAL_CFLAGS = -O2 + +include ../../mk/spksrc.cross-cc.mk From 9344927bae81af769bcb05a06b5e9a057681eba1 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Mon, 20 Jan 2025 17:48:47 +0100 Subject: [PATCH 12/15] cross/libvpx: enable sse4_1 again --- cross/libvpx/Makefile | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/cross/libvpx/Makefile b/cross/libvpx/Makefile index 69f3dfca36b..c14c9d43e14 100644 --- a/cross/libvpx/Makefile +++ b/cross/libvpx/Makefile @@ -11,20 +11,21 @@ DEPENDS = UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) HOMEPAGE = https://www.webmproject.org/code/ -COMMENT = WebM VP8/VP9 Codec -LICENSE = https://raw.githubusercontent.com/webmproject/libvpx/master/LICENSE - -INSTALL_TARGET = libvpx_install +COMMENT = WebM VP8/VP9 Codec. +LICENSE = 3-Clause BSD # configure does not work with GNU_CONFIGURE = 1 (Unknown option "--host=x86_64-pc-linux-gnu") +# we have to configure with targets known by this library CONFIGURE_ARGS = --prefix=$(INSTALL_PREFIX) CONFIGURE_ARGS += --disable-static --enable-shared -CONFIGURE_ARGS += --enable-vp8 --enable-vp9 --disable-examples --disable-docs --disable-unit_tests -CONFIGURE_ARGS += --enable-postproc --enable-vp9-postproc --enable-pic +CONFIGURE_ARGS += --enable-pic +CONFIGURE_ARGS += --enable-vp8 --enable-vp9 +CONFIGURE_ARGS += --enable-postproc --enable-vp9-postproc CONFIGURE_ARGS += --enable-vp9-highbitdepth --enable-better-hw-compatibility CONFIGURE_ARGS += --enable-webm-io CONFIGURE_ARGS += --disable-multithread +CONFIGURE_ARGS += --disable-examples --disable-docs --disable-unit_tests include ../../mk/spksrc.archs.mk @@ -49,14 +50,12 @@ ifeq ($(findstring $(ARCH),$(i686_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --target=x86-linux-gcc # --as=auto: prefers yasm over nasm CONFIGURE_ARGS += --as=auto -CONFIGURE_ARGS += --disable-sse4_1 endif ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --target=x86_64-linux-gcc # --as=auto: prefers yasm over nasm CONFIGURE_ARGS += --as=auto -CONFIGURE_ARGS += --disable-sse4_1 endif include ../../mk/spksrc.cross-cc.mk @@ -67,7 +66,3 @@ ifeq ($(call version_le, $(TC_GCC), 5.0),1) CONFIGURE_ARGS += --disable-neon endif endif - -.PHONY: libvpx_install -libvpx_install: - @$(RUN) $(MAKE) install DESTDIR=$(INSTALL_DIR) From 43614030c5420c5cefb142e3cc1b1c6a92f48fd0 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Mon, 20 Jan 2025 22:10:02 +0100 Subject: [PATCH 13/15] ffmpeg*: remove alpine and monaco specific code - we will never build alpine or monaco specific ffmpeg* packages - ffmpeg4: remove nasm path definitions --- cross/ffmpeg4/Makefile | 12 +- .../001-SYNO-alpine-neon-libwscale.patch | 592 ------------------ cross/ffmpeg5/Makefile | 7 +- cross/ffmpeg6/Makefile | 7 +- cross/ffmpeg7/Makefile | 7 +- cross/zstd/Makefile | 3 +- 6 files changed, 10 insertions(+), 618 deletions(-) delete mode 100644 cross/ffmpeg4/patches/alpine/001-SYNO-alpine-neon-libwscale.patch diff --git a/cross/ffmpeg4/Makefile b/cross/ffmpeg4/Makefile index 673c320c3ce..4f83c922bef 100644 --- a/cross/ffmpeg4/Makefile +++ b/cross/ffmpeg4/Makefile @@ -58,11 +58,6 @@ OPTIONAL_DEPENDS += cross/shine # Define x86asm ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) -NASM_BINARY = $(shell which nasm) -ifeq ($(NASM_BINARY),) -$(error nasm not found. Please intall NASM assembler) -endif -ENV += AS=$(NASM_BINARY) CONFIGURE_ARGS += --x86asmexe=nasm # Allow ASM on aarch64, disable on all others @@ -186,13 +181,13 @@ endif DEPENDS += cross/fdk-aac CONFIGURE_ARGS += --enable-libfdk-aac --enable-nonfree -ifeq ($(findstring $(ARCH),alpine comcerto2k monaco $(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) +ifeq ($(findstring $(ARCH),comcerto2k $(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) DEPENDS += cross/libaom CONFIGURE_ARGS += --enable-libaom endif # Add SVT-AV1 codec to supported ARCH -ifeq ($(findstring $(ARCH),alpine comcerto2k monaco $(ARMv8_ARCHS) $(x64_ARCHS)),$(ARCH)) +ifeq ($(findstring $(ARCH),comcerto2k $(ARMv8_ARCHS) $(x64_ARCHS)),$(ARCH)) DEPENDS += cross/svt-av1 CONFIGURE_ARGS += --enable-libsvtav1 endif @@ -215,9 +210,6 @@ endif ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --arch=arm --enable-neon --enable-thumb --disable-armv6 --disable-armv6t2 --disable-vfp --disable-armv5te -ifneq ($(findstring $(ARCH),alpine),$(ARCH)) -CONFIGURE_ARGS += --extra-cflags=-DSYNO_ALPINE_NEON -endif endif ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) diff --git a/cross/ffmpeg4/patches/alpine/001-SYNO-alpine-neon-libwscale.patch b/cross/ffmpeg4/patches/alpine/001-SYNO-alpine-neon-libwscale.patch deleted file mode 100644 index 9ec1f39ca37..00000000000 --- a/cross/ffmpeg4/patches/alpine/001-SYNO-alpine-neon-libwscale.patch +++ /dev/null @@ -1,592 +0,0 @@ -diff -uprN ../ffmpeg-4.3-033/libswscale/arm/Makefile ./libswscale/arm/Makefile ---- ../ffmpeg-4.3-033/libswscale/arm/Makefile 2020-05-21 11:55:31.000000000 -0400 -+++ ./libswscale/arm/Makefile 2020-06-27 10:16:55.938054450 -0400 -@@ -1,8 +1,14 @@ --OBJS += arm/swscale.o \ -- arm/swscale_unscaled.o \ -+OBJS += arm/swscale_unscaled.o \ - - NEON-OBJS += arm/rgb2yuv_neon_32.o - NEON-OBJS += arm/rgb2yuv_neon_16.o - NEON-OBJS += arm/hscale.o \ - arm/output.o \ - arm/yuv2rgb_neon.o \ -+ -+#for SYNO_ALPINE_NEON_LIBSWSCALE -+ifeq ($(EXPORT_BUILD_TARGET), ALPINE) -+OBJS += arm/swscale_arm.o -+ -+CFLAGS += -mfpu=neon-vfpv4 -flax-vector-conversions -std=gnu99 -+endif -diff -uprN ../ffmpeg-4.3-033/libswscale/arm/swscale_arm.c ./libswscale/arm/swscale_arm.c ---- ../ffmpeg-4.3-033/libswscale/arm/swscale_arm.c 1969-12-31 19:00:00.000000000 -0500 -+++ ./libswscale/arm/swscale_arm.c 2020-06-27 10:16:55.938054450 -0400 -@@ -0,0 +1,409 @@ -+/* -+ * AltiVec-enhanced yuv2yuvX -+ * -+ * based on the equivalent C code in swscale.c -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#include -+ -+#include "config.h" -+#include "libswscale/swscale.h" -+#include "libswscale/swscale_internal.h" -+#include "libavutil/attributes.h" -+#include "libavutil/cpu.h" -+#include -+ -+#include -+ -+#define PLD_NEXT(pointer) \ -+ asm( "pld [%0, #256] \n\t" : : "r"(pointer)); -+ -+static int ypfirst = 1; -+static int hsfirst = 1; -+ -+static inline int16_t filter_once(int filterSize, -+ const int16_t *filter, int16x8_t filterMask , -+ uint16x8_t rowSrcA, uint16x8_t rowSrcB) -+{ -+ int val; -+ int32x4_t mult; -+ int32x2_t aggregate; -+ int16_t filter9; -+ int16x8_t filterVec; -+ -+ filterVec = vld1q_s16(filter); -+ if (filterSize > 8) -+ filter9 = filter[8]; -+ PLD_NEXT(filter); -+ -+ if (filterSize < 8) -+ filterVec = vandq_s16(filterMask,filterVec); -+ -+ //now the two filters have 4 16u each. -+ if (filterSize > 8){ -+ val = vgetq_lane_u16(rowSrcB,0) * filter9 ; -+ } else -+ val=0; -+ -+ mult = vdupq_n_u32(0); -+ mult = vmlal_s16(mult,vget_low_s16(filterVec), vget_low_s16(rowSrcA)); -+ mult = vmlal_s16(mult,vget_high_s16(filterVec), vget_high_s16(rowSrcA)); -+ aggregate = vpadd_s32(vget_low_s32(mult), vget_high_s32(mult)); -+ aggregate = vpadd_s32(aggregate, aggregate); -+ val+=vget_lane_s32(aggregate,0); -+ -+ return FFMIN(val >> 7, (1 << 15) - 1); -+} -+ -+static inline void hScale8To15_arm_template(SwsContext *c, int16_t *dst, int dstW, -+ const uint8_t *src, const int16_t *filter, -+ const int32_t *filterPos -+ , int filterSize, int stepSize) -+{ -+ int i; -+ uint16x8_t rowSrcA, rowSrcB, rowSrcC; -+ int16x8_t filterMask; -+ int16_t filterMask_array[8]; -+ int srcCounter=0; -+ int srcCounterLast; -+ const uint8_t *srcPointer=src; -+ int srcCounterNext; -+ int filterMask_start; -+ -+ filterMask_start = filterSize > 8 ? 8 : 0; -+ for (i=filterMask_start; i= srcCounterNext) { -+ dst[i] = filter_once(filterSize, filter, filterMask, rowSrcA, rowSrcB);; -+ filter +=filterSize; -+ i++; -+ srcCounterNext = filterPos[i]; -+ PLD_NEXT(filterPos+i); -+ } -+ } -+ } -+ -+ //Loop-exit: a few last pixels might have -+ //dstw-1 for "filterpos". handle it outside the loop -+ //so we don't have to check inside the loop. -+ while (i 4) -+ filterVecB = vld1_s16(filter+4); -+ if (filterSize > 8) -+ filterVecC = vld1_s16(filter+8); -+ -+ if (filterSize < 12) -+ filterVecC=vset_lane_s16(0,filterVecC,3); -+ if (filterSize < 11) -+ filterVecC=vset_lane_s16(0,filterVecC,2); -+ if (filterSize < 10) -+ filterVecC=vset_lane_s16(0,filterVecC,1); -+ if (filterSize < 9) -+ filterVecC=vset_lane_s16(0,filterVecC,0); -+ if (filterSize < 8) -+ filterVecB=vset_lane_s16(0,filterVecB,3); -+ if (filterSize < 7) -+ filterVecB=vset_lane_s16(0,filterVecB,2); -+ if (filterSize < 6) -+ filterVecB=vset_lane_s16(0,filterVecB,1); -+ if (filterSize < 5) -+ filterVecB=vset_lane_s16(0,filterVecB,0); -+ if (filterSize < 4) -+ filterVecA=vset_lane_s16(0,filterVecA,3); -+ if (filterSize < 3) -+ filterVecA=vset_lane_s16(0,filterVecA,2); -+ if (filterSize < 2) -+ filterVecA=vset_lane_s16(0,filterVecA,1); -+ -+ for (i=0; i 1) { -+ srcLoader=vld1_s16(src[1]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecA, 1); -+ srcLoader=vld1_s16(src[1]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecA, 1); -+ PLD_NEXT(src[1]+i); -+ } -+ if (filterSize > 2) { -+ srcLoader=vld1_s16(src[2]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecA, 2); -+ srcLoader=vld1_s16(src[2]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecA, 2); -+ PLD_NEXT(src[2]+i); -+ } -+ if (filterSize > 3) { -+ srcLoader=vld1_s16(src[3]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecA, 3); -+ srcLoader=vld1_s16(src[3]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecA, 3); -+ PLD_NEXT(src[3]+i); -+ } -+ if (filterSize > 4) { -+ srcLoader=vld1_s16(src[4]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecB, 0); -+ srcLoader=vld1_s16(src[4]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecB, 0); -+ PLD_NEXT(src[4]+i); -+ } -+ if (filterSize > 5) { -+ srcLoader=vld1_s16(src[5]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecB, 1); -+ srcLoader=vld1_s16(src[5]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecB, 1); -+ PLD_NEXT(src[5]+i); -+ } -+ if (filterSize > 6) { -+ srcLoader=vld1_s16(src[6]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecB, 2); -+ srcLoader=vld1_s16(src[6]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecB, 2); -+ PLD_NEXT(src[6]+i); -+ } -+ if (filterSize > 7) { -+ srcLoader=vld1_s16(src[7]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecB, 3); -+ srcLoader=vld1_s16(src[7]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecB, 3); -+ PLD_NEXT(src[7]+i); -+ } -+ if (filterSize > 8) { -+ srcLoader=vld1_s16(src[8]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecC, 0); -+ srcLoader=vld1_s16(src[8]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecC, 0); -+ PLD_NEXT(src[8]+i); -+ } -+ if (filterSize > 9) { -+ srcLoader=vld1_s16(src[9]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecC, 1); -+ srcLoader=vld1_s16(src[9]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecC, 1); -+ PLD_NEXT(src[9]+i); -+ } -+ if (filterSize > 10) { -+ srcLoader=vld1_s16(src[10]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecC, 2); -+ srcLoader=vld1_s16(src[10]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecC, 2); -+ PLD_NEXT(src[10]+i); -+ } -+ if (filterSize > 11) { -+ srcLoader=vld1_s16(src[11]+i); -+ valsA = vmlal_lane_s16(valsA, srcLoader, filterVecC, 3); -+ srcLoader=vld1_s16(src[11]+i+4); -+ valsB = vmlal_lane_s16(valsB, srcLoader, filterVecC, 3); -+ PLD_NEXT(src[11]+i); -+ } -+ -+ valsA=vshrq_n_s32(valsA,16); -+ valsB=vshrq_n_s32(valsB,16); -+ -+ destA_t = vshrn_n_s32(valsA, 3); -+ destB_t = vshrn_n_s32(valsB, 3); -+ dest_t = vcombine_s16(destA_t,destB_t); -+ destVec = vqmovun_s16(dest_t); -+ vst1_u8(dest+i, destVec); -+ } -+} -+ -+extern void yuv2planeX_8_c(const int16_t *filter, int filterSize, -+ const int16_t **src, uint8_t *dest, int dstW, -+ const uint8_t *dither, int offset); -+ -+static void yuv2planeX_8_arm(const int16_t *filter, int filterSize, -+ const int16_t **src, uint8_t *dest, int dstW, -+ const uint8_t *dither, int offset) -+{ -+ if (filterSize==1) -+ yuv2planeX_8_arm_template(filter, 1, src, dest, dstW, dither, offset); -+ else if (filterSize==2) -+ yuv2planeX_8_arm_template(filter, 2, src, dest, dstW, dither, offset); -+ else if (filterSize==3) -+ yuv2planeX_8_arm_template(filter, 3, src, dest, dstW, dither, offset); -+ else if (filterSize==4) -+ yuv2planeX_8_arm_template(filter, 4, src, dest, dstW, dither, offset); -+ else if (filterSize==5) -+ yuv2planeX_8_arm_template(filter, 5, src, dest, dstW, dither, offset); -+ else if (filterSize==6) -+ yuv2planeX_8_arm_template(filter, 6, src, dest, dstW, dither, offset); -+ else if (filterSize==7) -+ yuv2planeX_8_arm_template(filter, 7, src, dest, dstW, dither, offset); -+ else if (filterSize==8) -+ yuv2planeX_8_arm_template(filter, 8, src, dest, dstW, dither, offset); -+ else if (filterSize==9) -+ yuv2planeX_8_arm_template(filter, 9, src, dest, dstW, dither, offset); -+ else if (filterSize==10) -+ yuv2planeX_8_arm_template(filter, 10, src, dest, dstW, dither, offset); -+ else if (filterSize==11) -+ yuv2planeX_8_arm_template(filter, 11, src, dest, dstW, dither, offset); -+ else if (filterSize==12) -+ yuv2planeX_8_arm_template(filter, 12, src, dest, dstW, dither, offset); -+ else { -+ yuv2planeX_8_c(filter, filterSize, src, dest, dstW, dither, offset); -+ if(ypfirst) { -+ fprintf(stderr, "filtersize not supported in yuv2planeX_8_arm! (%d)\n",filterSize); -+ ypfirst = 0; -+ } -+ return; -+ } -+ if(ypfirst) { -+ fprintf(stderr, "filtersize supported in yuv2planeX_8_arm! (%d)\n",filterSize); -+ ypfirst = 0; -+ } -+} -+ -+av_cold void ff_sws_init_swscale_arm(SwsContext *c) -+{ -+ if ((c->srcBpc == 8) && (c->dstBpc <= 14)) { -+ c->hyScale = c->hcScale = hScale8To15_arm; -+ } -+ fprintf(stderr, "Not using hScale8To15_arm c->srcBpc: %d, c->dstBpc:%d\n", c->srcBpc, c->dstBpc); -+} -+ -+void ff_sws_init_output_funcs_arm(SwsContext *c, -+ yuv2planarX_fn *yuv2planeX) -+{ -+ enum AVPixelFormat dstFormat = c->dstFormat; -+ -+ if (is16BPS(dstFormat)) { -+ fprintf(stderr, "Not using yuv2planeX_8_arm is16BPS \n"); -+ } else if (isNBPS(dstFormat)) { -+ fprintf(stderr, "Not using yuv2planeX_8_arm is9_OR_10BPS \n"); -+ } else { -+ *yuv2planeX=yuv2planeX_8_arm; -+ } -+} -diff -uprN ../ffmpeg-4.3-033/libswscale/output.c ./libswscale/output.c ---- ../ffmpeg-4.3-033/libswscale/output.c 2020-06-15 14:54:24.000000000 -0400 -+++ ./libswscale/output.c 2020-06-27 10:16:55.939054518 -0400 -@@ -36,6 +36,8 @@ - #include "swscale.h" - #include "swscale_internal.h" - -+#include "synoconfig.h" -+ - DECLARE_ALIGNED(8, const uint8_t, ff_dither_2x2_4)[][8] = { - { 1, 3, 1, 3, 1, 3, 1, 3, }, - { 2, 0, 2, 0, 2, 0, 2, 0, }, -@@ -377,7 +379,15 @@ yuv2NBPS(14, LE, 0, 10, int16_t) - yuv2NBPS(16, BE, 1, 16, int32_t) - yuv2NBPS(16, LE, 0, 16, int32_t) - -+#if defined(SYNO_ALPINE_NEON_LIBSWSCALE) -+void yuv2planeX_8_c(const int16_t *filter, int filterSize, -+ const int16_t **src, uint8_t *dest, int dstW, -+ const uint8_t *dither, int offset); -+ -+void yuv2planeX_8_c(const int16_t *filter, int filterSize, -+#else - static void yuv2planeX_8_c(const int16_t *filter, int filterSize, -+#endif - const int16_t **src, uint8_t *dest, int dstW, - const uint8_t *dither, int offset) - { -diff -uprN ../ffmpeg-4.3-033/libswscale/swscale.c ./libswscale/swscale.c ---- ../ffmpeg-4.3-033/libswscale/swscale.c 2020-06-15 14:54:24.000000000 -0400 -+++ ./libswscale/swscale.c 2020-06-27 10:18:59.795429102 -0400 -@@ -36,6 +36,8 @@ - #include "swscale_internal.h" - #include "swscale.h" - -+#include "synoconfig.h" -+ - DECLARE_ALIGNED(8, const uint8_t, ff_dither_8x8_128)[9][8] = { - { 36, 68, 60, 92, 34, 66, 58, 90, }, - { 100, 4, 124, 28, 98, 2, 122, 26, }, -@@ -122,7 +124,15 @@ static void hScale16To15_c(SwsContext *c - } - - // bilinear / bicubic scaling -+#if defined(SYNO_ALPINE_NEON_LIBSWSCALE) -+void hScale8To15_c(SwsContext *c, int16_t *dst, int dstW, -+ const uint8_t *src, const int16_t *filter, -+ const int32_t *filterPos, int filterSize); -+ -+void hScale8To15_c(SwsContext *c, int16_t *dst, int dstW, -+#else - static void hScale8To15_c(SwsContext *c, int16_t *dst, int dstW, -+#endif - const uint8_t *src, const int16_t *filter, - const int32_t *filterPos, int filterSize) - { -@@ -481,6 +491,10 @@ static int swscale(SwsContext *c, const - * this array's tail */ - ff_sws_init_output_funcs(c, &yuv2plane1, &yuv2planeX, &yuv2nv12cX, - &yuv2packed1, &yuv2packed2, &yuv2packedX, &yuv2anyX); -+#if defined(SYNO_ALPINE_NEON_LIBSWSCALE) -+ if (ARCH_ARM) /* Should add check for neon existence */ -+ ff_sws_init_output_funcs_arm(c, &yuv2planeX); -+#endif - use_mmx_vfilter= 0; - ff_init_vscale_pfn(c, yuv2plane1, yuv2planeX, yuv2nv12cX, - yuv2packed1, yuv2packed2, yuv2packedX, yuv2anyX, use_mmx_vfilter); -@@ -556,6 +570,10 @@ static av_cold void sws_init_swscale(Sws - &c->yuv2nv12cX, &c->yuv2packed1, - &c->yuv2packed2, &c->yuv2packedX, &c->yuv2anyX); - -+#if defined(SYNO_ALPINE_NEON_LIBSWSCALE) -+ if (ARCH_ARM) /* Should add check for neon existence */ -+ ff_sws_init_output_funcs_arm(c, &c->yuv2planeX); -+#endif - ff_sws_init_input_funcs(c); - - if (c->srcBpc == 8) { -@@ -590,9 +608,10 @@ SwsFunc ff_getSwsFunc(SwsContext *c) - ff_sws_init_swscale_x86(c); - if (ARCH_AARCH64) - ff_sws_init_swscale_aarch64(c); -- if (ARCH_ARM) -+#if defined(SYNO_ALPINE_NEON_LIBSWSCALE) -+ if (ARCH_ARM) /* Should add check for neon existence */ - ff_sws_init_swscale_arm(c); -- -+#endif - return swscale; - } - -diff -uprN ../ffmpeg-4.3-033/libswscale/swscale_internal.h ./libswscale/swscale_internal.h ---- ../ffmpeg-4.3-033/libswscale/swscale_internal.h 2020-06-15 14:54:24.000000000 -0400 -+++ ./libswscale/swscale_internal.h 2020-06-27 10:16:55.940054585 -0400 -@@ -33,6 +33,8 @@ - #include "libavutil/pixdesc.h" - #include "libavutil/ppc/util_altivec.h" - -+#include "synoconfig.h" -+ - #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long - - #define YUVRGB_TABLE_HEADROOM 512 -@@ -875,6 +877,10 @@ void ff_sws_init_swscale_ppc(SwsContext - void ff_sws_init_swscale_vsx(SwsContext *c); - void ff_sws_init_swscale_x86(SwsContext *c); - void ff_sws_init_swscale_aarch64(SwsContext *c); -+#if defined(SYNO_ALPINE_NEON_LIBSWSCALE) -+void ff_sws_init_output_funcs_arm(SwsContext *c, -+ yuv2planarX_fn *yuv2planeX); -+#endif - void ff_sws_init_swscale_arm(SwsContext *c); - - void ff_hyscale_fast_c(SwsContext *c, int16_t *dst, int dstWidth, -diff -uprN ../ffmpeg-4.3-033/libswscale/utils.c ./libswscale/utils.c ---- ../ffmpeg-4.3-033/libswscale/utils.c 2020-06-15 14:54:24.000000000 -0400 -+++ ./libswscale/utils.c 2020-06-27 10:16:55.940054585 -0400 -@@ -1678,8 +1678,12 @@ av_cold int sws_init_context(SwsContext - #endif /* HAVE_MMXEXT_INLINE */ - { - const int filterAlign = X86_MMX(cpu_flags) ? 4 : -+#ifdef SYNO_ALPINE_NEON_LIBSWSCALE -+ PPC_ALTIVEC(cpu_flags) ? 8 : 1; -+#else - PPC_ALTIVEC(cpu_flags) ? 8 : - have_neon(cpu_flags) ? 8 : 1; -+#endif - - if ((ret = initFilter(&c->hLumFilter, &c->hLumFilterPos, - &c->hLumFilterSize, c->lumXInc, -@@ -1705,8 +1709,12 @@ av_cold int sws_init_context(SwsContext - /* precalculate vertical scaler filter coefficients */ - { - const int filterAlign = X86_MMX(cpu_flags) ? 2 : -+#ifdef SYNO_ALPINE_NEON_LIBSWSCALE -+ PPC_ALTIVEC(cpu_flags) ? 8 : 1; -+#else - PPC_ALTIVEC(cpu_flags) ? 8 : - have_neon(cpu_flags) ? 2 : 1; -+#endif - - if ((ret = initFilter(&c->vLumFilter, &c->vLumFilterPos, &c->vLumFilterSize, - c->lumYInc, srcH, dstH, filterAlign, (1 << 12), -diff -uprN ../ffmpeg-4.3-033/synoconfig.h ./synoconfig.h ---- ../ffmpeg-4.3-033/synoconfig.h 2020-06-27 10:16:14.000000000 -0400 -+++ ./synoconfig.h 2020-06-27 10:16:55.941054653 -0400 -@@ -66,3 +66,12 @@ - * See Media Server #386 - */ - #define SYNO_WRITE_RIFF_INFO_TAG_TO_WAV -+ -+/* Use neon acceleration in libswscale, which boosts transcoding -+ * performance on Alpine platform. -+ * The patch is provided by AnnapurnaLabs. -+ * See Video Station #1858 -+ */ -+#if defined(SYNO_VIDEOSTATION) && defined(SYNO_ALPINE_NEON) -+#define SYNO_ALPINE_NEON_LIBSWSCALE -+#endif diff --git a/cross/ffmpeg5/Makefile b/cross/ffmpeg5/Makefile index bbdf4bf1362..ad7f1e4a1e3 100644 --- a/cross/ffmpeg5/Makefile +++ b/cross/ffmpeg5/Makefile @@ -185,13 +185,13 @@ endif DEPENDS += cross/fdk-aac CONFIGURE_ARGS += --enable-libfdk-aac --enable-nonfree -ifeq ($(findstring $(ARCH),alpine comcerto2k monaco $(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) +ifeq ($(findstring $(ARCH),comcerto2k $(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) DEPENDS += cross/libaom CONFIGURE_ARGS += --enable-libaom endif # Add SVT-AV1 codec to supported ARCH -ifeq ($(findstring $(ARCH),alpine comcerto2k monaco $(ARMv8_ARCHS) $(x64_ARCHS)),$(ARCH)) +ifeq ($(findstring $(ARCH),comcerto2k $(ARMv8_ARCHS) $(x64_ARCHS)),$(ARCH)) DEPENDS += cross/svt-av1 CONFIGURE_ARGS += --enable-libsvtav1 endif @@ -214,9 +214,6 @@ endif ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --arch=arm --enable-neon --enable-thumb --disable-armv6 --disable-armv6t2 --disable-vfp --disable-armv5te -ifneq ($(findstring $(ARCH),alpine),$(ARCH)) -CONFIGURE_ARGS += --extra-cflags=-DSYNO_ALPINE_NEON -endif endif ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) diff --git a/cross/ffmpeg6/Makefile b/cross/ffmpeg6/Makefile index 719e65cc3e8..466fea10e34 100644 --- a/cross/ffmpeg6/Makefile +++ b/cross/ffmpeg6/Makefile @@ -185,13 +185,13 @@ endif DEPENDS += cross/fdk-aac CONFIGURE_ARGS += --enable-libfdk-aac --enable-nonfree -ifeq ($(findstring $(ARCH),alpine comcerto2k monaco $(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) +ifeq ($(findstring $(ARCH),comcerto2k $(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) DEPENDS += cross/libaom CONFIGURE_ARGS += --enable-libaom endif # Add SVT-AV1 codec to supported ARCH -ifeq ($(findstring $(ARCH),alpine comcerto2k monaco $(ARMv8_ARCHS) $(x64_ARCHS)),$(ARCH)) +ifeq ($(findstring $(ARCH),comcerto2k $(ARMv8_ARCHS) $(x64_ARCHS)),$(ARCH)) DEPENDS += cross/svt-av1 CONFIGURE_ARGS += --enable-libsvtav1 endif @@ -214,9 +214,6 @@ endif ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --arch=arm --enable-neon --enable-thumb --disable-armv6 --disable-armv6t2 --disable-vfp --disable-armv5te -ifneq ($(findstring $(ARCH),alpine),$(ARCH)) -CONFIGURE_ARGS += --extra-cflags=-DSYNO_ALPINE_NEON -endif endif ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) diff --git a/cross/ffmpeg7/Makefile b/cross/ffmpeg7/Makefile index ab23c2090fa..5a5a26ee41a 100644 --- a/cross/ffmpeg7/Makefile +++ b/cross/ffmpeg7/Makefile @@ -182,13 +182,13 @@ CONFIGURE_ARGS += --enable-libsnappy DEPENDS += cross/fdk-aac CONFIGURE_ARGS += --enable-libfdk-aac --enable-nonfree -ifeq ($(findstring $(ARCH),alpine comcerto2k monaco $(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) +ifeq ($(findstring $(ARCH),comcerto2k $(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) DEPENDS += cross/libaom CONFIGURE_ARGS += --enable-libaom endif # Add SVT-AV1 codec to supported ARCH -ifeq ($(findstring $(ARCH),alpine comcerto2k monaco $(ARMv8_ARCHS) $(x64_ARCHS)),$(ARCH)) +ifeq ($(findstring $(ARCH),comcerto2k $(ARMv8_ARCHS) $(x64_ARCHS)),$(ARCH)) DEPENDS += cross/svt-av1 CONFIGURE_ARGS += --enable-libsvtav1 endif @@ -206,9 +206,6 @@ CONFIGURE_ARGS += --disable-armv5te CONFIGURE_ARGS += --disable-armv6 CONFIGURE_ARGS += --disable-armv6t2 CONFIGURE_ARGS += --disable-vfp -ifneq ($(findstring $(ARCH),alpine),$(ARCH)) -CONFIGURE_ARGS += --extra-cflags=-DSYNO_ALPINE_NEON -endif endif ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) diff --git a/cross/zstd/Makefile b/cross/zstd/Makefile index b2bc3a61b84..0a2e56a7a42 100644 --- a/cross/zstd/Makefile +++ b/cross/zstd/Makefile @@ -12,7 +12,6 @@ COMMENT = Zstandard is a fast compression algorithm, providing high compression LICENSE = GPLv2/BSD MESON_BASE_DIR = $(WORK_DIR)/$(PKG_DIR)/build/meson -#CMAKE_BASE_DIR = $(WORK_DIR)/$(PKG_DIR)/build/cmake include ../../mk/spksrc.common.mk @@ -20,6 +19,8 @@ ifeq ($(call version_lt, ${TC_GCC}, 5),1) ADDITIONAL_CFLAGS = -std=gnu99 endif +ADDITIONAL_CFLAGS += -O + ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(OLD_PPC_ARCHS)),$(ARCH)) ADDITIONAL_LDFLAGS = -lrt endif From 43eeb6593d3bb7d43899f8bbbe4b5cc87566ecc1 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Mon, 20 Jan 2025 23:28:18 +0100 Subject: [PATCH 14/15] libvpx: update comment for --disable-neon --- cross/libvpx/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cross/libvpx/Makefile b/cross/libvpx/Makefile index c14c9d43e14..1440162cf03 100644 --- a/cross/libvpx/Makefile +++ b/cross/libvpx/Makefile @@ -12,7 +12,7 @@ UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) HOMEPAGE = https://www.webmproject.org/code/ COMMENT = WebM VP8/VP9 Codec. -LICENSE = 3-Clause BSD +LICENSE = 3-Clause BSD # configure does not work with GNU_CONFIGURE = 1 (Unknown option "--host=x86_64-pc-linux-gnu") # we have to configure with targets known by this library @@ -60,7 +60,7 @@ endif include ../../mk/spksrc.cross-cc.mk -# Disable NEON on armv7/armv7l/armv8 when using gcc-4.9 or lower +# NEON on armv7/armv7l/armv8 is enabled by default, but fails with gcc-4.9 or lower ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS) $(ARMv8_ARCHS)),$(ARCH)) ifeq ($(call version_le, $(TC_GCC), 5.0),1) CONFIGURE_ARGS += --disable-neon From c9e6be1fbc25b715a3d4ce42ccf4d5198e95c42c Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 21 Jan 2025 19:39:56 +0100 Subject: [PATCH 15/15] revert unintended changes --- cross/zstd/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cross/zstd/Makefile b/cross/zstd/Makefile index 0a2e56a7a42..b2bc3a61b84 100644 --- a/cross/zstd/Makefile +++ b/cross/zstd/Makefile @@ -12,6 +12,7 @@ COMMENT = Zstandard is a fast compression algorithm, providing high compression LICENSE = GPLv2/BSD MESON_BASE_DIR = $(WORK_DIR)/$(PKG_DIR)/build/meson +#CMAKE_BASE_DIR = $(WORK_DIR)/$(PKG_DIR)/build/cmake include ../../mk/spksrc.common.mk @@ -19,8 +20,6 @@ ifeq ($(call version_lt, ${TC_GCC}, 5),1) ADDITIONAL_CFLAGS = -std=gnu99 endif -ADDITIONAL_CFLAGS += -O - ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(OLD_PPC_ARCHS)),$(ARCH)) ADDITIONAL_LDFLAGS = -lrt endif