| # Copyright 2014 The Android Open Source Project |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| # Default values for all build scripts. |
| |
| SOURCE_PACKAGES="\ |
| expat-2.1.0.tar.gz \ |
| gettext-0.19.1.tar.xz \ |
| glib-2.38.2.tar.xz \ |
| libffi-3.1.tar.gz \ |
| libiconv-1.14.tar.gz \ |
| libpng-1.6.12.tar.xz \ |
| pixman-0.32.4.tar.gz \ |
| pkg-config-0.28.tar.gz \ |
| SDL-1.2.15.tar.gz \ |
| SDL2-2.0.3.tar.gz \ |
| zlib-1.2.8.tar.gz \ |
| " |
| |
| # Extract the version number from a source package. |
| # $1: Unversioned and unsuffixed package name (e.g. "zlib") |
| # Out: package version (e.g. "1.2.8") |
| get_source_package_version () { |
| echo "$SOURCE_PACKAGES" | tr ' ' '\n' | \ |
| grep -e "^$1-" | sed -e "s|^$1-\(.*\)\.tar\..z$|\\1|g" |
| } |
| |
| # Extract the package name for a given library. |
| # $1: Unversioned and unsuffixed package name (e.g. "zlib") |
| # Out: package name (e.g. "zlib-1.2.8.tar.gz") |
| get_source_package_name () { |
| echo "$SOURCE_PACKAGES" | tr ' ' '\n' | grep -e "^$1-" |
| } |