Unverified Commit 4f2be019 authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

libtheora: fix ARM build (#413319)

parents e1514c30 8ae7fe9f
Loading
Loading
Loading
Loading
+23 −9
Original line number Diff line number Diff line
{
  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,10 +37,15 @@ stdenv.mkDerivation (finalAttrs: {
  ];
  outputDoc = "devdoc";

  nativeBuildInputs = [
  nativeBuildInputs =
    [
      autoreconfHook
      pkg-config
      validatePkgConfig
    ]
    ++ lib.optionals stdenv.hostPlatform.isArmv7 [
      # Needed to run lib/arm/arm2gnu.pl for ARM assembly optimizations
      perl
    ];

  propagatedBuildInputs = [
@@ -41,6 +53,8 @@ stdenv.mkDerivation (finalAttrs: {
    libvorbis
  ];

  strictDeps = true;

  passthru = {
    tests.pkg-config = testers.hasPkgConfigModules {
      package = finalAttrs.finalPackage;