Bug 1507057 - libtheora: replace libtheora's README_MOZILLA with moz.yaml; r=jya
authorbyron jones <glob@mozilla.com>
Thu, 15 Nov 2018 12:04:58 +0000
changeset 446574 59026ada59bd0fe1f7f0299b89069f8e27411ef5
parent 446573 83fc4342c255dff83427b1bc5269ff97a371463e
child 446577 cbeaa2d94304d26f51959067aab7ba74b805634a
child 446610 4cfa567d738036fb0f276d4d434b73cf8cfa3192
push id35043
push userebalazs@mozilla.com
push dateThu, 15 Nov 2018 16:12:36 +0000
treeherdermozilla-central@59026ada59bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1507057
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507057 - libtheora: replace libtheora's README_MOZILLA with moz.yaml; r=jya Add moz.yaml and update `update.sh` to match other media libraries. Note after upstream's switch from SVN to git the RSC headers have changed, however, these changes have not yet been committed. I've updated the patch that had hunks with context extending into the RSC header so it continues to apply after pulling from git. Differential Revision: https://phabricator.services.mozilla.com/D11975
media/libtheora/README_MOZILLA
media/libtheora/bug920992.patch
media/libtheora/moz.yaml
media/libtheora/update.sh
deleted file mode 100644
--- a/media/libtheora/README_MOZILLA
+++ /dev/null
@@ -1,5 +0,0 @@
-The source from this directory was copied from the theora git master
-using the update.sh script. The changes made were those applied by update.sh,
-the addition/update of Makefile.in files for the Mozilla build system.
-
-The git commit used was 74b57560775804bf248e3e5b4e57964112ccd7af
--- a/media/libtheora/bug920992.patch
+++ b/media/libtheora/bug920992.patch
@@ -1,15 +1,15 @@
 diff --git a/media/libtheora/lib/arm/armbits.s b/media/libtheora/lib/arm/armbits.s
 --- a/media/libtheora/lib/arm/armbits.s
 +++ b/media/libtheora/lib/arm/armbits.s
 @@ -12,16 +12,22 @@
  ;
  ; function:
- ;   last mod: $Id: armbits.s 17481 2010-10-03 22:49:42Z tterribe $
+ ;   last mod: $Id$
  ;
  ;********************************************************************
  
  	AREA	|.text|, CODE, READONLY
  
 +	; Explicitly specifying alignment here because some versions of
 +	; gas don't align code correctly. See
 +	; http://lists.gnu.org/archive/html/bug-binutils/2011-06/msg00199.html
@@ -26,17 +26,17 @@ diff --git a/media/libtheora/lib/arm/arm
  	LDMIA r12,{r2,r3}      ; r2 = window
 diff --git a/media/libtheora/lib/arm/armfrag.s b/media/libtheora/lib/arm/armfrag.s
 --- a/media/libtheora/lib/arm/armfrag.s
 +++ b/media/libtheora/lib/arm/armfrag.s
 @@ -11,16 +11,22 @@
  ;********************************************************************
  ; Original implementation:
  ;  Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd
- ; last mod: $Id: armfrag.s 17481 2010-10-03 22:49:42Z tterribe $
+ ; last mod: $Id$
  ;********************************************************************
  
  	AREA	|.text|, CODE, READONLY
  
 +	; Explicitly specifying alignment here because some versions of
 +	; gas don't align code correctly. See
 +	; http://lists.gnu.org/archive/html/bug-binutils/2011-06/msg00199.html
 +	; https://bugzilla.mozilla.org/show_bug.cgi?id=920992
@@ -52,17 +52,17 @@ diff --git a/media/libtheora/lib/arm/arm
  
 diff --git a/media/libtheora/lib/arm/armidct.s b/media/libtheora/lib/arm/armidct.s
 --- a/media/libtheora/lib/arm/armidct.s
 +++ b/media/libtheora/lib/arm/armidct.s
 @@ -11,16 +11,22 @@
  ;********************************************************************
  ; Original implementation:
  ;  Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd
- ; last mod: $Id: armidct.s 17481 2010-10-03 22:49:42Z tterribe $
+ ; last mod: $Id$
  ;********************************************************************
  
  	AREA	|.text|, CODE, READONLY
  
 +	; Explicitly specifying alignment here because some versions of
 +	; gas don't align code correctly. See
 +	; http://lists.gnu.org/archive/html/bug-binutils/2011-06/msg00199.html
 +	; https://bugzilla.mozilla.org/show_bug.cgi?id=920992
@@ -78,17 +78,17 @@ diff --git a/media/libtheora/lib/arm/arm
  	; r1 = ogg_uint16_t  _dc
 diff --git a/media/libtheora/lib/arm/armloop.s b/media/libtheora/lib/arm/armloop.s
 --- a/media/libtheora/lib/arm/armloop.s
 +++ b/media/libtheora/lib/arm/armloop.s
 @@ -11,16 +11,22 @@
  ;********************************************************************
  ; Original implementation:
  ;  Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd
- ; last mod: $Id: armloop.s 17481 2010-10-03 22:49:42Z tterribe $
+ ; last mod: $Id$
  ;********************************************************************
  
  	AREA	|.text|, CODE, READONLY
  
 +	; Explicitly specifying alignment here because some versions of
 +	; gas don't align code correctly. See
 +	; http://lists.gnu.org/archive/html/bug-binutils/2011-06/msg00199.html
 +	; https://bugzilla.mozilla.org/show_bug.cgi?id=920992
new file mode 100644
--- /dev/null
+++ b/media/libtheora/moz.yaml
@@ -0,0 +1,21 @@
+# Version of this schema
+schema: 1
+
+bugzilla:
+  # Bugzilla product and component for this directory and subdirectories
+  product: "Core"
+  component: "Audio/Video: Playback"
+
+# The source from this directory was copied from the theora git master using
+# the update.sh script. The changes made were those applied by update.sh, the
+# addition/update of Makefile.in files for the Mozilla build system.
+
+origin:
+  name: "libtheora"
+  description: "Video compression format from Xiph"
+
+  url: "https://www.theora.org/"
+  license: "BSD-3-Clause-Clear"
+
+  # update.sh will update this value
+  release: "74b57560775804bf248e3e5b4e57964112ccd7af (2010-10-29 04:21:26 +0000)"
old mode 100644
new mode 100755
--- a/media/libtheora/update.sh
+++ b/media/libtheora/update.sh
@@ -1,26 +1,39 @@
+#!/bin/bash
+
 # Usage: ./update.sh <theora_src_directory>
 #
 # Copies the needed files from a directory containing the original
 # libtheora source that we need for the Mozilla HTML5 media support.
+#
+# https://git.xiph.org/theora.git
+# Run `autogen.sh` in the theora source clone prior to executing this script.
+
+set -e
+
+[[ -n "$1" ]] || ( echo "syntax: $0 update_src_directory"; exit 1 )
+[[ -e "$1/include/theora/theora.h" ]] || ( echo "$1: cubeb not found"; exit 1 )
+
 sed \
  -e s/\#define\ OC_X86_ASM//g \
  -e s/\#define\ OC_X86_64_ASM//g \
  -e s/\#define\ OC_ARM_ASM_EDSP\ 1//g \
  -e s/\#define\ OC_ARM_ASM_MEDIA\ 1//g \
  -e s/\#define\ OC_ARM_ASM_NEON\ 1//g \
  -e s/\#define\ OC_ARM_ASM//g \
  -e s/\#define\ THEORA_DISABLE_ENCODE//g \
  $1/config.h > lib/config.h
+
 sed \
  -e s/@HAVE_ARM_ASM_EDSP@/1/g \
  -e s/@HAVE_ARM_ASM_MEDIA@/1/g \
  -e s/@HAVE_ARM_ASM_NEON@/1/g \
  $1/lib/arm/armopts.s.in > lib/arm/armopts.s
+
 cp $1/LICENSE ./LICENSE
 cp $1/CHANGES ./CHANGES
 cp $1/COPYING ./COPYING
 cp $1/README ./README
 cp $1/AUTHORS ./AUTHORS
 cp $1/lib/bitpack.c ./lib/
 cp $1/lib/bitpack.h ./lib/
 cp $1/lib/dct.h ./lib/
@@ -70,13 +83,41 @@ cp $1/lib/x86_vc/mmxstate.c ./lib/x86_vc
 cp $1/lib/x86_vc/x86cpu.c ./lib/x86_vc/
 cp $1/lib/x86_vc/x86cpu.h ./lib/x86_vc/
 cp $1/lib/x86_vc/x86int.h ./lib/x86_vc/
 cp $1/lib/x86_vc/x86state.c ./lib/x86_vc/
 cp $1/include/theora/theora.h ./include/theora/theora.h
 cp $1/include/theora/theoradec.h ./include/theora/theoradec.h
 cp $1/include/theora/theoraenc.h ./include/theora/theoraenc.h
 cp $1/include/theora/codec.h ./include/theora/codec.h
+
+if [ -d $1/.git ]; then
+  rev=$(cd $1 && git rev-parse --verify HEAD)
+  date=$(cd $1 && git show -s --format=%ci HEAD)
+  dirty=$(cd $1 && git diff-index --name-only HEAD)
+  set +e
+  pre_rev=$(grep -o '[[:xdigit:]]\{40\}' moz.yaml)
+  commits=$(cd $1 && git log --pretty=format:'%h - %s' $pre_rev..$rev)
+  set -e
+fi
+
+if [ -n "$rev" ]; then
+  version=$rev
+  if [ -n "$dirty" ]; then
+    version=$version-dirty
+    echo "WARNING: updating from a dirty git repository."
+  fi
+  sed -i.bak -e "s/^ *release:.*/  release: \"$version ($date)\"/" moz.yaml
+  if [[ ! "$( grep "$version" moz.yaml )" ]]; then
+    echo "Updating moz.yaml failed."
+    exit 1
+  fi
+  rm moz.yaml.bak
+  [[ -n "$commits" ]] && echo -e "Pick commits:\n$commits"
+else
+  echo "Remember to update moz.yaml with the version details."
+fi
+
 patch -p3 < ./bug625773-r17780.patch
 patch -p3 < ./bug468275-r18219.patch
 patch -p3 < ./bug752139-r18031.patch
 patch -p3 < ./bug752668-r18268.patch
 patch -p3 < ./bug920992.patch