Chromium Code Reviews| Index: chrome/installer/linux/debian/build.sh |
| diff --git a/chrome/installer/linux/debian/build.sh b/chrome/installer/linux/debian/build.sh |
| index e43c437774612661fe653301e51c29166487daa0..42ddefe605433f8f8950c8d3af18fec43ecb3ef0 100755 |
| --- a/chrome/installer/linux/debian/build.sh |
| +++ b/chrome/installer/linux/debian/build.sh |
| @@ -128,6 +128,7 @@ usage() { |
| echo "-o dir package output directory [${OUTPUTDIR}]" |
| echo "-b dir build input directory [${BUILDDIR}]" |
| echo "-d brand either chromium or google_chrome" |
| + echo "-s sysroot /path/to/sysroot" |
| echo "-h this help message" |
| } |
| @@ -162,7 +163,7 @@ verify_channel() { |
| } |
| process_opts() { |
| - while getopts ":o:b:c:a:d:h" OPTNAME |
| + while getopts ":s:o:b:c:a:d:h" OPTNAME |
| do |
| case $OPTNAME in |
| o ) |
| @@ -181,6 +182,9 @@ process_opts() { |
| d ) |
| BRANDING="$OPTARG" |
| ;; |
| + s ) |
| + SYSROOT="$OPTARG" |
| + ;; |
| h ) |
| usage |
| exit 0 |
| @@ -217,20 +221,21 @@ if [ "$(uname -m)" = "x86_64" ]; then |
| else |
| TARGETARCH="ia32" |
| fi |
| -if [[ "$(lsb_release -c)" = *"precise" ]]; then |
| - HOST_DISTRO="precise" |
| -elif [[ "$(lsb_release -c)" = *"trusty" ]]; then |
| - HOST_DISTRO="trusty" |
| -else |
| - echo "Debian package can only be build on Ubuntu Precise or Trusty" |
| - exit 1 |
| -fi |
| # call cleanup() on exit |
| trap cleanup 0 |
| process_opts "$@" |
| BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")} |
| +if [[ "$(basename ${SYSROOT})" = "debian_wheezy_"*"-sysroot" ]]; then |
| + TARGET_DISTRO="wheezy" |
| +elif [[ "$(basename ${SYSROOT})" = "debian_jessie_"*"-sysroot" ]]; then |
| + TARGET_DISTRO="jessie" |
| +else |
| + echo "Debian package can only be built using the wheezy or jessie sysroot." |
| + exit 1 |
| +fi |
| + |
| source ${BUILDDIR}/installer/common/installer.include |
| get_version_info |
| @@ -256,13 +261,6 @@ export DEBEMAIL="${MAINTMAIL}" |
| # the LSB sub-packages, to avoid pulling in all that stuff that's not installed |
| # by default. |
| -# Need a dummy debian/control file for dpkg-shlibdeps. |
| -DUMMY_STAGING_DIR="${TMPFILEDIR}/dummy_staging" |
| -mkdir "$DUMMY_STAGING_DIR" |
| -cd "$DUMMY_STAGING_DIR" |
| -mkdir debian |
| -touch debian/control |
| - |
| # Generate the dependencies, |
| # TODO(mmoss): This is a workaround for a problem where dpkg-shlibdeps was |
| # resolving deps using some of our build output shlibs (i.e. |
| @@ -272,33 +270,38 @@ touch debian/control |
| # but it seems that we don't currently, so this is the most expediant fix. |
| SAVE_LDLP=${LD_LIBRARY_PATH:-} |
| unset LD_LIBRARY_PATH |
| -DPKG_SHLIB_DEPS=$(dpkg-shlibdeps -O "$BUILDDIR/chrome" | \ |
| - sed 's/^shlibs:Depends=//') |
| +if [ ${TARGETARCH} == "x64" ]; then |
|
Lei Zhang
2016/10/12 20:55:30
single = again
Tom (Use chromium acct)
2016/10/12 22:02:09
Done.
|
| + SHLIB_ARGS="-l${SYSROOT}/usr/lib/x86_64-linux-gnu" |
| + SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/lib/x86_64-linux-gnu" |
| +else |
| + SHLIB_ARGS="-l${SYSROOT}/usr/lib/i386-linux-gnu" |
| + SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/lib/i386-linux-gnu" |
| +fi |
| +SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/usr/lib" |
| +DPKG_SHLIB_DEPS=$(cd ${SYSROOT} && dpkg-shlibdeps ${SHLIB_ARGS:-} -O \ |
| + -e"$BUILDDIR/chrome" | sed 's/^shlibs:Depends=//') |
| if [ -n "$SAVE_LDLP" ]; then |
| LD_LIBRARY_PATH=$SAVE_LDLP |
| fi |
| # Format it nicely and save it for comparison. |
| -# The grep -v is for a duplicate libc6 dep caused by Lucid glibc silliness. |
| -echo "$DPKG_SHLIB_DEPS" | sed 's/, /\n/g' | \ |
| - grep -v '^libc6 (>= 2.3.6-6~)$' | LANG=C sort > actual |
| +echo "$DPKG_SHLIB_DEPS" | sed 's/, /\n/g' | LANG=C sort > actual |
| -# Compare the expected dependency list to the generate list. |
| +# Compare the expected dependency list to the generated list. |
| BAD_DIFF=0 |
| -diff -u "$SCRIPTDIR/expected_deps_${TARGETARCH}_${HOST_DISTRO}" actual || \ |
| +diff -u "$SCRIPTDIR/expected_deps_${TARGETARCH}_${TARGET_DISTRO}" actual || \ |
| BAD_DIFF=1 |
| if [ $BAD_DIFF -ne 0 ] && [ -z "${IGNORE_DEPS_CHANGES:-}" ]; then |
| echo |
| echo "ERROR: Shared library dependencies changed!" |
| echo "If this is intentional, please update:" |
| - echo "chrome/installer/linux/debian/expected_deps_ia32_precise" |
| - echo "chrome/installer/linux/debian/expected_deps_ia32_trusty" |
| - echo "chrome/installer/linux/debian/expected_deps_x64_precise" |
| - echo "chrome/installer/linux/debian/expected_deps_x64_trusty" |
| + echo "chrome/installer/linux/debian/expected_deps_ia32_jessie" |
| + echo "chrome/installer/linux/debian/expected_deps_ia32_wheezy" |
| + echo "chrome/installer/linux/debian/expected_deps_x64_jessie" |
| + echo "chrome/installer/linux/debian/expected_deps_x64_wheezy" |
| echo |
| exit $BAD_DIFF |
| fi |
| -rm -rf "$DUMMY_STAGING_DIR" |
| # Additional dependencies not in the dpkg-shlibdeps output. |
| # ca-certificates: Make sure users have SSL certificates. |