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 # | 5 # |
6 | 6 |
7 # nacl-nethack-343.sh | 7 # nacl-nethack-343.sh |
8 # | 8 # |
9 # usage: nacl-nethack-343.sh | 9 # usage: nacl-nethack-343.sh |
10 # | 10 # |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 CustomBuildStep() { | 24 CustomBuildStep() { |
25 Banner "Building ${PACKAGE_NAME}" | 25 Banner "Building ${PACKAGE_NAME}" |
26 # export the nacl tools | 26 # export the nacl tools |
27 export CC=${NACLCC} | 27 export CC=${NACLCC} |
28 export CXX=${NACLCXX} | 28 export CXX=${NACLCXX} |
29 # NOTE: we are using the non-standard vars NACL_CCFLAGS/NACL_LDFLAGS | 29 # NOTE: we are using the non-standard vars NACL_CCFLAGS/NACL_LDFLAGS |
30 # because we are not running ./configure and the Makefile was hacked | 30 # because we are not running ./configure and the Makefile was hacked |
31 export NACL_CCFLAGS="-O" | 31 export NACL_CCFLAGS="-O" |
32 export NACL_LDFLAGS="" | 32 export NACL_LDFLAGS="" |
33 if [ ${NACL_PACKAGES_BITSIZE} == "pnacl" ] ; then | 33 if [ ${NACL_ARCH} = "pnacl" ] ; then |
34 export NACL_CCFLAGS="-O3 -g" | 34 export NACL_CCFLAGS="-O3 -g" |
35 export NACL_LDFLAGS="-O0 -static" | 35 export NACL_LDFLAGS="-O0 -static" |
36 fi | 36 fi |
37 export AR=${NACLAR} | 37 export AR=${NACLAR} |
38 export RANLIB=${NACLRANLIB} | 38 export RANLIB=${NACLRANLIB} |
39 export PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig | 39 export PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig |
40 export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} | 40 export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} |
41 export PATH=${NACL_BIN_PATH}:${PATH}; | 41 export PATH=${NACL_BIN_PATH}:${PATH}; |
42 export WINTTYLIB="-Wl,--whole-archive" | 42 export WINTTYLIB="-Wl,--whole-archive" |
43 export WINTTYLIB="$WINTTYLIB -lnacl-mounts -lncurses -lppapi -lppapi_cpp" | 43 export WINTTYLIB="$WINTTYLIB -lnacl-mounts -lncurses -lppapi -lppapi_cpp" |
44 export WINTTYLIB="$WINTTYLIB -Wl,--no-whole-archive" | 44 export WINTTYLIB="$WINTTYLIB -Wl,--no-whole-archive" |
45 export NACL_SDK_USR_INCLUDE | 45 export NACL_SDK_USR_INCLUDE |
46 export STRNCMPI=1 | 46 export STRNCMPI=1 |
47 local PACKAGE_DIR="${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}" | 47 local PACKAGE_DIR="${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}" |
48 ChangeDir ${PACKAGE_DIR} | 48 ChangeDir ${PACKAGE_DIR} |
49 cp ${START_DIR}/nethack_pepper.cc ${PACKAGE_DIR}/src | 49 cp ${START_DIR}/nethack_pepper.cc ${PACKAGE_DIR}/src |
50 bash sys/unix/setup.sh | 50 bash sys/unix/setup.sh |
51 make | 51 make |
52 make install | 52 make install |
53 Banner "Installing ${PACKAGE_NAME}" | 53 Banner "Installing ${PACKAGE_NAME}" |
54 local PUBLISH_DIR="${NACL_PACKAGES_PUBLISH}/${PACKAGE_NAME}" | 54 local PUBLISH_DIR="${NACL_PACKAGES_PUBLISH}/${PACKAGE_NAME}" |
55 MakeDir ${PUBLISH_DIR} | 55 MakeDir ${PUBLISH_DIR} |
56 local ASSEMBLY_DIR="${PUBLISH_DIR}/nethack" | 56 local ASSEMBLY_DIR="${PUBLISH_DIR}/nethack" |
57 MakeDir ${ASSEMBLY_DIR} | 57 MakeDir ${ASSEMBLY_DIR} |
58 cp ${PACKAGE_DIR}/out/games/lib/nethackdir/nethack \ | 58 cp ${PACKAGE_DIR}/out/games/lib/nethackdir/nethack \ |
59 ${ASSEMBLY_DIR}/nethack_x86-${NACL_PACKAGES_BITSIZE:-"32"}.nexe | 59 ${ASSEMBLY_DIR}/nethack_${NACL_ARCH}.nexe |
60 ChangeDir ${PACKAGE_DIR}/out/games | 60 ChangeDir ${PACKAGE_DIR}/out/games |
61 rm ${PACKAGE_DIR}/out/games/lib/nethackdir/nethack | 61 rm ${PACKAGE_DIR}/out/games/lib/nethackdir/nethack |
62 tar cf ${ASSEMBLY_DIR}/nethack.tar lib | 62 tar cf ${ASSEMBLY_DIR}/nethack.tar lib |
63 cp ${START_DIR}/nethack.html ${ASSEMBLY_DIR} | 63 cp ${START_DIR}/nethack.html ${ASSEMBLY_DIR} |
64 if [ "${NACL_GLIBC}" = "1" ]; then | 64 if [ "${NACL_GLIBC}" = "1" ]; then |
65 pushd ${ASSEMBLY_DIR} | 65 pushd ${ASSEMBLY_DIR} |
66 TRUE_TOOLCHAIN_DIR=$(cd ${NACL_SDK_ROOT}/toolchain && pwd -P) | 66 TRUE_TOOLCHAIN_DIR=$(cd ${NACL_SDK_ROOT}/toolchain && pwd -P) |
67 python ${TRUE_TOOLCHAIN_DIR}/../tools/create_nmf.py \ | 67 python ${TRUE_TOOLCHAIN_DIR}/../tools/create_nmf.py \ |
68 *.nexe \ | 68 *.nexe \ |
69 -L ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib32 \ | 69 -L ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib32 \ |
(...skipping 13 matching lines...) Expand all Loading... |
83 ChangeDir ${PUBLISH_DIR} | 83 ChangeDir ${PUBLISH_DIR} |
84 zip -r nethack-3.4.3.zip nethack | 84 zip -r nethack-3.4.3.zip nethack |
85 } | 85 } |
86 | 86 |
87 CustomPackageInstall() { | 87 CustomPackageInstall() { |
88 DefaultPreInstallStep | 88 DefaultPreInstallStep |
89 DefaultDownloadStep | 89 DefaultDownloadStep |
90 DefaultExtractStep | 90 DefaultExtractStep |
91 DefaultPatchStep | 91 DefaultPatchStep |
92 CustomBuildStep | 92 CustomBuildStep |
93 if [ ${NACL_PACKAGES_BITSIZE} == "pnacl" ] ; then | 93 if [ ${NACL_ARCH} = "pnacl" ] ; then |
94 # NOTE: nethack does not use a build subdir | 94 # NOTE: nethack does not use a build subdir |
95 DefaultTranslateStep ${PACKAGE_NAME} src/nethack | 95 DefaultTranslateStep ${PACKAGE_NAME} src/nethack |
96 fi | 96 fi |
97 DefaultTouchStep | 97 DefaultTouchStep |
98 DefaultCleanUpStep | 98 DefaultCleanUpStep |
99 } | 99 } |
100 | 100 |
101 CustomPackageInstall | 101 CustomPackageInstall |
102 exit 0 | 102 exit 0 |
OLD | NEW |