From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CE05E158041 for ; Fri, 1 Mar 2024 23:32:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 076E4E2A04; Fri, 1 Mar 2024 23:32:02 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DDD9FE2A04 for ; Fri, 1 Mar 2024 23:32:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C6FFC34310A for ; Fri, 1 Mar 2024 23:32:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F2DD2118C for ; Fri, 1 Mar 2024 23:31:58 +0000 (UTC) From: "James Le Cuirot" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "James Le Cuirot" Message-ID: <1709335889.c7915a37767f37dc8256568f440355d9e1e33e53.chewi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/sunshine/, net-misc/sunshine/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/sunshine/files/sunshine-cross-cbs.patch net-misc/sunshine/sunshine-0.21.0.ebuild net-misc/sunshine/sunshine-9999.ebuild X-VCS-Directories: net-misc/sunshine/ net-misc/sunshine/files/ X-VCS-Committer: chewi X-VCS-Committer-Name: James Le Cuirot X-VCS-Revision: c7915a37767f37dc8256568f440355d9e1e33e53 X-VCS-Branch: master Date: Fri, 1 Mar 2024 23:31:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d5403662-f943-406d-b802-67f8d2f0dec2 X-Archives-Hash: 6f9dcbda1aaf91b19d1c241856144e25 commit: c7915a37767f37dc8256568f440355d9e1e33e53 Author: James Le Cuirot gentoo org> AuthorDate: Fri Mar 1 23:21:39 2024 +0000 Commit: James Le Cuirot gentoo org> CommitDate: Fri Mar 1 23:31:29 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7915a37 net-misc/sunshine: Fix cross-compiling with patch Upstream say they will merge this in time for the next release. Signed-off-by: James Le Cuirot gentoo.org> net-misc/sunshine/files/sunshine-cross-cbs.patch | 59 ++++++++++++++++++++++++ net-misc/sunshine/sunshine-0.21.0.ebuild | 6 ++- net-misc/sunshine/sunshine-9999.ebuild | 6 ++- 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/net-misc/sunshine/files/sunshine-cross-cbs.patch b/net-misc/sunshine/files/sunshine-cross-cbs.patch new file mode 100644 index 000000000000..e6173597e476 --- /dev/null +++ b/net-misc/sunshine/files/sunshine-cross-cbs.patch @@ -0,0 +1,59 @@ +From 40654399bd090dda20750b184eb6b15bc615a5dc Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Sun, 25 Feb 2024 16:24:25 +0000 +Subject: [PATCH] Fix cross-compiling and don't treat x86 as the default case + +If you set arch-specific CFLAGS, then ffmpeg's configure script may +fail when it tries to use these flags against the build host's compiler. + +Also use CMAKE_SYSTEM_PROCESSOR to set up cross-compiling without +relying on any custom variables. ffmpeg normalises its --arch option and +will accept just about any string that you'll likely throw at it. + +diff --git a/cmake/ffmpeg_cbs.cmake b/cmake/ffmpeg_cbs.cmake +index 573bec0..4a75e1a 100644 +--- a/cmake/ffmpeg_cbs.cmake ++++ b/cmake/ffmpeg_cbs.cmake +@@ -30,23 +30,30 @@ if (WIN32) + set(LEADING_SH_COMMAND sh) + endif () + +-if (CROSS_COMPILE_ARM) +- set(FFMPEG_EXTRA_CONFIGURE +- --arch=aarch64 +- --enable-cross-compile) ++string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} arch) ++ ++if (${arch} STREQUAL "aarch64" OR ${arch} STREQUAL "arm64") + set(CBS_ARCH_PATH arm) +-elseif (CROSS_COMPILE_PPC) +- set(FFMPEG_EXTRA_CONFIGURE +- --arch=powerpc64le +- --enable-cross-compile) ++elseif (${arch} STREQUAL "ppc64le") + set(CBS_ARCH_PATH ppc) +-else () ++elseif (${arch} STREQUAL "amd64" OR ${arch} STREQUAL "x86_64") + set(CBS_ARCH_PATH x86) ++else () ++ message(FATAL_ERROR "Unsupported system processor:" ${CMAKE_SYSTEM_PROCESSOR}) ++endif () ++ ++if (CMAKE_CROSSCOMPILING) ++ set(FFMPEG_EXTRA_CONFIGURE --arch=${arch} --enable-cross-compile) + endif () + + # The generated config.h needs to have `CONFIG_CBS_` flags enabled (from `--enable-bsfs`) + execute_process( + COMMAND ${LEADING_SH_COMMAND} ./configure ++ --cc=${CMAKE_C_COMPILER} ++ --cxx=${CMAKE_CXX_COMPILER} ++ --ar=${CMAKE_AR} ++ --ranlib=${CMAKE_RANLIB} ++ --optflags=${CMAKE_C_FLAGS} + --disable-all + --disable-autodetect + --disable-iconv +-- +2.43.2 + diff --git a/net-misc/sunshine/sunshine-0.21.0.ebuild b/net-misc/sunshine/sunshine-0.21.0.ebuild index 22cf946e4348..1c21649b7929 100644 --- a/net-misc/sunshine/sunshine-0.21.0.ebuild +++ b/net-misc/sunshine/sunshine-0.21.0.ebuild @@ -237,6 +237,10 @@ src_unpack() { } src_prepare() { + # Apply CBS patch. + cd "${WORKDIR}"/build-deps || die + eapply "${FILESDIR}"/${PN}-cross-cbs.patch + # Apply general ffmpeg patches. cd "${WORKDIR}"/build-deps/ffmpeg_sources/ffmpeg || die eapply "${WORKDIR}"/build-deps/ffmpeg_patches/ffmpeg/*.patch @@ -329,8 +333,6 @@ src_configure() { local mycmakeargs=( -DBUILD_SHARED_LIBS=no -DCMAKE_INSTALL_PREFIX="${S}"/third-party/ffmpeg - $(usex arm64 -DCROSS_COMPILE_ARM=yes "") - $(usex ppc64 -DCROSS_COMPILE_PPC=yes "") ) CMAKE_USE_DIR="${WORKDIR}/build-deps" cmake_src_configure diff --git a/net-misc/sunshine/sunshine-9999.ebuild b/net-misc/sunshine/sunshine-9999.ebuild index c88478b1a500..641289cdc732 100644 --- a/net-misc/sunshine/sunshine-9999.ebuild +++ b/net-misc/sunshine/sunshine-9999.ebuild @@ -235,6 +235,10 @@ src_unpack() { } src_prepare() { + # Apply CBS patch. + cd "${WORKDIR}"/build-deps || die + eapply "${FILESDIR}"/${PN}-cross-cbs.patch + # Apply general ffmpeg patches. cd "${WORKDIR}"/build-deps/ffmpeg_sources/ffmpeg || die eapply "${WORKDIR}"/build-deps/ffmpeg_patches/ffmpeg/*.patch @@ -327,8 +331,6 @@ src_configure() { local mycmakeargs=( -DBUILD_SHARED_LIBS=no -DCMAKE_INSTALL_PREFIX="${S}"/third-party/ffmpeg - $(usex arm64 -DCROSS_COMPILE_ARM=yes "") - $(usex ppc64 -DCROSS_COMPILE_PPC=yes "") ) CMAKE_USE_DIR="${WORKDIR}/build-deps" cmake_src_configure