Skip to content

Commit 4f2be01

Browse files
libtheora: fix ARM build (#413319)
2 parents e1514c3 + 8ae7fe9 commit 4f2be01

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

pkgs/by-name/li/libtheora/package.nix

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
lib,
33
stdenv,
4-
fetchurl,
4+
fetchFromGitHub,
55
autoreconfHook,
66
libogg,
77
libvorbis,
88
pkg-config,
9+
perl,
910
testers,
1011
validatePkgConfig,
1112
}:
@@ -14,13 +15,19 @@ stdenv.mkDerivation (finalAttrs: {
1415
pname = "libtheora";
1516
version = "1.2.0";
1617

17-
src = fetchurl {
18-
url = "https://downloads.xiph.org/releases/theora/libtheora-${finalAttrs.version}.tar.gz";
19-
hash = "sha256-J5MnM5kDtUTCipKurafQ3P0Dl7WcLzaMxpisVvUVkG4=";
18+
src = fetchFromGitHub {
19+
owner = "xiph";
20+
repo = "theora";
21+
tag = "v${finalAttrs.version}";
22+
hash = "sha256-kzZh4V6wZX9MetDutuqjRenmdpy4PHaRU9MgtIwPpiU=";
2023
};
2124

2225
patches = lib.optionals stdenv.hostPlatform.isMinGW [ ./mingw-remove-export.patch ];
2326

27+
postPatch = lib.optionalString stdenv.hostPlatform.isArmv7 ''
28+
patchShebangs lib/arm/arm2gnu.pl
29+
'';
30+
2431
configureFlags = [ "--disable-examples" ];
2532

2633
outputs = [
@@ -30,17 +37,24 @@ stdenv.mkDerivation (finalAttrs: {
3037
];
3138
outputDoc = "devdoc";
3239

33-
nativeBuildInputs = [
34-
autoreconfHook
35-
pkg-config
36-
validatePkgConfig
37-
];
40+
nativeBuildInputs =
41+
[
42+
autoreconfHook
43+
pkg-config
44+
validatePkgConfig
45+
]
46+
++ lib.optionals stdenv.hostPlatform.isArmv7 [
47+
# Needed to run lib/arm/arm2gnu.pl for ARM assembly optimizations
48+
perl
49+
];
3850

3951
propagatedBuildInputs = [
4052
libogg
4153
libvorbis
4254
];
4355

56+
strictDeps = true;
57+
4458
passthru = {
4559
tests.pkg-config = testers.hasPkgConfigModules {
4660
package = finalAttrs.finalPackage;

0 commit comments

Comments
 (0)