openttd.inc: Modifications in anticipation of supporting 1.0.5 release
authorRobert Schuster <r.schuster@tarent.de>
Sat, 12 Mar 2011 17:07:00 +0000 (18:07 +0100)
committerRobert Schuster <r.schuster@tarent.de>
Sat, 12 Mar 2011 17:07:00 +0000 (18:07 +0100)
 * use tar.gz URL because tar.bz2 are not always available
 * added liblzo2 dependency and support
openttd 0.7.4: Accomodate to changes that are not compatible with this version.
 * use tar.bz2 link instead
 * use older configure invocation
 * specify deps without liblzo2

Signed-off-by: Robert Schuster <r.schuster@tarent.de>
recipes/openttd/openttd.inc
recipes/openttd/openttd_0.7.4.bb

index faf702d..bd88a70 100644 (file)
@@ -1,10 +1,11 @@
 DESCRIPTION = "Open source clone of the Microprose game 'Transport Tycoon Deluxe' - SDL edition."
 HOMEPAGE = "http://www.openttd.org"
 LICENSE = "GPLv2"
-DEPENDS = "libsdl-net libpng zlib freetype fontconfig"
+DEPENDS = "libsdl-net libpng zlib lzo2 freetype fontconfig"
+
 RRECOMMENDS_${PN} = "openttd-gfx openttd-sfx"
 
-SRC_URI ="http://binaries.openttd.org/releases/${PV}/${P}-source.tar.bz2"
+SRC_URI ="http://binaries.openttd.org/releases/${PV}/${P}-source.tar.gz"
 
 APPIMAGE = "media/openttd.128.png"
 
@@ -26,6 +27,7 @@ do_configure() {
        --with-zlib=${STAGING_LIBDIR} \
        --with-png \
        --with-freetype \
+       --with-liblzo2=${STAGING_LIBDIR} \
        --without-icu \
        --without-allegro \
        --cc-build='${BUILD_CC}' \
index d59eb6f..e6ca532 100644 (file)
@@ -1,6 +1,50 @@
 require openttd.inc
 
-PR = "r2"
+# lzo2 not neccessary yet in 0.7.4
+DEPENDS = "libsdl-net libpng zlib freetype fontconfig"
+
+# Using the tar.bz2 for this release (they are missing for later releases).
+SRC_URI ="http://binaries.openttd.org/releases/${PV}/${P}-source.tar.bz2"
+
+# Version 0.7.4 can only handle opengfx
+RRECOMMENDS_${PN} = "openttd-gfx"
+
+PR = "r3"
+
+# Override this function from openttd.inc because this 0.7.4's configure does not understand the 'lzo2' specific
+# options and stops on seeing unknown options (Unlike what the real autotools would do. Hooray to people writing their
+# own build systems!).
+do_configure() {
+  # The way the OTTD configure system handles the application's directories
+  # isn't the way autotools does it. Mainly prefix is always prepended even if
+  # absolute binary-dir and data-dir is given. 
+
+  ${S}/configure \
+       --host=${TARGET_SYS} \
+       --windres=${MACHINE_DISPLAY_WIDTH_PIXELS}x${MACHINE_DISPLAY_HEIGHT_PIXELS} \
+       --os=UNIX \
+       --endian=${SITEINFO_ENDIANNESS} \
+       --prefix-dir=${prefix} \
+       --binary-dir=bin \
+       --with-midi=/bin/true \
+       --with-zlib=${STAGING_LIBDIR} \
+       --with-png \
+       --with-freetype \
+       --without-icu \
+       --without-allegro \
+       --cc-build='${BUILD_CC}' \
+       --cc-host='${CC}' \
+       --cxx-build='${BUILD_CXX}' \
+       --cxx-host='${CXX}' \
+       --strip='${STRIP}' \
+       --install-dir=${D}
+}
+
+do_install_append() {
+       # Provide a placeholder sample.cat to allow the game being started.
+       install -d ${D}${datadir}/games/openttd/data/
+       touch ${D}${datadir}/games/openttd/data/sample.cat
+}
 
 SRC_URI_append_shr = " file://openttd.cfg"