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}" |
38 local SRC_DIR=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_DIR} | |
39 if [ ! -f "${NACL_CONFIGURE_PATH:-${SRC_DIR}/configure}" ]; then | |
40 echo "No configure script found" | |
41 return | |
42 fi | |
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 | |
33 export DEFINES= | 57 export DEFINES= |
34 if [ "${NACL_GLIBC}" != "1" ]; then | |
35 export DEFINES="-Dstrdup\(a\)=strcpy\(\(char\*\)malloc\(strlen\(a\)+1\),a\)" | |
36 export DEFINES="$DEFINES -Dvsnprintf\(a,b,c,d\)=vsprintf\(a,c,d\)" | |
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 | |
41 export DEFINES="$DEFINES -DNACL -DSYSTEM_NOT_SUPPORTING_D_TYPE=1" | 58 export DEFINES="$DEFINES -DNACL -DSYSTEM_NOT_SUPPORTING_D_TYPE=1" |
42 export LIBS= | 59 export LIBS= |
43 export LIBS="$LIBS -Wl,--whole-archive" | 60 export LIBS="$LIBS -Wl,--whole-archive" |
44 export LIBS="$LIBS -lvorbisfile -lvorbis -logg" | 61 export LIBS="$LIBS -lvorbisfile -lvorbis -logg" |
45 export LIBS="$LIBS -lnacl-mounts" | 62 export LIBS="$LIBS -lnacl_io -ltar" |
46 export LIBS="$LIBS -lppapi -lppapi_cpp -lppapi_cpp_private" | 63 export LIBS="$LIBS -lppapi -lppapi_cpp -lppapi_cpp_private" |
47 export LIBS="$LIBS -Wl,--no-whole-archive" | 64 export LIBS="$LIBS -Wl,--no-whole-archive" |
Sam Clegg
2013/10/25 02:08:24
Are the --whole-archive flags still needed?
binji
2013/10/26 01:13:42
Not if I update the SDL build to include -lnacl_io
| |
48 export CPPFLAGS="-I$NACL_PACKAGES_LIBRARIES" | |
49 | 65 |
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 | 66 # NOTE: disabled mt32emu because it using inline assembly that won't |
53 # validate. | 67 # validate. |
54 ../configure \ | 68 ../configure \ |
55 --host=nacl \ | 69 --host=${conf_host} \ |
56 --libdir=${NACLPORTS_LIBDIR} \ | 70 --libdir=${NACLPORTS_LIBDIR} \ |
57 --disable-flac \ | 71 --disable-flac \ |
58 --disable-zlib \ | 72 --disable-zlib \ |
59 --disable-mt32emu \ | 73 --disable-mt32emu \ |
74 --disable-timidity \ | |
60 --disable-all-engines \ | 75 --disable-all-engines \ |
61 --enable-lure \ | 76 --enable-engine=lure \ |
62 --enable-sky | 77 --enable-engine=sky |
63 } | 78 } |
64 | 79 |
65 InstallStep() { | 80 InstallStep() { |
66 SRC_DIR=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 81 SRC_DIR=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
67 SCUMMVM_DIR=runimage/usr/local/share/scummvm | 82 SCUMMVM_DIR=runimage/usr/local/share/scummvm |
68 ChangeDir ${SRC_DIR} | 83 ChangeDir ${SRC_DIR} |
69 | 84 |
70 mkdir -p ${SCUMMVM_DIR} | 85 mkdir -p ${SCUMMVM_DIR} |
71 cp gui/themes/scummclassic.zip \ | 86 cp gui/themes/scummclassic.zip \ |
72 dists/engine-data/sky.cpt \ | 87 dists/engine-data/sky.cpt \ |
(...skipping 21 matching lines...) Expand all Loading... | |
94 #Lure of the temptress | 109 #Lure of the temptress |
95 LURE_DIR=lure/usr/local/share/scummvm | 110 LURE_DIR=lure/usr/local/share/scummvm |
96 mkdir -p ${LURE_DIR} | 111 mkdir -p ${LURE_DIR} |
97 cp -r ${NACL_PACKAGES_REPOSITORY}/${LURE_NAME}/* ${LURE_DIR} | 112 cp -r ${NACL_PACKAGES_REPOSITORY}/${LURE_NAME}/* ${LURE_DIR} |
98 cd lure | 113 cd lure |
99 tar cf ../lure.tar ./ | 114 tar cf ../lure.tar ./ |
100 cd .. | 115 cd .. |
101 | 116 |
102 Banner "Publishing to ${PUBLISH_DIR}" | 117 Banner "Publishing to ${PUBLISH_DIR}" |
103 MakeDir ${PUBLISH_DIR} | 118 MakeDir ${PUBLISH_DIR} |
119 local ASSEMBLY_DIR=${PUBLISH_DIR}/scummvm | |
104 | 120 |
105 # Prepare AppEngine app. | 121 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 | 122 |
115 # Publish chrome web store app (copy to repository to drop .svn etc). | 123 cp ${START_DIR}/packaged_app/* ${ASSEMBLY_DIR} |
116 MakeDir ${SRC_DIR}/hosted_app | 124 cp ${SRC_DIR}/*.tar ${ASSEMBLY_DIR} |
117 cp ${START_DIR}/hosted_app/* ${SRC_DIR}/hosted_app | 125 if [ "${NACL_DEBUG}" = "1" ]; then |
118 ChangeDir ${SRC_DIR} | 126 cp ${SRC_DIR}/${NACL_BUILD_SUBDIR}/scummvm \ |
119 WEBSTORE_DIR=${PUBLISH_DIR}/web_store | 127 ${ASSEMBLY_DIR}/scummvm_${NACL_ARCH}${NACL_EXEEXT} |
120 MakeDir ${WEBSTORE_DIR} | 128 else |
121 zip -r ${WEBSTORE_DIR}/scummvm-1.2.1.zip hosted_app | 129 ${NACLSTRIP} ${SRC_DIR}/${NACL_BUILD_SUBDIR}/scummvm \ |
122 cp ${START_DIR}/screenshots/* ${WEBSTORE_DIR} | 130 -o ${ASSEMBLY_DIR}/scummvm_${NACL_ARCH}${NACL_EXEEXT} |
123 cp ${START_DIR}/hosted_app/scummvm_128.png ${WEBSTORE_DIR} | 131 fi |
132 | |
133 python ${NACL_SDK_ROOT}/tools/create_nmf.py \ | |
134 ${NACL_CREATE_NMF_FLAGS} \ | |
135 ${ASSEMBLY_DIR}/scummvm_*${NACL_EXEEXT} \ | |
136 -s ${ASSEMBLY_DIR} \ | |
137 -o ${ASSEMBLY_DIR}/scummvm.nmf | |
138 | |
139 if [ "${NACL_ARCH}" = "pnacl" ]; then | |
140 sed -i.bak 's/x-nacl/x-pnacl/' ${ASSEMBLY_DIR}/index.html | |
141 fi | |
142 | |
143 ChangeDir ${PUBLISH_DIR} | |
144 LogExecute zip -r scummvm-1.2.1.zip scummvm | |
124 } | 145 } |
125 | 146 |
126 CustomCheck() { | 147 CustomCheck() { |
127 # verify sha1 checksum for tarball | 148 # verify sha1 checksum for tarball |
128 if ${SHA1CHECK} <$1 &>/dev/null; then | 149 if ${SHA1CHECK} <$1 &>/dev/null; then |
129 return 0 | 150 return 0 |
130 else | 151 else |
131 return 1 | 152 return 1 |
132 fi | 153 fi |
133 } | 154 } |
(...skipping 30 matching lines...) Expand all Loading... | |
164 } | 185 } |
165 | 186 |
166 PackageInstall() { | 187 PackageInstall() { |
167 GameGetStep ${BASS_FLOPPY_URL} ${BASS_FLOPPY_NAME} | 188 GameGetStep ${BASS_FLOPPY_URL} ${BASS_FLOPPY_NAME} |
168 GameGetStep ${LURE_URL} ${LURE_NAME} | 189 GameGetStep ${LURE_URL} ${LURE_NAME} |
169 DefaultPackageInstall | 190 DefaultPackageInstall |
170 } | 191 } |
171 | 192 |
172 PackageInstall | 193 PackageInstall |
173 exit 0 | 194 exit 0 |
OLD | NEW |