| 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 source pkg_info | 6 source pkg_info |
| 7 source ../../../build_tools/common.sh | 7 source ../../../build_tools/common.sh |
| 8 | 8 |
| 9 # Beneath a Steel Sky (floppy version) | 9 # Beneath a Steel Sky (floppy version) |
| 10 readonly BASS_FLOPPY_URL=http://commondatastorage.googleapis.com/nativeclient-mi
rror/nacl/scummvm_games/bass/BASS-Floppy-1.3.zip | 10 readonly BASS_FLOPPY_URL=http://commondatastorage.googleapis.com/nativeclient-mi
rror/nacl/scummvm_games/bass/BASS-Floppy-1.3.zip |
| 11 readonly BASS_FLOPPY_NAME=BASS-Floppy-1.3 | 11 readonly BASS_FLOPPY_NAME=BASS-Floppy-1.3 |
| 12 | 12 |
| 13 readonly LURE_URL=http://commondatastorage.googleapis.com/nativeclient-mirror/na
cl/scummvm_games/lure/lure-1.1.zip | 13 readonly LURE_URL=http://commondatastorage.googleapis.com/nativeclient-mirror/na
cl/scummvm_games/lure/lure-1.1.zip |
| 14 readonly LURE_NAME=lure-1.1 | 14 readonly LURE_NAME=lure-1.1 |
| 15 | 15 |
| 16 EXECUTABLES=scummvm |
| 17 |
| 16 SCUMMVM_EXAMPLE_DIR=${NACL_SRC}/examples/games/scummvm | 18 SCUMMVM_EXAMPLE_DIR=${NACL_SRC}/examples/games/scummvm |
| 17 | 19 |
| 18 ConfigureStep() { | 20 ConfigureStep() { |
| 21 # NOTE: We can't use the DefaultConfigureStep, because the scummvm |
| 22 # configure script is hand-rolled, and won't accept additional arguments. |
| 19 Banner "Configuring ${PACKAGE_NAME}" | 23 Banner "Configuring ${PACKAGE_NAME}" |
| 24 # export the nacl tools |
| 20 export CC=${NACLCC} | 25 export CC=${NACLCC} |
| 21 export CXX=${NACLCXX} | 26 export CXX=${NACLCXX} |
| 22 export AR=${NACLAR} | 27 export AR=${NACLAR} |
| 23 # without this setting *make* will not show the full command lines | 28 # without this setting *make* will not show the full command lines |
| 24 export VERBOSE_BUILD=1 | 29 export VERBOSE_BUILD=1 |
| 25 export RANLIB=${NACLRANLIB} | 30 export RANLIB=${NACLRANLIB} |
| 26 export PKG_CONFIG_PATH=${NACLPORTS_LIBDIR}/pkgconfig | 31 export PKG_CONFIG_PATH=${NACLPORTS_LIBDIR}/pkgconfig |
| 27 export PKG_CONFIG_LIBDIR=${NACLPORTS_LIBDIR} | 32 export PKG_CONFIG_LIBDIR=${NACLPORTS_LIBDIR} |
| 28 export CFLAGS=${NACLPORTS_CFLAGS} | 33 export CFLAGS=${NACLPORTS_CFLAGS} |
| 29 export CXXFLAGS=${NACLPORTS_CXXFLAGS} | 34 export CXXFLAGS=${NACLPORTS_CXXFLAGS} |
| 30 export LDFLAGS=${NACLPORTS_LDFLAGS} | 35 export LDFLAGS=${NACLPORTS_LDFLAGS} |
| 31 export PATH="${NACL_BIN_PATH}:${PATH}" | 36 export PATH="${NACL_BIN_PATH}:${PATH}" |
| 32 export PATH="${NACLPORTS_PREFIX_BIN}:${PATH}" | 37 export PATH="${NACLPORTS_PREFIX_BIN}:${PATH}" |
| 33 export DEFINES= | 38 local SRC_DIR=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_DIR} |
| 34 if [ "${NACL_GLIBC}" != "1" ]; then | 39 if [ ! -f "${NACL_CONFIGURE_PATH:-${SRC_DIR}/configure}" ]; then |
| 35 export DEFINES="-Dstrdup\(a\)=strcpy\(\(char\*\)malloc\(strlen\(a\)+1\),a\)" | 40 echo "No configure script found" |
| 36 export DEFINES="$DEFINES -Dvsnprintf\(a,b,c,d\)=vsprintf\(a,c,d\)" | 41 return |
| 37 export DEFINES="$DEFINES -Dsnprintf\(a,b,c,...\)=sprintf\(a,c,__VA_ARGS__\)" | |
| 38 export DEFINES="$DEFINES -Dstrcasecmp=strcmp" | |
| 39 export DEFINES="$DEFINES -Dstrncasecmp=strncmp" | |
| 40 fi | 42 fi |
| 41 export DEFINES="$DEFINES -DNACL -DSYSTEM_NOT_SUPPORTING_D_TYPE=1" | 43 local DEFAULT_BUILD_DIR=${SRC_DIR}/${NACL_BUILD_SUBDIR} |
| 44 local BUILD_DIR=${NACL_BUILD_DIR:-${DEFAULT_BUILD_DIR}} |
| 45 MakeDir ${BUILD_DIR} |
| 46 ChangeDir ${BUILD_DIR} |
| 47 echo "Directory: $(pwd)" |
| 48 |
| 49 local conf_host=${NACL_CROSS_PREFIX} |
| 50 if [ "${NACL_ARCH}" = "pnacl" ]; then |
| 51 conf_host="pnacl" |
| 52 elif [ "${NACL_ARCH}" = "arm" ]; then |
| 53 conf_host="nacl-arm" |
| 54 else |
| 55 conf_host="nacl-x86" |
| 56 fi |
| 57 export DEFINES="-DNACL -DSYSTEM_NOT_SUPPORTING_D_TYPE=1" |
| 42 export LIBS= | 58 export LIBS= |
| 43 export LIBS="$LIBS -Wl,--whole-archive" | 59 export LIBS="$LIBS -Wl,--whole-archive" |
| 44 export LIBS="$LIBS -lvorbisfile -lvorbis -logg" | 60 export LIBS="$LIBS -lvorbisfile -lvorbis -logg" |
| 45 export LIBS="$LIBS -lnacl-mounts" | 61 export LIBS="$LIBS -lnacl_io -ltar" |
| 46 export LIBS="$LIBS -lppapi -lppapi_cpp -lppapi_cpp_private" | 62 export LIBS="$LIBS -lppapi -lppapi_cpp -lppapi_cpp_private" |
| 47 export LIBS="$LIBS -Wl,--no-whole-archive" | 63 export LIBS="$LIBS -Wl,--no-whole-archive" |
| 48 export CPPFLAGS="-I$NACL_PACKAGES_LIBRARIES" | |
| 49 | 64 |
| 50 MakeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}/${NACL_BUILD_SUBDIR} | |
| 51 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}/${NACL_BUILD_SUBDIR} | |
| 52 # NOTE: disabled mt32emu because it using inline assembly that won't | 65 # NOTE: disabled mt32emu because it using inline assembly that won't |
| 53 # validate. | 66 # validate. |
| 54 ../configure \ | 67 ../configure \ |
| 55 --host=nacl \ | 68 --host=${conf_host} \ |
| 56 --libdir=${NACLPORTS_LIBDIR} \ | 69 --libdir=${NACLPORTS_LIBDIR} \ |
| 57 --disable-flac \ | 70 --disable-flac \ |
| 58 --disable-zlib \ | 71 --disable-zlib \ |
| 59 --disable-mt32emu \ | 72 --disable-mt32emu \ |
| 73 --disable-timidity \ |
| 60 --disable-all-engines \ | 74 --disable-all-engines \ |
| 61 --enable-lure \ | 75 --enable-engine=lure \ |
| 62 --enable-sky | 76 --enable-engine=sky |
| 63 } | 77 } |
| 64 | 78 |
| 65 InstallStep() { | 79 InstallStep() { |
| 66 SRC_DIR=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 80 SRC_DIR=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
| 67 SCUMMVM_DIR=runimage/usr/local/share/scummvm | 81 SCUMMVM_DIR=runimage/usr/local/share/scummvm |
| 68 ChangeDir ${SRC_DIR} | 82 ChangeDir ${SRC_DIR} |
| 69 | 83 |
| 70 mkdir -p ${SCUMMVM_DIR} | 84 mkdir -p ${SCUMMVM_DIR} |
| 71 cp gui/themes/scummclassic.zip \ | 85 cp gui/themes/scummclassic.zip \ |
| 72 dists/engine-data/sky.cpt \ | 86 dists/engine-data/sky.cpt \ |
| (...skipping 21 matching lines...) Expand all Loading... |
| 94 #Lure of the temptress | 108 #Lure of the temptress |
| 95 LURE_DIR=lure/usr/local/share/scummvm | 109 LURE_DIR=lure/usr/local/share/scummvm |
| 96 mkdir -p ${LURE_DIR} | 110 mkdir -p ${LURE_DIR} |
| 97 cp -r ${NACL_PACKAGES_REPOSITORY}/${LURE_NAME}/* ${LURE_DIR} | 111 cp -r ${NACL_PACKAGES_REPOSITORY}/${LURE_NAME}/* ${LURE_DIR} |
| 98 cd lure | 112 cd lure |
| 99 tar cf ../lure.tar ./ | 113 tar cf ../lure.tar ./ |
| 100 cd .. | 114 cd .. |
| 101 | 115 |
| 102 Banner "Publishing to ${PUBLISH_DIR}" | 116 Banner "Publishing to ${PUBLISH_DIR}" |
| 103 MakeDir ${PUBLISH_DIR} | 117 MakeDir ${PUBLISH_DIR} |
| 118 local ASSEMBLY_DIR=${PUBLISH_DIR}/scummvm |
| 104 | 119 |
| 105 # Prepare AppEngine app. | 120 MakeDir ${ASSEMBLY_DIR} |
| 106 APPENGINE_DIR=${PUBLISH_DIR}/appengine | |
| 107 MakeDir ${APPENGINE_DIR} | |
| 108 cp `find ${START_DIR}/nacl-scumm -type f -maxdepth 1` ${APPENGINE_DIR} | |
| 109 MakeDir ${APPENGINE_DIR}/static | |
| 110 cp ${START_DIR}/nacl-scumm/static/* ${APPENGINE_DIR}/static | |
| 111 cp ${SRC_DIR}/*.tar ${APPENGINE_DIR}/static | |
| 112 ${NACLSTRIP} ${SRC_DIR}/${NACL_BUILD_SUBDIR}/scummvm \ | |
| 113 -o ${APPENGINE_DIR}/static/scummvm_${NACL_ARCH}.nexe | |
| 114 | 121 |
| 115 # Publish chrome web store app (copy to repository to drop .svn etc). | 122 cp ${START_DIR}/packaged_app/* ${ASSEMBLY_DIR} |
| 116 MakeDir ${SRC_DIR}/hosted_app | 123 cp ${SRC_DIR}/*.tar ${ASSEMBLY_DIR} |
| 117 cp ${START_DIR}/hosted_app/* ${SRC_DIR}/hosted_app | 124 if [ "${NACL_DEBUG}" = "1" ]; then |
| 118 ChangeDir ${SRC_DIR} | 125 cp ${SRC_DIR}/${NACL_BUILD_SUBDIR}/scummvm \ |
| 119 WEBSTORE_DIR=${PUBLISH_DIR}/web_store | 126 ${ASSEMBLY_DIR}/scummvm_${NACL_ARCH}${NACL_EXEEXT} |
| 120 MakeDir ${WEBSTORE_DIR} | 127 else |
| 121 zip -r ${WEBSTORE_DIR}/scummvm-1.2.1.zip hosted_app | 128 ${NACLSTRIP} ${SRC_DIR}/${NACL_BUILD_SUBDIR}/scummvm \ |
| 122 cp ${START_DIR}/screenshots/* ${WEBSTORE_DIR} | 129 -o ${ASSEMBLY_DIR}/scummvm_${NACL_ARCH}${NACL_EXEEXT} |
| 123 cp ${START_DIR}/hosted_app/scummvm_128.png ${WEBSTORE_DIR} | 130 fi |
| 131 |
| 132 python ${NACL_SDK_ROOT}/tools/create_nmf.py \ |
| 133 ${NACL_CREATE_NMF_FLAGS} \ |
| 134 ${ASSEMBLY_DIR}/scummvm_*${NACL_EXEEXT} \ |
| 135 -s ${ASSEMBLY_DIR} \ |
| 136 -o ${ASSEMBLY_DIR}/scummvm.nmf |
| 137 |
| 138 if [ "${NACL_ARCH}" = "pnacl" ]; then |
| 139 sed -i.bak 's/x-nacl/x-pnacl/' ${ASSEMBLY_DIR}/index.html |
| 140 fi |
| 141 |
| 142 ChangeDir ${PUBLISH_DIR} |
| 143 LogExecute zip -r scummvm-1.2.1.zip scummvm |
| 124 } | 144 } |
| 125 | 145 |
| 126 CustomCheck() { | 146 CustomCheck() { |
| 127 # verify sha1 checksum for tarball | 147 # verify sha1 checksum for tarball |
| 128 if ${SHA1CHECK} <$1 &>/dev/null; then | 148 if ${SHA1CHECK} <$1 &>/dev/null; then |
| 129 return 0 | 149 return 0 |
| 130 else | 150 else |
| 131 return 1 | 151 return 1 |
| 132 fi | 152 fi |
| 133 } | 153 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 164 } | 184 } |
| 165 | 185 |
| 166 PackageInstall() { | 186 PackageInstall() { |
| 167 GameGetStep ${BASS_FLOPPY_URL} ${BASS_FLOPPY_NAME} | 187 GameGetStep ${BASS_FLOPPY_URL} ${BASS_FLOPPY_NAME} |
| 168 GameGetStep ${LURE_URL} ${LURE_NAME} | 188 GameGetStep ${LURE_URL} ${LURE_NAME} |
| 169 DefaultPackageInstall | 189 DefaultPackageInstall |
| 170 } | 190 } |
| 171 | 191 |
| 172 PackageInstall | 192 PackageInstall |
| 173 exit 0 | 193 exit 0 |
| OLD | NEW |