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 11 matching lines...) Expand all Loading... | |
22 | 22 |
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="${NACLPORT_LDFLAGS}" |
bradn
2013/01/14 22:20:00
NACLPORTS ?
| |
33 if [ ${NACL_ARCH} = "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=${NACLPORTS_LIBDIR}/pkgconfig |
40 export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} | 40 export PKG_CONFIG_LIBDIR=${NACLPORTS_LIBDIR} |
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 NACLPORTS_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} |
(...skipping 12 matching lines...) Expand all Loading... | |
68 *.nexe \ | 68 *.nexe \ |
69 -L ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib32 \ | 69 -L ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib32 \ |
70 -L ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib64 \ | 70 -L ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib64 \ |
71 -D ${NACL_TOOLCHAIN_ROOT}/bin/x86_64-nacl-objdump \ | 71 -D ${NACL_TOOLCHAIN_ROOT}/bin/x86_64-nacl-objdump \ |
72 -s . \ | 72 -s . \ |
73 -o nethack.nmf | 73 -o nethack.nmf |
74 popd | 74 popd |
75 else | 75 else |
76 cp ${START_DIR}/nethack.nmf ${ASSEMBLY_DIR} | 76 cp ${START_DIR}/nethack.nmf ${ASSEMBLY_DIR} |
77 fi | 77 fi |
78 cp ${NACL_SDK_USR_LIB}/nacl-mounts/*.js ${ASSEMBLY_DIR} | 78 cp ${NACLPORTS_LIBDIR}/nacl-mounts/*.js ${ASSEMBLY_DIR} |
79 cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR} | 79 cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR} |
80 cp ${START_DIR}/icon_16.png ${ASSEMBLY_DIR} | 80 cp ${START_DIR}/icon_16.png ${ASSEMBLY_DIR} |
81 cp ${START_DIR}/icon_48.png ${ASSEMBLY_DIR} | 81 cp ${START_DIR}/icon_48.png ${ASSEMBLY_DIR} |
82 cp ${START_DIR}/icon_128.png ${ASSEMBLY_DIR} | 82 cp ${START_DIR}/icon_128.png ${ASSEMBLY_DIR} |
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_ARCH} = "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 |