| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 # | |
| 6 | |
| 7 # nacl-xaos.sh | |
| 8 # | |
| 9 # usage: nacl-xoas.sh | |
| 10 # | |
| 11 # this script downloads, patches, and builds xaos for Native Client. | |
| 12 # | |
| 13 | 5 |
| 14 source pkg_info | 6 source pkg_info |
| 15 source ../../../build_tools/common.sh | 7 source ../../../build_tools/common.sh |
| 16 | 8 |
| 17 EXAMPLE_DIR=${NACL_SRC}/examples/graphics/xaos | 9 EXAMPLE_DIR=${NACL_SRC}/examples/graphics/xaos |
| 10 EXECUTABLES=bin/xaos |
| 18 | 11 |
| 19 CustomPatchStep() { | 12 CustomPatchStep() { |
| 20 local the_patch="${START_DIR}/${PATCH_FILE}" | 13 local the_patch="${START_DIR}/${PATCH_FILE}" |
| 21 local src_dir="${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}" | 14 local src_dir="${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}" |
| 22 Banner "Patching ${PACKAGE_NAME}" | 15 Banner "Patching ${PACKAGE_NAME}" |
| 23 echo "Patch: ${the_patch}" | 16 echo "Patch: ${the_patch}" |
| 24 echo "Src dir: ${src_dir}" | 17 echo "Src dir: ${src_dir}" |
| 25 cd ${src_dir} | 18 cd ${src_dir} |
| 26 patch -p1 -g0 < ${the_patch} | 19 patch -p1 -g0 < ${the_patch} |
| 27 echo "copy nacl driver" | 20 echo "copy nacl driver" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 56 CONFIG_FLAGS="--with-png=no \ | 49 CONFIG_FLAGS="--with-png=no \ |
| 57 --with-long-double=no \ | 50 --with-long-double=no \ |
| 58 --host=nacl \ | 51 --host=nacl \ |
| 59 --with-x11-driver=no \ | 52 --with-x11-driver=no \ |
| 60 --with-sffe=no" | 53 --with-sffe=no" |
| 61 | 54 |
| 62 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 55 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
| 63 | 56 |
| 64 # xaos does not work with a build dir which is separate from the | 57 # xaos does not work with a build dir which is separate from the |
| 65 # src dir - so we copy src -> build | 58 # src dir - so we copy src -> build |
| 66 Remove ${PACKAGE_NAME}-build | 59 Remove build-nacl |
| 67 local tmp=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}.tmp | 60 local tmp=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}.tmp |
| 68 Remove ${tmp} | 61 Remove ${tmp} |
| 69 cp -r ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} ${tmp} | 62 cp -r ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} ${tmp} |
| 70 mv ${tmp} ${PACKAGE_NAME}-build | 63 mv ${tmp} build-nacl |
| 71 | 64 |
| 72 cd ${PACKAGE_NAME}-build | 65 cd build-nacl |
| 73 echo "Directory: $(pwd)" | 66 echo "Directory: $(pwd)" |
| 74 echo "run autoconf" | 67 echo "run autoconf" |
| 75 rm ./configure | 68 rm ./configure |
| 76 autoconf | 69 autoconf |
| 77 echo "Configure options: ${CONFIG_FLAGS}" | 70 echo "Configure options: ${CONFIG_FLAGS}" |
| 78 ./configure ${CONFIG_FLAGS} | 71 ./configure ${CONFIG_FLAGS} |
| 79 } | 72 } |
| 80 | 73 |
| 81 CustomInstallStep(){ | 74 CustomInstallStep(){ |
| 82 local out_dir=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 75 local out_dir=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
| 83 local build_dir=${out_dir}/${PACKAGE_NAME}-build | 76 local build_dir=${out_dir}/build-nacl |
| 84 local publish_dir="${NACL_PACKAGES_PUBLISH}/${PACKAGE_NAME}" | 77 local publish_dir="${NACL_PACKAGES_PUBLISH}/${PACKAGE_NAME}" |
| 85 | 78 |
| 86 MakeDir ${publish_dir} | 79 MakeDir ${publish_dir} |
| 87 install ${START_DIR}/xaos.html ${publish_dir} | 80 install ${START_DIR}/xaos.html ${publish_dir} |
| 88 install ${START_DIR}/xaos.nmf ${publish_dir} | 81 install ${START_DIR}/xaos.nmf ${publish_dir} |
| 89 # Not used yet | 82 # Not used yet |
| 90 install ${build_dir}/help/xaos.hlp ${publish_dir} | 83 install ${build_dir}/help/xaos.hlp ${publish_dir} |
| 91 install ${build_dir}/bin/xaos ${publish_dir}/xaos_${NACL_ARCH}.nexe | 84 install ${build_dir}/bin/xaos ${publish_dir}/xaos_${NACL_ARCH}.nexe |
| 92 DefaultTouchStep | 85 DefaultTouchStep |
| 93 } | 86 } |
| 94 | 87 |
| 95 CustomPackageInstall() { | 88 CustomPackageInstall() { |
| 96 DefaultPreInstallStep | 89 DefaultPreInstallStep |
| 97 DefaultDownloadStep | 90 DefaultDownloadStep |
| 98 DefaultExtractStep | 91 DefaultExtractStep |
| 99 CustomPatchStep | 92 CustomPatchStep |
| 100 CustomConfigureStep | 93 CustomConfigureStep |
| 101 DefaultBuildStep | 94 DefaultBuildStep |
| 102 if [ ${NACL_ARCH} = "pnacl" ] ; then | 95 DefaultTranslateStep |
| 103 DefaultTranslateStep ${PACKAGE_NAME} ${PACKAGE_NAME}-build/bin/xaos | 96 DefaultValidateStep |
| 104 fi | |
| 105 CustomInstallStep | 97 CustomInstallStep |
| 106 DefaultCleanUpStep | 98 DefaultCleanUpStep |
| 107 } | 99 } |
| 108 | 100 |
| 109 CustomPackageInstall | 101 CustomPackageInstall |
| 110 exit 0 | 102 exit 0 |
| OLD | NEW |