libtheora: fix ARM build

We need to change to the GitHub source because the release tarball is missing relevant files,
c.f. b167cb4a3e

Without this fix, building ffmpeg for e.g. armv7l-hf-multiplatform fails, because the configure script
hits a linker error while trying to find libtheora .

(cherry picked from commit 8ae7fe9fd3)
This commit is contained in:
Stefan Frijters 2025-06-02 20:22:32 +02:00 committed by github-actions[bot]
parent cbbdf4f690
commit 05ae70d4ed

View file

@ -1,11 +1,12 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitHub,
autoreconfHook,
libogg,
libvorbis,
pkg-config,
perl,
testers,
validatePkgConfig,
}:
@ -14,13 +15,19 @@ stdenv.mkDerivation (finalAttrs: {
pname = "libtheora";
version = "1.2.0";
src = fetchurl {
url = "https://downloads.xiph.org/releases/theora/libtheora-${finalAttrs.version}.tar.gz";
hash = "sha256-J5MnM5kDtUTCipKurafQ3P0Dl7WcLzaMxpisVvUVkG4=";
src = fetchFromGitHub {
owner = "xiph";
repo = "theora";
tag = "v${finalAttrs.version}";
hash = "sha256-kzZh4V6wZX9MetDutuqjRenmdpy4PHaRU9MgtIwPpiU=";
};
patches = lib.optionals stdenv.hostPlatform.isMinGW [ ./mingw-remove-export.patch ];
postPatch = lib.optionalString stdenv.hostPlatform.isArmv7 ''
patchShebangs lib/arm/arm2gnu.pl
'';
configureFlags = [ "--disable-examples" ];
outputs = [
@ -30,17 +37,24 @@ stdenv.mkDerivation (finalAttrs: {
];
outputDoc = "devdoc";
nativeBuildInputs = [
autoreconfHook
pkg-config
validatePkgConfig
];
nativeBuildInputs =
[
autoreconfHook
pkg-config
validatePkgConfig
]
++ lib.optionals stdenv.hostPlatform.isArmv7 [
# Needed to run lib/arm/arm2gnu.pl for ARM assembly optimizations
perl
];
propagatedBuildInputs = [
libogg
libvorbis
];
strictDeps = true;
passthru = {
tests.pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;