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