#!/bin/bash
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

source pkg_info
source ../../build_tools/common.sh

CustomConfigureStep() {
  Banner "Configuring ${PACKAGE_NAME}"
  # export the nacl tools
  export CC=${NACLCC}
  export CXX=${NACLCXX}
  export AR=${NACLAR}
  export RANLIB=${NACLRANLIB}
  export PATH=${NACL_BIN_PATH}:${PATH};
  export LIB_GTEST=libgtest.a

  ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}
}

CustomInstallStep() {
  # Add chmod here since gtest archive contains readonly files we don't
  # want installed files to be readonly
  LogExecute chmod -R +w .

  Remove ${NACLPORTS_LIBDIR}/${LIB_GTEST}
  LogExecute install -m 644 ${LIB_GTEST} ${NACLPORTS_LIBDIR}/${LIB_GTEST}

  Remove ${NACLPORTS_INCLUDE}/gtest
  LogExecute cp -r include/gtest ${NACLPORTS_INCLUDE}/gtest

  DefaultTouchStep
}

CustomPackageInstall() {
   DefaultPreInstallStep
   DefaultDownloadZipStep
   DefaultExtractZipStep
   DefaultPatchStep
   CustomConfigureStep
   DefaultBuildStep
   CustomInstallStep
   DefaultCleanUpStep
}

CustomPackageInstall
exit 0

#!/bin/bash
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

source pkg_info
source ../../build_tools/common.sh

CustomConfigureStep() {
  Banner "Configuring ${PACKAGE_NAME}"
  # export the nacl tools
  export CC=${NACLCC}
  export CXX=${NACLCXX}
  export AR=${NACLAR}
  export RANLIB=${NACLRANLIB}
  export PATH=${NACL_BIN_PATH}:${PATH};
  export LIB_GTEST=libgtest.a

  ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}
}

CustomInstallStep() {
  Remove ${NACLPORTS_LIBDIR}/${LIB_GTEST}
  install -m 644 ${LIB_GTEST} ${NACLPORTS_LIBDIR}/${LIB_GTEST}

  Remove ${NACLPORTS_INCLUDE}/gtest
  cp -r include/gtest ${NACLPORTS_INCLUDE}/gtest
  DefaultTouchStep
}

CustomPackageInstall() {
   DefaultPreInstallStep
   DefaultDownloadZipStep
   DefaultExtractZipStep
   DefaultPatchStep
   CustomConfigureStep
   DefaultBuildStep
   CustomInstallStep
   DefaultCleanUpStep
}

CustomPackageInstall
exit 0

--- 
+++ 
@@ -20,16 +20,11 @@
 }
 
 CustomInstallStep() {
-  # Add chmod here since gtest archive contains readonly files we don't
-  # want installed files to be readonly
-  LogExecute chmod -R +w .
-
   Remove ${NACLPORTS_LIBDIR}/${LIB_GTEST}
-  LogExecute install -m 644 ${LIB_GTEST} ${NACLPORTS_LIBDIR}/${LIB_GTEST}
+  install -m 644 ${LIB_GTEST} ${NACLPORTS_LIBDIR}/${LIB_GTEST}
 
   Remove ${NACLPORTS_INCLUDE}/gtest
-  LogExecute cp -r include/gtest ${NACLPORTS_INCLUDE}/gtest
-
+  cp -r include/gtest ${NACLPORTS_INCLUDE}/gtest
   DefaultTouchStep
 }
 
Make installed gtest headers writable

git-svn-id: 84b3587ce119b778414dcb50e18b7479aacf4f1d@722 7dad1e8b-422e-d2af-fbf5-8013b78bd812
