From ec910d81405c736a4490383a250299a7837c2e64 Mon Sep 17 00:00:00 2001 From: trav90 Date: Thu, 18 Oct 2018 21:53:44 -0500 Subject: Update aom to commit id e87fb2378f01103d5d6e477a4ef6892dc714e614 --- third_party/aom/build/cmake/version.pl | 109 +++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100755 third_party/aom/build/cmake/version.pl (limited to 'third_party/aom/build/cmake/version.pl') diff --git a/third_party/aom/build/cmake/version.pl b/third_party/aom/build/cmake/version.pl new file mode 100755 index 000000000..323e178f8 --- /dev/null +++ b/third_party/aom/build/cmake/version.pl @@ -0,0 +1,109 @@ +#!/usr/bin/env perl +## +## Copyright (c) 2016, Alliance for Open Media. All rights reserved +## +## This source code is subject to the terms of the BSD 2 Clause License and +## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License +## was not distributed with this source code in the LICENSE file, you can +## obtain it at www.aomedia.org/license/software. If the Alliance for Open +## Media Patent License 1.0 was not distributed with this source code in the +## PATENTS file, you can obtain it at www.aomedia.org/license/patent. +## +use strict; +use warnings; +use 5.010; +use Getopt::Long; + +my $git_desc; +my $version_data; +my $version_filename; +GetOptions('version_data=s' => \$version_data, + 'version_filename=s' => \$version_filename) or + die("Invalid arg(s): $!"); + +if (!defined $version_data || length($version_data) == 0 || + !defined $version_filename || length($version_filename) == 0) { + die("--version_data and --version_filename are required."); +} + +# Determine if $version_data is a filename or a git tag/description. +my $version_string; +chomp($version_data); +if (-r $version_data) { + # $version_data is the path to the CHANGELOG. Parse the most recent version. + my $changelog_filename = $version_data; + open(my $changelog_file, '<', $changelog_filename) or + die("Unable to open CHANGELOG @ $changelog_filename: $!."); + + while (my $line = <$changelog_file>) { + my @split_line = split(" ", $line, 3); + next if @split_line < 2; + $version_string = $split_line[1]; + last if substr($version_string, 0, 1) eq "v"; + } + close($changelog_file); +} else { + # $version_data is either a tag name or a full git description, one of: + # tagName OR tagName-commitsSinceTag-shortCommitHash + # In either case we want the first element of the array returned by split. + $version_string = (split("-", $version_data))[0]; + $git_desc = $version_data; +} + +if (substr($version_string, 0, 1) eq "v") { + $version_string = substr($version_string, 1); +} + +my @version_components = split('\.', $version_string, 4); +my $version_major = $version_components[0]; +my $version_minor = $version_components[1]; +my $version_patch = $version_components[2]; + +my $version_extra = ""; +if (@version_components > 3) { + $version_extra = $version_components[3]; +} + +open(my $version_file, '>', $version_filename) or + die("Cannot open $version_filename: $!"); + +my $version_packed = "((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH))"; +my $year = (localtime)[5] + 1900; +my $lic_block = << "EOF"; +/* + * Copyright (c) $year, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * Media Patent License 1.0 was not distributed with this source code in the + * PATENTS file, you can obtain it at www.aomedia.org/license/patent. + */ +EOF + +select $version_file; +if (length($git_desc)) { + print << "EOF"; +$lic_block +#define VERSION_MAJOR $version_major +#define VERSION_MINOR $version_minor +#define VERSION_PATCH $version_patch +#define VERSION_EXTRA \"$version_extra\" +#define VERSION_PACKED $version_packed +#define VERSION_STRING_NOSP \"$git_desc\" +#define VERSION_STRING \" $git_desc\" +EOF +} else { + print << "EOF"; +$lic_block +#define VERSION_MAJOR $version_major +#define VERSION_MINOR $version_minor +#define VERSION_PATCH $version_patch +#define VERSION_EXTRA \"$version_extra\" +#define VERSION_PACKED $version_packed +#define VERSION_STRING_NOSP \"v$version_string\" +#define VERSION_STRING \" v$version_string\" +EOF +} +close($version_file); -- cgit v1.2.3 From bbcc64772580c8a979288791afa02d30bc476d2e Mon Sep 17 00:00:00 2001 From: trav90 Date: Fri, 19 Oct 2018 21:52:15 -0500 Subject: Update aom to v1.0.0 Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0. --- third_party/aom/build/cmake/version.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'third_party/aom/build/cmake/version.pl') diff --git a/third_party/aom/build/cmake/version.pl b/third_party/aom/build/cmake/version.pl index 323e178f8..7c0608aeb 100755 --- a/third_party/aom/build/cmake/version.pl +++ b/third_party/aom/build/cmake/version.pl @@ -60,8 +60,9 @@ my $version_minor = $version_components[1]; my $version_patch = $version_components[2]; my $version_extra = ""; -if (@version_components > 3) { - $version_extra = $version_components[3]; +if (length($git_desc) > 0) { + my @git_desc_components = split('-', $git_desc, 2); + $version_extra = $git_desc_components[1]; } open(my $version_file, '>', $version_filename) or -- cgit v1.2.3 From d2499ead93dc4298c0882fe98902acb1b5209f99 Mon Sep 17 00:00:00 2001 From: trav90 Date: Fri, 19 Oct 2018 23:05:00 -0500 Subject: Update libaom to commit ID 1e227d41f0616de9548a673a83a21ef990b62591 --- third_party/aom/build/cmake/version.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'third_party/aom/build/cmake/version.pl') diff --git a/third_party/aom/build/cmake/version.pl b/third_party/aom/build/cmake/version.pl index 7c0608aeb..7d23f2b27 100755 --- a/third_party/aom/build/cmake/version.pl +++ b/third_party/aom/build/cmake/version.pl @@ -14,7 +14,7 @@ use warnings; use 5.010; use Getopt::Long; -my $git_desc; +my $git_desc = ''; my $version_data; my $version_filename; GetOptions('version_data=s' => \$version_data, @@ -68,7 +68,7 @@ if (length($git_desc) > 0) { open(my $version_file, '>', $version_filename) or die("Cannot open $version_filename: $!"); -my $version_packed = "((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH))"; +my $version_packed = "((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH))"; my $year = (localtime)[5] + 1900; my $lic_block = << "EOF"; /* @@ -91,7 +91,8 @@ $lic_block #define VERSION_MINOR $version_minor #define VERSION_PATCH $version_patch #define VERSION_EXTRA \"$version_extra\" -#define VERSION_PACKED $version_packed +#define VERSION_PACKED \\ + $version_packed #define VERSION_STRING_NOSP \"$git_desc\" #define VERSION_STRING \" $git_desc\" EOF @@ -102,7 +103,8 @@ $lic_block #define VERSION_MINOR $version_minor #define VERSION_PATCH $version_patch #define VERSION_EXTRA \"$version_extra\" -#define VERSION_PACKED $version_packed +#define VERSION_PACKED \\ + $version_packed #define VERSION_STRING_NOSP \"v$version_string\" #define VERSION_STRING \" v$version_string\" EOF -- cgit v1.2.3